diff options
author | Jason Molenda <jmolenda@apple.com> | 2010-09-10 07:49:16 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2010-09-10 07:49:16 +0000 |
commit | fbcb7f2c4e90b8fe8bd921f382f84299678ad800 (patch) | |
tree | d3d92c80d408e22c80898f58d276e91db81561c0 /lldb/source/Commands | |
parent | 6a6dac2fbf893d837e41813d3150be042d59c08d (diff) | |
download | bcm5719-llvm-fbcb7f2c4e90b8fe8bd921f382f84299678ad800.tar.gz bcm5719-llvm-fbcb7f2c4e90b8fe8bd921f382f84299678ad800.zip |
The first part of an lldb native stack unwinder.
The Unwind and RegisterContext subclasses still need
to be finished; none of this code is used by lldb at
this point (unless you call into it by hand).
The ObjectFile class now has an UnwindTable object.
The UnwindTable object has a series of FuncUnwinders
objects (Function Unwinders) -- one for each function
in that ObjectFile we've backtraced through during this
debug session.
The FuncUnwinders object has a few different UnwindPlans.
UnwindPlans are a generic way of describing how to find
the canonical address of a given function's stack frame
(the CFA idea from DWARF/eh_frame) and how to restore the
caller frame's register values, if they have been saved
by this function.
UnwindPlans are created from different sources. One source is the
eh_frame exception handling information generated by the compiler
for unwinding an exception throw. Another source is an assembly
language inspection class (UnwindAssemblyProfiler, uses the Plugin
architecture) which looks at the instructions in the funciton
prologue and describes the stack movements/register saves that are
done.
Two additional types of UnwindPlans that are worth noting are
the "fast" stack UnwindPlan which is useful for making a first
pass over a thread's stack, determining how many stack frames there
are and retrieving the pc and CFA values for each frame (enough
to create StackFrameIDs). Only a minimal set of registers is
recovered during a fast stack walk.
The final UnwindPlan is an architectural default unwind plan.
These are provided by the ArchDefaultUnwindPlan class (which uses
the plugin architecture). When no symbol/function address range can
be found for a given pc value -- when we have no eh_frame information
and when we don't have a start address so we can't examine the assembly
language instrucitons -- we have to make a best guess about how to
unwind. That's when we use the architectural default UnwindPlan.
On x86_64, this would be to assume that rbp is used as a stack pointer
and we can use that to find the caller's frame pointer and pc value.
It's a last-ditch best guess about how to unwind out of a frame.
There are heuristics about when to use one UnwindPlan versues the other --
this will all happen in the still-begin-written UnwindLLDB subclass of
Unwind which runs the UnwindPlans.
llvm-svn: 113581
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectRegister.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp index be7b5f19f1a..7d11a6e93db 100644 --- a/lldb/source/Commands/CommandObjectRegister.cpp +++ b/lldb/source/Commands/CommandObjectRegister.cpp @@ -106,7 +106,7 @@ public: if (reg_info) { output_stream.Printf("%-12s = ", reg_info->name); - if (reg_context->ReadRegisterBytes(reg_info->reg, reg_data)) + if (reg_context->ReadRegisterBytes(reg_info->kinds[eRegisterKindLLDB], reg_data)) { reg_data.Dump(&output_stream, 0, reg_info->format, reg_info->byte_size, 1, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0); } @@ -183,7 +183,7 @@ public: Error error(scalar.SetValueFromCString (value_str, reg_info->encoding, reg_info->byte_size)); if (error.Success()) { - if (reg_context->WriteRegisterValue(reg_info->reg, scalar)) + if (reg_context->WriteRegisterValue(reg_info->kinds[eRegisterKindLLDB], scalar)) { result.SetStatus (eReturnStatusSuccessFinishNoResult); return true; |