35 (void)uc_reg_read(uc, UC_ARM_REG_LR, &lr);
36 (void)uc_reg_write(uc, UC_ARM_REG_R0, &r0);
37 uint32_t pc = lr & ~1U;
38 (void)uc_reg_write(uc, UC_ARM_REG_PC, &pc);
39 (void)uc_emu_stop(uc);
50 k_seam_hook_slots = 24U,
52 static uc_hook s_handles[k_seam_hook_slots];
53 static uint32_t s_handle_n;
54 if (s_handle_n < (uint32_t)(
sizeof(s_handles) /
sizeof(s_handles[0]))) {
55 (void)uc_hook_add(uc, &s_handles[s_handle_n], UC_HOOK_CODE, cb,
nullptr, addr, addr);
77 (void)uc_reg_read(uc, UC_ARM_REG_LR, &lr);
100 const char*
const* names,
104 for (uint32_t i = 0U; (i < count) && (i < (uint32_t)
k_trace_sym_max); i++) {
105 const uint32_t addr =
elf_sym_addr(elf, names[i],
nullptr);
107 (void)
priv_emu_io_errf(
" [symtrace] %s: symbol not found -- skipped\n", names[i]);
110 (void)uc_hook_add(uc,
117 (void)
priv_emu_io_errf(
" [symtrace] %s armed @ 0x%08X\n", names[i], (
unsigned)addr);
ELF32 image services for the board emulator (load / symbols / vectors).
uint32_t elf_sym_addr(const emu_elf_source_t *elf, const char *name, uint32_t *size_out)
Resolve a function symbol's entry address from the ELF .symtab.
Bounded raw-descriptor I/O seam for the RA8 emulator.
emu_io_result_t priv_emu_io_errf(const char *format,...)
Format bounded text and write it to the injected error descriptor.
void sym_trace_install(uc_engine *uc, const emu_elf_source_t *elf, const char *const *names, uint32_t count)
Install a --trace-sym entry hook for every requested symbol present.
void eth_seam_hook(uc_engine *uc, const emu_elf_source_t *elf, const char *name, void *cb)
Hook one symbol (if present) to cb; record it for the report.
static RA8_INTERNAL void internal_on_sym_trace(uc_engine *uc, uint64_t address, uint32_t size, void *user)
Perform on sym trace for the emu trace model.
void eth_hook_return(uc_engine *uc, uint32_t r0)
Emulate "return r0;" from a hooked function: set R0, branch to LR.
Function-entry seam glue + the –trace-sym instrument.
@ k_trace_sym_max
Max –trace-sym functions per run.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
One independently owned immutable raw-descriptor ELF source.