| #
d9e416c0 |
| 18-Feb-2012 |
Greg Clayton <[email protected]> |
The second part in thread hardening the internals of LLDB where we make the lldb_private::StackFrame objects hold onto a weak pointer to the thread object. The lldb_private::StackFrame objects the th
The second part in thread hardening the internals of LLDB where we make the lldb_private::StackFrame objects hold onto a weak pointer to the thread object. The lldb_private::StackFrame objects the the most volatile objects we have as when we are doing single stepping, frames can often get lost or thrown away, only to be re-created as another object that still refers to the same frame. We have another bug tracking that. But we need to be able to have frames no longer be able to get the thread when they are not part of a thread anymore, and this is the first step (this fix makes that possible but doesn't implement it yet).
Also changed lldb_private::ExecutionContextScope to return shared pointers to all objects in the execution context to further thread harden the internals.
llvm-svn: 150871
show more ...
|
| #
cc4d0146 |
| 17-Feb-2012 |
Greg Clayton <[email protected]> |
This checking is part one of trying to add some threading safety to our internals. The first part of this is to use a new class:
lldb_private::ExecutionContextRef
This class holds onto weak pointer
This checking is part one of trying to add some threading safety to our internals. The first part of this is to use a new class:
lldb_private::ExecutionContextRef
This class holds onto weak pointers to the target, process, thread and frame and it also contains the thread ID and frame Stack ID in case the thread and frame objects go away and come back as new objects that represent the same logical thread/frame.
ExecutionContextRef objcets have accessors to access shared pointers for the target, process, thread and frame which might return NULL if the backing object is no longer available. This allows for references to persistent program state without needing to hold a shared pointer to each object and potentially keeping that object around for longer than it needs to be.
You can also "Lock" and ExecutionContextRef (which contains weak pointers) object into an ExecutionContext (which contains strong, or shared pointers) with code like
ExecutionContext exe_ctx (my_obj->GetExectionContextRef().Lock());
llvm-svn: 150801
show more ...
|
|
Revision tags: llvmorg-3.0.0, llvmorg-3.0.0-rc4, llvmorg-3.0.0-rc3 |
|
| #
dce502ed |
| 04-Nov-2011 |
Greg Clayton <[email protected]> |
Fixed the Xcode project building of LLVM to be a bit more user friendly:
- If you download and build the sources in the Xcode project, x86_64 builds by default using the "llvm.zip" checkpointed LL
Fixed the Xcode project building of LLVM to be a bit more user friendly:
- If you download and build the sources in the Xcode project, x86_64 builds by default using the "llvm.zip" checkpointed LLVM. - If you delete the "lldb/llvm.zip" and the "lldb/llvm" folder, and build the Xcode project will download the right LLVM sources and build them from scratch - If you have a "lldb/llvm" folder already that contains a "lldb/llvm/lib" directory, we will use the sources you have placed in the LLDB directory. Python can now be disabled for platforms that don't support it.
Changed the way the libllvmclang.a files get used. They now all get built into arch specific directories and never get merged into universal binaries as this was causing issues where you would have to go and delete the file if you wanted to build an extra architecture slice.
llvm-svn: 143678
show more ...
|
|
Revision tags: llvmorg-3.0.0-rc2, llvmorg-3.0.0-rc1 |
|
| #
5f4c61e2 |
| 07-Oct-2011 |
Greg Clayton <[email protected]> |
<rdar://problem/10226227>
Fixed the root cause of what was causing an assertion to fire during single stepping. We had an issue with the inlined stack frames where when we had inlined frames that we
<rdar://problem/10226227>
Fixed the root cause of what was causing an assertion to fire during single stepping. We had an issue with the inlined stack frames where when we had inlined frames that were not in the first concrete frame where we passed the wrong PC down. We needed to decrement the PC by one for these frames to make sure we are using the same address that did the symbol context lookup.
llvm-svn: 141349
show more ...
|
| #
252d0ede |
| 05-Oct-2011 |
Greg Clayton <[email protected]> |
Fixed a crasher where the m_frames collection was being accessed without using the mutex.
llvm-svn: 141160
|
| #
1ed54f50 |
| 01-Oct-2011 |
Greg Clayton <[email protected]> |
Cleaned up the the code that figures out the inlined stack frames given a symbol context that represents an inlined function. This function has been renamed internally to:
bool SymbolContext::GetPa
Cleaned up the the code that figures out the inlined stack frames given a symbol context that represents an inlined function. This function has been renamed internally to:
bool SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, SymbolContext &next_frame_sc, Address &next_frame_pc) const; And externally to:
SBSymbolContext SBSymbolContext::GetParentOfInlinedScope (const SBAddress &curr_frame_pc, SBAddress &parent_frame_addr) const;
The correct blocks are now correctly calculated.
Switched the stack backtracing engine (in StackFrameList) and the address context printing over to using the internal SymbolContext::GetParentOfInlinedScope(...) so all inlined callstacks will match exactly.
llvm-svn: 140910
show more ...
|
| #
fd54b368 |
| 20-Sep-2011 |
Jason Molenda <[email protected]> |
Update declarations for all functions/methods that accept printf-style stdarg formats to use __attribute__ format so the compiler can flag incorrect uses. Fix all incorrect uses. Most of these are
Update declarations for all functions/methods that accept printf-style stdarg formats to use __attribute__ format so the compiler can flag incorrect uses. Fix all incorrect uses. Most of these are innocuous, a few were resulting in crashes.
llvm-svn: 140185
show more ...
|
| #
b7f6b2fa |
| 08-Sep-2011 |
Jim Ingham <[email protected]> |
Move the SourceManager from the Debugger to the Target. That way it can store the per-Target default Source File & Line. Set the default Source File & line to main (if it can be found.) at startup.
Move the SourceManager from the Debugger to the Target. That way it can store the per-Target default Source File & Line. Set the default Source File & line to main (if it can be found.) at startup. Selecting the current thread & or frame resets the current source file & line, and "source list" as well as the breakpoint command "break set -l <NUM>" will use the current source file.
llvm-svn: 139323
show more ...
|
| #
2c595273 |
| 25-Aug-2011 |
Johnny Chen <[email protected]> |
Fix compilation error with DEBUG_STACK_FRAMES defined, patch by Filipe Cabecinhas! With some slight modification.
llvm-svn: 138563
|
| #
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 ...
|
| #
71c21d18 |
| 11-Apr-2011 |
Stephen Wilson <[email protected]> |
Order of initialization lists. This patch fixes all of the warnings due to unordered initialization lists.
Patch by Marco Minutoli.
llvm-svn: 129290
|
|
Revision tags: llvmorg-2.9.0 |
|
| #
3a195b7e |
| 31-Mar-2011 |
Jim Ingham <[email protected]> |
Add GetFrameWithStackID to the StackFrameList and the Thread (which routes to its StackFrameList.)
llvm-svn: 128592
|
|
Revision tags: llvmorg-2.9.0-rc3, llvmorg-2.9.0-rc2, llvmorg-2.9.0-rc1 |
|
| #
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 ...
|
|
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 |
|
| #
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 ...
|
| #
59e8fc1c |
| 30-Aug-2010 |
Greg Clayton <[email protected]> |
Clarified the intent of the SymbolContextScope class in the header documentation. Symbol now inherits from the symbol context scope so that the StackID can use a "SymbolContextScope *" instead of a b
Clarified the intent of the SymbolContextScope class in the header documentation. Symbol now inherits from the symbol context scope so that the StackID can use a "SymbolContextScope *" instead of a blockID (which could have been the same as some other blockID from another symbol file).
Modified the stacks that are created on subsequent stops to reuse the previous stack frame objects which will allow for some internal optimization using pointer comparisons during stepping.
llvm-svn: 112495
show more ...
|
| #
68275d5e |
| 27-Aug-2010 |
Greg Clayton <[email protected]> |
Made it so we update the current frames from the previous frames by doing STL swaps on the variable list, value object list, and disassembly. This avoids us having to try and update frame indexes and
Made it so we update the current frames from the previous frames by doing STL swaps on the variable list, value object list, and disassembly. This avoids us having to try and update frame indexes and other things that were getting out of sync.
llvm-svn: 112301
show more ...
|
| #
5082c5fd |
| 27-Aug-2010 |
Greg Clayton <[email protected]> |
Simplified the StackFrameList class down to a single frames list again instead of trying to maintain the real frame list (unwind frames) and an inline frame list. The information is cheap to produce
Simplified the StackFrameList class down to a single frames list again instead of trying to maintain the real frame list (unwind frames) and an inline frame list. The information is cheap to produce when we already have looked up a block and was making stack frame uniquing difficult when trying to use the previous stack when making the current stack.
We now maintain the previous value object lists for common frames between a previous and current frames so we will be able to tell when variable values change.
llvm-svn: 112277
show more ...
|
| #
2976d00a |
| 26-Aug-2010 |
Jim Ingham <[email protected]> |
Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to "Selected" i.e. GetSelectedThread. Selected makes more sense, since these are set by some user action (a selection). I didn't
Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to "Selected" i.e. GetSelectedThread. Selected makes more sense, since these are set by some user action (a selection). I didn't change "CurrentProcess" since this is always controlled by the target, and a given target can only have one process, so it really can't be selected.
llvm-svn: 112221
show more ...
|
| #
0445d8f4 |
| 26-Aug-2010 |
Greg Clayton <[email protected]> |
Cleaned up the inline stack frame code one more time to prepare for inlined code stepping. Also we now store the stack frames for the current and previous stops in the thread in std::auto_ptr objects
Cleaned up the inline stack frame code one more time to prepare for inlined code stepping. Also we now store the stack frames for the current and previous stops in the thread in std::auto_ptr objects. When we create a thread stack frame list we pass the previous frame into it so it can re-use the frames and maintain will allow for variable changes to be detected. I will implement the stack frame reuse next.
llvm-svn: 112152
show more ...
|
| #
12daf946 |
| 25-Aug-2010 |
Greg Clayton <[email protected]> |
Cleaned up the inline backtrace code even more by moving all stack backtracing functionality into StackFrameList. This will allow us to copy the previous stack backtrace from the previous stop into a
Cleaned up the inline backtrace code even more by moving all stack backtracing functionality into StackFrameList. This will allow us to copy the previous stack backtrace from the previous stop into another variable so we can re-use as much as possible from the previous stack backtrace.
llvm-svn: 112007
show more ...
|
| #
30fdc8d8 |
| 08-Jun-2010 |
Chris Lattner <[email protected]> |
Initial checkin of lldb code from internal Apple repo.
llvm-svn: 105619
|