| #
7260f620 |
| 18-Apr-2011 |
Greg Clayton <[email protected]> |
Centralized a lot of the status information for processes, threads, and stack frame down in the lldb_private::Process, lldb_private::Thread, lldb_private::StackFrameList and the lldb_private::StackF
Centralized a lot of the status information for processes, threads, and stack frame down in the lldb_private::Process, lldb_private::Thread, lldb_private::StackFrameList and the lldb_private::StackFrame classes. We had some command line commands that had duplicate versions of the process status output ("thread list" and "process status" for example).
Removed the "file" command and placed it where it should have been: "target create". Made an alias for "file" to "target create" so we stay compatible with GDB commands.
We can now have multple usable targets in lldb at the same time. This is nice for comparing two runs of a program or debugging more than one binary at the same time. The new command is "target select <target-idx>" and also to see a list of the current targets you can use the new "target list" command. The flow in a debug session can be:
(lldb) target create /path/to/exe/a.out (lldb) breakpoint set --name main (lldb) run ... hit breakpoint (lldb) target create /bin/ls (lldb) run /tmp Process 36001 exited with status = 0 (0x00000000) (lldb) target list Current targets: target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped ) * target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited ) (lldb) target select 0 Current targets: * target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped ) target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited ) (lldb) bt * thread #1: tid = 0x2d03, 0x0000000100000b9a a.out`main + 42 at main.c:16, stop reason = breakpoint 1.1 frame #0: 0x0000000100000b9a a.out`main + 42 at main.c:16 frame #1: 0x0000000100000b64 a.out`start + 52
Above we created a target for "a.out" and ran and hit a breakpoint at "main". Then we created a new target for /bin/ls and ran it. Then we listed the targest and selected our original "a.out" program, so we showed two concurent debug sessions going on at the same time.
llvm-svn: 129695
show more ...
|
| #
78a685aa |
| 16-Apr-2011 |
Jim Ingham <[email protected]> |
Add support for "dynamic values" for C++ classes. This currently only works for "frame var" and for the expressions that are simple enough to get passed to the "frame var" underpinnings. The parser
Add support for "dynamic values" for C++ classes. This currently only works for "frame var" and for the expressions that are simple enough to get passed to the "frame var" underpinnings. The parser code will have to be changed to also query for the dynamic types & offsets as it is looking up variables.
The behavior of "frame var" is controlled in two ways. You can pass "-d {true/false} to the frame var command to get the dynamic or static value of the variables you are printing.
There's also a general setting:
target.prefer-dynamic-value (boolean) = 'true'
which is consulted if you call "frame var" without supplying a value for the -d option.
llvm-svn: 129623
show more ...
|
|
Revision tags: llvmorg-2.9.0 |
|
| #
6035b67d |
| 31-Mar-2011 |
Jim Ingham <[email protected]> |
Convert ValueObject to explicitly maintain the Execution Context in which they were created, and then use that when they update themselves. That means all the ValueObject evaluate me type functions
Convert ValueObject to explicitly maintain the Execution Context in which they were created, and then use that when they update themselves. That means all the ValueObject evaluate me type functions that used to require a Frame object now do not. I didn't remove the SBValue API's that take this now useless frame, but I added ones that don't require the frame, and marked the SBFrame taking ones as deprecated.
llvm-svn: 128593
show more ...
|
|
Revision tags: llvmorg-2.9.0-rc3 |
|
| #
1080edbc |
| 25-Mar-2011 |
Greg Clayton <[email protected]> |
Cleaned up the Disassembler code a bit more. You can now request a disassembler plugin by name on the command line for when there is more than one disassembler plugin.
Taught the Opcode class to dum
Cleaned up the Disassembler code a bit more. You can now request a disassembler plugin by name on the command line for when there is more than one disassembler plugin.
Taught the Opcode class to dump itself so that "disassembler -b" will dump the bytes correctly for each opcode type. Modified all places that were passing the opcode bytes buffer in so that the bytes could be displayed to just pass in a bool that indicates if we should dump the opcode bytes since the opcode now lives inside llvm_private::Instruction.
llvm-svn: 128290
show more ...
|
|
Revision tags: llvmorg-2.9.0-rc2 |
|
| #
37023b06 |
| 22-Mar-2011 |
Jim Ingham <[email protected]> |
Add the ability to disassemble "n" instructions from the current PC, or the first "n" instructions in a function. Also added a "-p" flag that disassembles from the current pc.
llvm-svn: 128063
|
| #
b3396b22 |
| 10-Mar-2011 |
Sean Callanan <[email protected]> |
Fixed the -r parameter to the disassemble command so that it actually triggers raw output.
llvm-svn: 127433
|
|
Revision tags: llvmorg-2.9.0-rc1 |
|
| #
514487e8 |
| 15-Feb-2011 |
Greg Clayton <[email protected]> |
Made lldb_private::ArchSpec contain much more than just an architecture. It now, in addition to cpu type/subtype and architecture flavor, contains: - byte order (big endian, little endian) - address
Made lldb_private::ArchSpec contain much more than just an architecture. It now, in addition to cpu type/subtype and architecture flavor, contains: - byte order (big endian, little endian) - address size in bytes - llvm::Triple for true target triple support and for more powerful plug-in selection.
llvm-svn: 125602
show more ...
|
| #
1a65ae11 |
| 25-Jan-2011 |
Greg Clayton <[email protected]> |
Enabled extra warnings and fixed a bunch of small issues.
llvm-svn: 124250
|
| #
6d5e68ea |
| 20-Jan-2011 |
Greg Clayton <[email protected]> |
Added the ability to StackFrame::GetValueForVariableExpressionPath(...) to avoid fragile ivars if requested. This was done by changing the previous second parameter to an options bitfield that can be
Added the ability to StackFrame::GetValueForVariableExpressionPath(...) to avoid fragile ivars if requested. This was done by changing the previous second parameter to an options bitfield that can be populated by logical OR'ing the new StackFrame::ExpressionPathOption enum values together:
typedef enum ExpressionPathOption { eExpressionPathOptionCheckPtrVsMember = (1u << 0), eExpressionPathOptionsNoFragileObjcIvar = (1u << 1), };
So the old function was: lldb::ValueObjectSP StackFrame::GetValueForVariableExpressionPath (const char *var_expr, bool check_ptr_vs_member, Error &error);
But it is now:
lldb::ValueObjectSP StackFrame::GetValueForVariableExpressionPath (const char *var_expr, uint32_t options, Error &error);
This allows the expression parser in Target::EvaluateExpression(...) to avoid using simple frame variable expression paths when evaluating something that might be a fragile ivar.
llvm-svn: 123938
show more ...
|
| #
6beaaa68 |
| 17-Jan-2011 |
Greg Clayton <[email protected]> |
A few of the issue I have been trying to track down and fix have been due to the way LLDB lazily gets complete definitions for types within the debug info. When we run across a class/struct/union def
A few of the issue I have been trying to track down and fix have been due to the way LLDB lazily gets complete definitions for types within the debug info. When we run across a class/struct/union definition in the DWARF, we will only parse the full definition if we need to. This works fine for top level types that are assigned directly to variables and arguments, but when we have a variable with a class, lets say "A" for this example, that has a member: "B *m_b". Initially we don't need to hunt down a definition for this class unless we are ever asked to do something with it ("expr m_b->getDecl()" for example). With my previous approach to lazy type completion, we would be able to take a "A *a" and get a complete type for it, but we wouldn't be able to then do an "a->m_b->getDecl()" unless we always expanded all types within a class prior to handing out the type. Expanding everything is very costly and it would be great if there were a better way.
A few months ago I worked with the llvm/clang folks to have the ExternalASTSource class be able to complete classes if there weren't completed yet:
class ExternalASTSource { ....
virtual void CompleteType (clang::TagDecl *Tag); virtual void CompleteType (clang::ObjCInterfaceDecl *Class); };
This was great, because we can now have the class that is producing the AST (SymbolFileDWARF and SymbolFileDWARFDebugMap) sign up as external AST sources and the object that creates the forward declaration types can now also complete them anywhere within the clang type system.
This patch makes a few major changes: - lldb_private::Module classes now own the AST context. Previously the TypeList objects did. - The DWARF parsers now sign up as an external AST sources so they can complete types. - All of the pure clang type system wrapper code we have in LLDB (ClangASTContext, ClangASTType, and more) can now be iterating through children of any type, and if a class/union/struct type (clang::RecordType or ObjC interface) is found that is incomplete, we can ask the AST to get the definition. - The SymbolFileDWARFDebugMap class now will create and use a single AST that all child SymbolFileDWARF classes will share (much like what happens when we have a complete linked DWARF for an executable). We will need to modify some of the ClangUserExpression code to take more advantage of this completion ability in the near future. Meanwhile we should be better off now that we can be accessing any children of variables through pointers and always be able to resolve the clang type if needed.
llvm-svn: 123613
show more ...
|
| #
5ccbd294 |
| 06-Jan-2011 |
Greg Clayton <[email protected]> |
Fixed issues with RegisterContext classes and the subclasses. There was an issue with the way the UnwindLLDB was handing out RegisterContexts: it was making shared pointers to register contexts and t
Fixed issues with RegisterContext classes and the subclasses. There was an issue with the way the UnwindLLDB was handing out RegisterContexts: it was making shared pointers to register contexts and then handing out just the pointers (which would get put into shared pointers in the thread and stack frame classes) and cause double free issues. MallocScribble helped to find these issues after I did some other cleanup. To help avoid any RegisterContext issue in the future, all code that deals with them now returns shared pointers to the register contexts so we don't end up with multiple deletions. Also now that the RegisterContext class doesn't require a stack frame, we patched a memory leak where a StackFrame object was being created and leaked.
Made the RegisterContext class not have a pointer to a StackFrame object as one register context class can be used for N inlined stack frames so there is not a 1 - 1 mapping. Updates the ExecutionContextScope part of the RegisterContext class to never return a stack frame to indicate this when it is asked to recreate the execution context. Now register contexts point to the concrete frame using a concrete frame index. Concrete frames are all of the frames that are actually formed on the stack of a thread. These concrete frames can be turned into one or more user visible frames due to inlining. Each inlined stack frame has the exact same register context (shared via shared pointers) as any parent inlined stack frames all the way up to the concrete frame itself.
So now the stack frames and the register contexts should behave much better.
llvm-svn: 122976
show more ...
|
| #
af67cecd |
| 20-Dec-2010 |
Greg Clayton <[email protected]> |
The LLDB API (lldb::SB*) is now thread safe!
llvm-svn: 122262
|
| #
54979cdd |
| 15-Dec-2010 |
Greg Clayton <[email protected]> |
Fixed the "expression" command object to use the StackFrame::GetValueForExpressionPath() function and also hooked up better error reporting for when things fail.
Fixed issues with trying to display
Fixed the "expression" command object to use the StackFrame::GetValueForExpressionPath() function and also hooked up better error reporting for when things fail.
Fixed issues with trying to display children of pointers when none are supposed to be shown (no children for function pointers, and more like this). This was causing child value objects to be made that were correctly firing an assertion.
llvm-svn: 121841
show more ...
|
| #
8b2fe6dc |
| 14-Dec-2010 |
Greg Clayton <[email protected]> |
Modified LLDB expressions to not have to JIT and run code just to see variable values or persistent expression variables. Now if an expression consists of a value that is a child of a variable, or of
Modified LLDB expressions to not have to JIT and run code just to see variable values or persistent expression variables. Now if an expression consists of a value that is a child of a variable, or of a persistent variable only, we will create a value object for it and make a ValueObjectConstResult from it to freeze the value (for program variables only, not persistent variables) and avoid running JITed code. For everything else we still parse up and JIT code and run it in the inferior.
There was also a lot of clean up in the expression code. I made the ClangExpressionVariables be stored in collections of shared pointers instead of in collections of objects. This will help stop a lot of copy constructors on these large objects and also cleans up the code considerably. The persistent clang expression variables were moved over to the Target to ensure they persist across process executions.
Added the ability for lldb_private::Target objects to evaluate expressions. We want to evaluate expressions at the target level in case we aren't running yet, or we have just completed running. We still want to be able to access the persistent expression variables between runs, and also evaluate constant expressions.
Added extra logging to the dynamic loader plug-in for MacOSX. ModuleList objects can now dump their contents with the UUID, arch and full paths being logged with appropriate prefix values.
Thread hardened the Communication class a bit by making the connection auto_ptr member into a shared pointer member and then making a local copy of the shared pointer in each method that uses it to make sure another thread can't nuke the connection object while it is being used by another thread.
Added a new file to the lldb/test/load_unload test that causes the test a.out file to link to the libd.dylib file all the time. This will allow us to test using the DYLD_LIBRARY_PATH environment variable after moving libd.dylib somewhere else.
llvm-svn: 121745
show more ...
|
| #
2d107dd0 |
| 20-Nov-2010 |
Jason Molenda <[email protected]> |
Change the DWARFExpression::Evaluate methods to take an optional RegisterContext* - normally this is retrieved from the ExecutionContext's StackFrame but when we need to evaluate an expression while
Change the DWARFExpression::Evaluate methods to take an optional RegisterContext* - normally this is retrieved from the ExecutionContext's StackFrame but when we need to evaluate an expression while creating the stack frame list this can be a little tricky.
Add DW_OP_deref_size, needed for the _sigtramp FDE expression.
Add support for processing DWARF expressions in RegisterContextLLDB.
Update callers to DWARFExpression::Evaluate.
llvm-svn: 119885
show more ...
|
| #
7c0962dc |
| 01-Nov-2010 |
Sean Callanan <[email protected]> |
Fixed StackFrame::GetVariableList to add global variables to the list of found variables if they have not yet been added.
llvm-svn: 117896
|
| #
73b472d4 |
| 27-Oct-2010 |
Greg Clayton <[email protected]> |
Updated the lldb_private::Flags class to have better method names and made all of the calls inlined in the header file for better performance.
Fixed the summary for C string types (array of chars (w
Updated the lldb_private::Flags class to have better method names and made all of the calls inlined in the header file for better performance.
Fixed the summary for C string types (array of chars (with any combo if modifiers), and pointers to chars) work in all cases.
Fixed an issue where a forward declaration to a clang type could cause itself to resolve itself more than once if, during the resolving of the type itself it caused something to try and resolve itself again. We now remove the clang type from the forward declaration map in the DWARF parser when we start to resolve it and avoid this additional call. This should stop any duplicate members from appearing and throwing all the alignment of structs, unions and classes.
llvm-svn: 117437
show more ...
|
|
Revision tags: llvmorg-2.8.0 |
|
| #
0603aa9d |
| 04-Oct-2010 |
Greg Clayton <[email protected]> |
There are now to new "settings set" variables that live in each debugger instance:
settings set frame-format <string> settings set thread-format <string>
This allows users to control the informatio
There are now to new "settings set" variables that live in each debugger instance:
settings set frame-format <string> settings set thread-format <string>
This allows users to control the information that is seen when dumping threads and frames. The default values are set such that they do what they used to do prior to changing over the the user defined formats.
This allows users with terminals that can display color to make different items different colors using the escape control codes. A few alias examples that will colorize your thread and frame prompts are:
settings set frame-format 'frame #${frame.index}: \033[0;33m${frame.pc}\033[0m{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{ \033[0;35mat \033[1;35m${line.file.basename}:${line.number}}\033[0m\n'
settings set thread-format 'thread #${thread.index}: \033[1;33mtid\033[0;33m = ${thread.id}\033[0m{, \033[0;33m${frame.pc}\033[0m}{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{, \033[1;35mstop reason\033[0;35m = ${thread.stop-reason}\033[0m}{, \033[1;36mname = \033[0;36m${thread.name}\033[0m}{, \033[1;32mqueue = \033[0;32m${thread.queue}}\033[0m\n'
A quick web search for "colorize terminal output" should allow you to see what you can do to make your output look like you want it.
The "settings set" commands above can of course be added to your ~/.lldbinit file for permanent use.
Changed the pure virtual void ExecutionContextScope::Calculate (ExecutionContext&); To: void ExecutionContextScope::CalculateExecutionContext (ExecutionContext&); I did this because this is a class that anything in the execution context heirarchy inherits from and "target->Calculate (exe_ctx)" didn't always tell you what it was really trying to do unless you look at the parameter.
llvm-svn: 115485
show more ...
|
|
Revision tags: llvmorg-2.8.0-rc3 |
|
| #
e4284b71 |
| 23-Sep-2010 |
Jim Ingham <[email protected]> |
Add GetSP to the StackFrame.
llvm-svn: 114674
|
|
Revision tags: llvmorg-2.8.0-rc2 |
|
| #
f5e56de0 |
| 14-Sep-2010 |
Greg Clayton <[email protected]> |
Moved the section load list up into the target so we can use the target to symbolicate things without the need for a valid process subclass.
llvm-svn: 113895
|
| #
016a95eb |
| 14-Sep-2010 |
Greg Clayton <[email protected]> |
Looking at some of the test suite failures in DWARF in .o files with the debug map showed that the location lists in the .o files needed some refactoring in order to work. The case that was failing
Looking at some of the test suite failures in DWARF in .o files with the debug map showed that the location lists in the .o files needed some refactoring in order to work. The case that was failing was where a function that was in the "__TEXT.__textcoal_nt" in the .o file, and in the "__TEXT.__text" section in the main executable. This made symbol lookup fail due to the way we were finding a real address in the debug map which was by finding the section that the function was in in the .o file and trying to find this in the main executable. Now the section list supports finding a linked address in a section or any child sections. After fixing this, we ran into issue that were due to DWARF and how it represents locations lists. DWARF makes a list of address ranges and expressions that go along with those address ranges. The location addresses are expressed in terms of a compile unit address + offset. This works fine as long as nothing moves around. When stuff moves around and offsets change between the remapped compile unit base address and the new function address, then we can run into trouble. To deal with this, we now store supply a location list slide amount to any location list expressions that will allow us to make the location list addresses into zero based offsets from the object that owns the location list (always a function in our case).
With these fixes we can now re-link random address ranges inside the debugger for use with our DWARF + debug map, incremental linking, and more.
Another issue that arose when doing the DWARF in the .o files was that GCC 4.2 emits a ".debug_aranges" that only mentions functions that are externally visible. This makes .debug_aranges useless to us and we now generate a real address range lookup table in the DWARF parser at the same time as we index the name tables (that are needed because .debug_pubnames is just as useless). llvm-gcc doesn't generate a .debug_aranges section, though this could be fixed, we aren't going to rely upon it.
Renamed a bunch of "UINT_MAX" to "UINT32_MAX".
llvm-svn: 113829
show more ...
|
| #
ffc1d667 |
| 13-Sep-2010 |
Greg Clayton <[email protected]> |
Fixed an assertion that happened when debugging DWARF in .o files with debug map on macosx.
llvm-svn: 113737
|
| #
95897c6a |
| 07-Sep-2010 |
Greg Clayton <[email protected]> |
Added more API to lldb::SBBlock to allow getting the block parent, sibling and first child block, and access to the inline function information.
Added an accessor the StackFrame:
Block * lldb_priv
Added more API to lldb::SBBlock to allow getting the block parent, sibling and first child block, and access to the inline function information.
Added an accessor the StackFrame:
Block * lldb_private::StackFrame::GetFrameBlock(); LLDB represents inline functions as lexical blocks that have inlined function information in them. The function above allows us to easily get the top most lexical block that defines a stack frame. When there are no inline functions in function, the block returned ends up being the top most block for the function. When the PC is in an inlined funciton for a frame, this will return the first parent block that has inlined function information. The other accessor: StackFrame::GetBlock() will return the deepest block that matches the frame's PC value. Since most debuggers want to display all variables in the current frame, the Block returned by StackFrame::GetFrameBlock can be used to retrieve all variables for the current frame.
Fixed the lldb_private::Block::DumpStopContext(...) to properly display inline frames a block should display all of its inlined functions. Prior to this fix, one of the call sites was being skipped. This is a separate code path from the current default where inlined functions get their own frames.
Fixed an issue where a block would always grab variables for any child inline function blocks.
llvm-svn: 113195
show more ...
|
|
Revision tags: llvmorg-2.8.0-rc1, llvmorg-2.8.0-rc0 |
|
| #
2cad65a5 |
| 03-Sep-2010 |
Greg Clayton <[email protected]> |
Fixed the StackFrame to correctly resolve the StackID's SymbolContextScope.
Added extra logging for stepping.
Fixed an issue where cached stack frame data could be lost between runs when the thread
Fixed the StackFrame to correctly resolve the StackID's SymbolContextScope.
Added extra logging for stepping.
Fixed an issue where cached stack frame data could be lost between runs when the thread plans read a stack frame.
llvm-svn: 112973
show more ...
|
| #
6dadd508 |
| 02-Sep-2010 |
Greg Clayton <[email protected]> |
Added a new bool parameter to many of the DumpStopContext() methods that might dump file paths that allows the dumping of full paths or just the basenames. Switched the stack frame dumping code to u
Added a new bool parameter to many of the DumpStopContext() methods that might dump file paths that allows the dumping of full paths or just the basenames. Switched the stack frame dumping code to use just the basenames for the files instead of the full path.
Modified the StackID class to no rely on needing the start PC for the current function/symbol since we can use the SymbolContextScope to uniquely identify that, unless there is no symbol context scope. In that case we can rely upon the current PC value. This saves the StackID from having to calculate the start PC when the StackFrame::GetStackID() accessor is called.
Also improved the StackID less than operator to correctly handle inlined stack frames in the same stack.
llvm-svn: 112867
show more ...
|