Repository navigation
Conversation
- Declare R8-R15 as read by the function-exit helper, too. - For DW_OP_bregN on the frame pointer, use its value at function entry. - Keep a register-located variable's value alive until visitVariable runs. - Share DW_OP_regN/DW_OP_bregN decoding via dwarf_op_reg_num. - Remove a redundant init_dwarf_regnames_by_elf_machine_code call. - Simplify the x86 register table; keep its size private. - Log when the CFA register cannot be read.
Also correct the comment on dwarf_reg_guest_offsets, which has no -1 entries.
returnArrayVariableWithAddr evaluated a formal parameter's DWARF location expression into var_loc but never used the result.
|
@coderabbitai review |
|
|
@coderabbitai review |
|
…arf-register-access # Conflicts: # valgrind/fjalar/fjalar_runtime.c
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
|
…d-location-op As this pull request's description requires: * location_op_is_supported() accepts DW_OP_reg* for a register that Fjalar can read. extractOneFormalParameterVar sets locationUnsupported for any other register location, so no heuristic makes it valid. * visitVariableGroup asserts that the registers of a valid location were saved at entrance, instead of reading address 0. * The DW_OP_stack_value and DW_OP_piece tests move from omitted-params-test.sh, which codespecs#90 deletes, to register-params-test.sh. Their functions are in stack-params.c, a separate compilation unit, because an unoptimized function in register-params.c changes the comparability of scale's parameters. Use codespecs#91's FJALAR_NUM_DWARF_REGS instead of NUM_READABLE_DWARF_REGS, which counted entries of the get_reg table that codespecs#91 deletes.
This pull request depends on #94, and it contains its commits. Please land #94 first. #94 removes an unused copy of the location evaluator that uses the
get_reganddwarf_reg_stringtables, which this pull request deletes.This pull request changes how Fjalar reads a register that DWARF names by number. It is a prerequisite of #90, from which it was split.
dwarf_reg_guest_offsets, replaces the table ofVG_(get_*)function pointers,get_reg. New functionsdwarf_reg_is_readableandread_dwarf_reguse it.dwarf_reg_name(from binutils'regname) replaces thedwarf_reg_stringtable, whose x86 version had 9 entries whereget_reghad 11.DW_OP_reg*orDW_OP_breg*location, no longer call through a null or out-of-bounds entry for a register that Fjalar cannot read (such as x86eflagsor a floating-point register). Fjalar prints a debugging message instead, and such a variable's value is nonsensical.DW_OP_reg*(not justDW_OP_breg*) is handled.DW_OP_derefassumed x86 (EBP+8). It now usesRBP+16on amd64.R8–R15on amd64, so their guest values are up to date when Fjalar reads them.At function exit, a
DW_OP_reg*location, or aDW_OP_breg*location on a register other than the stack pointer, still reads the register's current value rather than its value at entry. #90 fixes that by saving the registers at entry.The output of
make fjalar-testis unchanged.