Please sign in to comment.
Rework how return values are handled.
- ArchitectureX86 now hands off the work for GetInstructionInfo() to DisassemblerX86, since the latter has all the information we need to properly classify and evaluate instructions. Correspondingly a CpuState is passed down to it in order to perform address calculations for the instruction if it's a jump or call instruction. The latter's targets are then stored on the thread for later retrieval when constructing a stack trace. Adjust X86_64 accordingly for the signature changes. This also fixes a bug where Step Over would sometimes result in a Step Into instead due to the previous implementation of GetInstructionInfo() occasionally failing to classify call instructions correctly. - Architecture::CreateStackTrace() now takes an argument specifying the address of the last executed function if applicable. This is used to decide who/where to decode a return value from. Adjust callers. - DwarfImageDebugInfo::_CreateReturnValue() uses the above information in order to know directly who the caller it needs to look up a return value for is, rather than trying to walk backwards to find them. Type resolution is now also a bit more sophisticated due to various cases where the subprogram entry didn't directly contain the return type but referred to another DIE that did. Retrieving return value now appears to work properly in all cases except when position independent code is involved. The latter however will require resolving the appropriate function address in the PLT, which will need some additional work.
- Loading branch information...
Showing with 197 additions and 131 deletions.
- +3 −3 src/apps/debugger/arch/Architecture.cpp
- +3 −2 src/apps/debugger/arch/Architecture.h
- +1 −0 src/apps/debugger/arch/InstructionInfo.h
- +3 −36 src/apps/debugger/arch/x86/ArchitectureX86.cpp
- +1 −1 src/apps/debugger/arch/x86/ArchitectureX86.h
- +112 −0 src/apps/debugger/arch/x86/disasm/DisassemblerX86.cpp
- +12 −0 src/apps/debugger/arch/x86/disasm/DisassemblerX86.h
- +3 −0 src/apps/debugger/arch/x86/disasm/Jamfile
- +2 −2 src/apps/debugger/arch/x86_64/ArchitectureX8664.cpp
- +1 −1 src/apps/debugger/arch/x86_64/ArchitectureX8664.h
- +11 −10 src/apps/debugger/controllers/ThreadHandler.cpp
- +2 −2 src/apps/debugger/debug_info/DebuggerImageDebugInfo.cpp
- +1 −1 src/apps/debugger/debug_info/DebuggerImageDebugInfo.h
- +35 −66 src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp
- +4 −5 src/apps/debugger/debug_info/DwarfImageDebugInfo.h
- +1 −1 src/apps/debugger/debug_info/SpecificImageDebugInfo.h
- +2 −1 src/apps/debugger/jobs/GetStackTraceJob.cpp
Oops, something went wrong.