...
instru_insert_mov_pc(drcontext, bb, inst, opnd_create_reg(ESP_SLOW_SCRATCH2), opnd_create_instr(retaddr));
app_pc pc = (sp_action == SP_ADJUST_ACTION_ZERO) ?
shared_esp_slowpath_zero :
((sp_action == SP_ADJUST_ACTION_DEFINED) ?
shared_esp_slowpath_defined :
shared_esp_slowpath_shadow);
branch_aarch64(drcontext, bb, inst, opnd_create_pc(pc));
PRE(bb, inst, retaddr);
...
...
mov_str_aarch64(drcontext, ilist, NULL, spill_slot_opnd(drcontext, esp_spill_slot_base(sp_action)),
opnd_create_reg(ESP_SLOW_SCRATCH2), NULL);
dr_insert_clean_call(drcontext, ilist, NULL,
(void *)handle_esp_adjust_shared_slowpath, false, 2,
opnd_create_reg(ESP_SLOW_SCRATCH1), OPND_CREATE_INT32(sp_action));
...
...
app_pc pc = (app_pc) get_own_tls_value(esp_spill_slot_base(sp_action));
instr_t inst;
void *drcontext = dr_get_current_drcontext();
/* We decode forward past eflags and register restoration, none of which
* should reference esp. The next instr is the app instr.
*/
instr_init(drcontext, &inst);
while (true) {
pc = decode(drcontext, pc, &inst);
...
byte *
decode_common(dcontext_t *dcontext, byte *pc, byte *orig_pc, instr_t *instr)
{
byte *next_pc = pc + 4;
uint enc = *(uint *)pc; // <- SIGSEGV here
...
* thread #1, name = 'simple', stop reason = signal SIGSEGV: invalid address (fault address: 0x51c81000)
frame #0: 0x00000000712b3af4
-> 0x712b3af4: ldr w0, [x0]
0x712b3af8: str w0, [sp, #0x4c]
0x712b3afc: adrp x0, 238
0x712b3b00: add x5, x0, #0x630 ; =0x630
instru_insert_mov_pc(drcontext, bb, inst, opnd_create_reg(ESP_SLOW_SCRATCH2), opnd_create_instr(retaddr));
instru_insert_mov_pc(drcontext, bb, inst, opnd_create_reg(ESP_SLOW_SCRATCH2), OPND_CREATE_INT64(7));
addres space init pc 0x45d83000 info.base_pc 0x45d83000 info.size 268238848 info.type 2
umbra_add_app_segment entered MAX_NUM_APP_SEGMENTS 7
umbra_add_app_segment i: 0
size 268238848 base 0x45d83000 >= app_segments[i].app_base 0xff0000000000 base + size 0x55d53000 <= app_segments[i].app_end 0x1000000000000
umbra_add_app_segment i: 1
umbra_add_app_segment app_segment: 1 return true 1
addres space init pc 0x55d53000 info.base_pc 0x55d53000 info.size 455790592 info.type 0
addres space init pc 0x71000000 info.base_pc 0x71000000 info.size 4087808 info.type 1
--
---
You received this message because you are subscribed to the Google Groups "Dr. Memory Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drmemory-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drmemory-users/226580e2-c148-46f9-b4ad-71c50272beeeo%40googlegroups.com.
if (src_inst != NULL)
val = (ptr_int_t)encode_estimate;
if (src_inst != NULL && instr_get_app_pc(src_inst) != NULL) val = (ptr_int_t)instr_get_app_pc(src_inst)
else
val = (ptr_int_t)encode_estimate;
PRE(bb, inst, retaddr);
instru_insert_mov_pc(drcontext, bb, inst, opnd_create_reg(ESP_SLOW_SCRATCH2), opnd_create_instr(inst));
To unsubscribe from this group and stop receiving emails from it, send an email to drmemor...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to drmemory-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drmemory-users/9af76b37-6220-4534-9dc5-3284e1fac4c3o%40googlegroups.com.
if (src_inst != NULL && instr_get_app_pc(src_inst) != NULL)
val = (ptr_int_t)instr_get_app_pc(src_inst)
else if (src_inst != NULL)
val = (ptr_int_t)encode_estimate;
Had a try of adding the opnd_create_instr_ex as you said. In the encode_gen.h file generated from aarch64/codec.txt the case for handling movz has a strict check that the operand is a imm16 and fails on something of type instr. I know the b encoding handles instructions so I had a poke in there and it has a bespoke function handler in codec.c, encode_opnds_b(), which calls to encode_pc_off(). So it looks like with the current setup id have to create another similar function in codec.c I add an entry for movz with blank params in codec.txt it codec.py might the generate the correct call if I follow the naming scheme.
--
---
You received this message because you are subscribed to the Google Groups "Dr. Memory Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drmemory-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drmemory-users/5781cbf0-2497-4f2f-9502-68262ac3c2ffo%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to drmemor...@googlegroups.com.
Could potentially encode a nop if a 0 is detected?
--
---
You received this message because you are subscribed to the Google Groups "Dr. Memory Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drmemory-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drmemory-users/a3722a2c-d1da-4870-b697-4341a91a37bbo%40googlegroups.com.