History log of /external/lldb/source/Commands/CommandObjectFrame.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
946618a80e17d210e6592e94d10a15ad592572ba 15-May-2013 Greg Clayton <gclayton@apple.com> A first pass at auto completion for variables and their children. This is currently hooked up for "frame variable" only. With a little work we can also enable it for the "expression" command and also for other things.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
c3f5cd817ad045cab3a79f37ab5e65f8a659b7ab 26-Mar-2013 Enrico Granata <egranata@apple.com> Our commands that end up displaying a ValueObject as part of their workflow use OptionGroupValueObjectDisplay as their currency for deciding the final representation
ValueObjects themselves use DumpValueObjectOptions as the currency for the same purpose

The code to convert between these two units was replicated (to varying degrees of correctness) in several spots in the code
This checkin provides one and only one (and hopefully correct :-) entry point for this conversion



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
76695d358405d1473c088309a5dfa5cf18970a00 21-Feb-2013 Enrico Granata <egranata@apple.com> If you say
(lldb) frame variable
without first launching the inferior, you get:
error: invalid frame

this is misleading and should probably hint that there is no process. Adding this flag makes sure that we get:
error: invalid process

The difference between eFlagRequiresProcess and eFlagProcessMustBeLaunched is an open question.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
be51f8a81ecf1f50b2843b7b3ecb8cfbc54d9787 31-Jan-2013 Jim Ingham <jingham@apple.com> Add "thread return -x" to unwind the innermost user called expression (if you happen to have stopped in it due to a crash.)
Make the message when you hit an crash while evaluating an expression a little clearer, and mention "thread return -x".

rdar://problem/13110464


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
f509c5ec066599a3399fced39ea36996184939e8 29-Jan-2013 Enrico Granata <egranata@apple.com> <rdar://problem/12978143>

Data formatters now cache themselves.
This commit provides a new formatter cache mechanism. Upon resolving a formatter (summary or synthetic), LLDB remembers the resolution for later faster retrieval.
Also moved the data formatters subsystem from the core to its own group and folder for easier management, and done some code reorganization.
The ObjC runtime v1 now returns a class name if asked for the dynamic type of an object. This is required for formatters caching to work with the v1 runtime.
Lastly, this commit disposes of the old hack where ValueObjects had to remember whether they were queried for formatters with their static or dynamic type.
Now the ValueObjectDynamicValue class works well enough that we can use its dynamic value setting for the same purpose.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173728 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
36da2aa6dc5ad9994b638ed09eb81c44cc05540b 25-Jan-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13069948>

Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary.

So I defined a new "lldb::offset_t" which should be used for all file offsets.

After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed.

Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
ea0bb4d45c14447a2fe9be9f4bd8e79a84513537 09-Jan-2013 Greg Clayton <gclayton@apple.com> Expanded the flags that can be set for a command object in lldb_private::CommandObject. This list of available flags are:

enum
{
//----------------------------------------------------------------------
// eFlagRequiresTarget
//
// Ensures a valid target is contained in m_exe_ctx prior to executing
// the command. If a target doesn't exist or is invalid, the command
// will fail and CommandObject::GetInvalidTargetDescription() will be
// returned as the error. CommandObject subclasses can override the
// virtual function for GetInvalidTargetDescription() to provide custom
// strings when needed.
//----------------------------------------------------------------------
eFlagRequiresTarget = (1u << 0),
//----------------------------------------------------------------------
// eFlagRequiresProcess
//
// Ensures a valid process is contained in m_exe_ctx prior to executing
// the command. If a process doesn't exist or is invalid, the command
// will fail and CommandObject::GetInvalidProcessDescription() will be
// returned as the error. CommandObject subclasses can override the
// virtual function for GetInvalidProcessDescription() to provide custom
// strings when needed.
//----------------------------------------------------------------------
eFlagRequiresProcess = (1u << 1),
//----------------------------------------------------------------------
// eFlagRequiresThread
//
// Ensures a valid thread is contained in m_exe_ctx prior to executing
// the command. If a thread doesn't exist or is invalid, the command
// will fail and CommandObject::GetInvalidThreadDescription() will be
// returned as the error. CommandObject subclasses can override the
// virtual function for GetInvalidThreadDescription() to provide custom
// strings when needed.
//----------------------------------------------------------------------
eFlagRequiresThread = (1u << 2),
//----------------------------------------------------------------------
// eFlagRequiresFrame
//
// Ensures a valid frame is contained in m_exe_ctx prior to executing
// the command. If a frame doesn't exist or is invalid, the command
// will fail and CommandObject::GetInvalidFrameDescription() will be
// returned as the error. CommandObject subclasses can override the
// virtual function for GetInvalidFrameDescription() to provide custom
// strings when needed.
//----------------------------------------------------------------------
eFlagRequiresFrame = (1u << 3),
//----------------------------------------------------------------------
// eFlagRequiresRegContext
//
// Ensures a valid register context (from the selected frame if there
// is a frame in m_exe_ctx, or from the selected thread from m_exe_ctx)
// is availble from m_exe_ctx prior to executing the command. If a
// target doesn't exist or is invalid, the command will fail and
// CommandObject::GetInvalidRegContextDescription() will be returned as
// the error. CommandObject subclasses can override the virtual function
// for GetInvalidRegContextDescription() to provide custom strings when
// needed.
//----------------------------------------------------------------------
eFlagRequiresRegContext = (1u << 4),
//----------------------------------------------------------------------
// eFlagTryTargetAPILock
//
// Attempts to acquire the target lock if a target is selected in the
// command interpreter. If the command object fails to acquire the API
// lock, the command will fail with an appropriate error message.
//----------------------------------------------------------------------
eFlagTryTargetAPILock = (1u << 5),
//----------------------------------------------------------------------
// eFlagProcessMustBeLaunched
//
// Verifies that there is a launched process in m_exe_ctx, if there
// isn't, the command will fail with an appropriate error message.
//----------------------------------------------------------------------
eFlagProcessMustBeLaunched = (1u << 6),
//----------------------------------------------------------------------
// eFlagProcessMustBePaused
//
// Verifies that there is a paused process in m_exe_ctx, if there
// isn't, the command will fail with an appropriate error message.
//----------------------------------------------------------------------
eFlagProcessMustBePaused = (1u << 7)
};

Now each command object contains a "ExecutionContext m_exe_ctx;" member variable that gets initialized prior to running the command. The validity of the target objects in m_exe_ctx are checked to ensure that any target/process/thread/frame/reg context that are required are valid prior to executing the command. Each command object also contains a Mutex::Locker m_api_locker which gets used if eFlagTryTargetAPILock is set. This centralizes a lot of checking code that was previously and inconsistently implemented across many commands.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@171990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
d891f9b872103235cfd2ed452c6f14a4394d9b3a 05-Dec-2012 Daniel Malea <daniel.malea@intel.com> Fix Linux build warnings due to redefinition of macros:
- add new header lldb-python.h to be included before other system headers
- short term fix (eventually python dependencies must be cleaned up)

Patch by Matt Kopec!




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
6475c42148a8ea1ca86e5db465db7eca742d897d 04-Dec-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12798131>

Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite.

This fix does the following:
- make sure all short options are treated as "int"
- make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired
- fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates
- fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
94a5d0de4433dce556db59758f3d6124eb0e1a2a 10-Oct-2012 Jim Ingham <jingham@apple.com> Change the Thread constructor over to take a Process& rather than a ProcessSP. We can't create Threads with a NULL ProcessSP, so it makes no sense to use the SP.
Then make the Thread a Broadcaster, and get it to broadcast when the selected frame is changed (but only from the Command Line) and when Thread::ReturnFromFrame
changes the stack.
Made the Driver use this notification to print the new thread status rather than doing it in the command.
Fixed a few places where people were setting their broadcaster class by hand rather than using the static broadcaster class call.

<rdar://problem/12383087>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
560c51483461697b2f78c145d70d0cd285012c4d 11-Sep-2012 Filipe Cabecinhas <me@filcab.net> Change the NULL to a 0 since we need a uint32_t

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@163625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
879de484c7ef1d0971ac6c007b319b8285723e69 10-Aug-2012 Enrico Granata <egranata@apple.com> <rdar://problem/11578397> Adding a new --summary-string option for the frame variable command which allows the user to provide a summary string with which he wants to display the variables without having to make a named summary first

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
b3a1a2bba41281ba56a99fe64887a8a04760784c 14-Jul-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11870357>

Allow "frame variable" to find ivars without the need for "this->" or "self->".


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
a7d3dc75ec4f46033c3f991f11fb58a058091a85 11-Jul-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11852100>

The "stop-line-count-after" and "stop-line-count-before" settings are broken. This fixes them.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
da26bd203cbb104291b39891febf7481794f205f 08-Jun-2012 Jim Ingham <jingham@apple.com> Make raw & parsed commands subclasses of CommandObject rather than having the raw version implement an
Execute which was never going to get run and another ExecuteRawCommandString. Took the knowledge of how
to prepare raw & parsed commands out of CommandInterpreter and put it in CommandObject where it belongs.

Also took all the cases where there were the subcommands of Multiword commands declared in the .h file for
the overall command and moved them into the .cpp file.

Made the CommandObject flags work for raw as well as parsed commands.

Made "expr" use the flags so that it requires you to be paused to run "expr".



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@158235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
cf09f885c201becf51acc4a5cfac00b3df53f2a8 19-Mar-2012 Enrico Granata <egranata@apple.com> Massive enumeration name changes: a number of enums in ValueObject were not following the naming pattern
Changes to synthetic children:
- the update(self): function can now (optionally) return a value - if it returns boolean value True, ValueObjectSyntheticFilter will not clear its caches across stop-points
this should allow better performance for Python-based synthetic children when one can be sure that the child ValueObjects have not changed
- making a difference between a synthetic VO and a VO with a synthetic value: now a ValueObjectSyntheticFilter will not return itself as its own synthetic value, but will (correctly)
claim to itself be synthetic
- cleared up the internal synthetic children architecture to make a more consistent use of pointers and references instead of shared pointers when possible
- major cleanup of unnecessary #include, data and functions in ValueObjectSyntheticFilter itself
- removed the SyntheticValueType enum and replaced it with a plain boolean (to which it was equivalent in the first place)
Some clean ups to the summary generation code
Centralized the code that clears out user-visible strings and data in ValueObject
More efficient summaries for libc++ containers


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
3069c62fc7d3c0b857cd1e9269ff22011ed418fb 01-Mar-2012 Enrico Granata <egranata@apple.com> 1) solving a bug where, after Jim's fixes to stack frames, synthetic children were not recalculated when necessary, causing them to get out of sync with live data
2) providing an updated list of tagged pointers values for the objc_runtime module - hopefully this one is final
3) changing ValueObject::DumpValueObject to use an Options class instead of providing a bulky list of parameters to pass around
this change had been laid out previously, but some clients of DumpValueObject() were still using the old prototype and some arguments
were treated in a special way and passed in directly instead of through the Options class
4) providing new GetSummaryAsCString() and GetValueAsCString() calls in ValueObject that are passed a formatter object and a destination string
and fill the string by formatting themselves using the formatter argument instead of the default for the current ValueObject
5) removing the option to have formats and summaries stick to a variable for the current stoppoint
after some debate, we are going with non-sticky: if you say frame variable --format hex foo, the hex format will only be applied to the current command execution and not stick when redisplaying foo
the other option would be full stickiness, which means that foo would be formatted as hex for its whole lifetime
we are open to suggestions on what feels "natural" in this regard


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
bf97d74c0c3e9a0f7c89fe0cd4a059015ec482d5 29-Feb-2012 Jim Ingham <jingham@apple.com> Make the StackFrameList::GetFrameAtIndex only fetch as many stack frames as needed to
get the frame requested.
<rdar://problem/10943135>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
289afcb5e26c2527a0d2e71f84e780b86bbcf90a 18-Feb-2012 Greg Clayton <gclayton@apple.com> 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.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
16376ed044df3ee70fcf69e19f06af01e71a8e9a 15-Feb-2012 Enrico Granata <granata.enrico@gmail.com> <rdar://problem/10062621>
New public API for handling formatters: creating, deleting, modifying categories, and formatters, and managing type/formatter association.
This provides SB classes for each of the main object types involved in providing formatter support:
SBTypeCategory
SBTypeFilter
SBTypeFormat
SBTypeSummary
SBTypeSynthetic
plus, an SBTypeNameSpecifier class that is used on the public API layer to abstract the notion that formatters can be applied to plain type-names as well as to regular expressions
For naming consistency, this patch also renames a lot of formatters-related classes.
Plus, the changes in how flags are handled that started with summaries is now extended to other classes as well. A new enum (lldb::eTypeOption) is meant to support this on the public side.
The patch also adds several new calls to the formatter infrastructure that are used to implement by-index accessing and several other design changes required to accommodate the new API layer.
An architectural change is introduced in that backing objects for formatters now become writable. On the public API layer, CoW is implemented to prevent unwanted propagation of changes.
Lastly, there are some modifications in how the "default" category is constructed and managed in relation to other categories.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
2b05e2937e4ff82951a0e3b288acd15d2e278ff3 14-Feb-2012 Johnny Chen <johnny.chen@apple.com> Remove the functionality of using 'frame variable -w' to set a watchpoint now that 'watchpoint set variable/expression'
is working. Also update the relevant test cases.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
42404d284b22750851b26ae9a4ab42101f673089 08-Feb-2012 Johnny Chen <johnny.chen@apple.com> After discussions with Jim and Greg, modify the 'watchpoint set' command to become a mutiword command
with subcommand 'expression' and 'variable'. The first subcommand is for supplying an expression to
be evaluated into an address to watch for, while the second is for watching a variable.

'watchpoint set expression' is a raw command, which means that you need to use the "--" option terminator
to end the '-w' or '-x' option processing and to start typing your expression.

Also update several test cases to comply and add a couple of test cases into TestCompletion.py,
in particular, test that 'watchpoint set ex' completes to 'watchpoint set expression ' and that
'watchpoint set var' completes to 'watchpoint set variable '.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150109 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
f86c60f3ab976c12c37271f8d52d342073cc35a7 08-Feb-2012 Johnny Chen <johnny.chen@apple.com> Clarify the 'frame variable' help message regarding the watchpoint functionality.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
cb1a0d935c5b7b1dc465bbe544227a948531c175 06-Feb-2012 Johnny Chen <johnny.chen@apple.com> Add help string for 'frame variable' to link to 'watchpoint set' which allows for using an expression to specify the address to watch for.

rdar://problem/10703290


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
ccf4450f17759b2e6f15eb12134f88a0128dfde7 26-Jan-2012 Greg Clayton <gclayton@apple.com> Fixed formats being able to be applied recursively when using:
target variable -f <format> [args]
frame variable -f <format> [args]
expression -f <format> -- expr



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
24a6bd9835ed1655984397b0cdf35127e47681e9 27-Oct-2011 Greg Clayton <gclayton@apple.com> Added support for the new ".apple_objc" accelerator tables. These tables are
in the same hashed format as the ".apple_names", but they map objective C
class names to all of the methods and class functions. We need to do this
because in the DWARF the methods for Objective C are never contained in the
class definition, they are scattered about at the translation unit level and
they don't even have attributes that say the are contained within the class
itself.

Added 3 new formats which can be used to display data:

eFormatAddressInfo
eFormatHexFloat
eFormatInstruction

eFormatAddressInfo describes an address such as function+offset and file+line,
or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants).
The format character for this is "A", the long format is "address".

eFormatHexFloat will print out the hex float format that compilers tend to use.
The format character for this is "X", the long format is "hex float".

eFormatInstruction will print out disassembly with bytes and it will use the
current target's architecture. The format character for this is "i" (which
used to be being used for the integer format, but the integer format also has
"d", so we gave the "i" format to disassembly), the long format is
"instruction".

Mate the lldb::FormatterChoiceCriterion enumeration private as it should have
been from the start. It is very specialized and doesn't belong in the public
API.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
9c236733d43e6250c8a5671a438f4a2afeb9c0b2 26-Oct-2011 Greg Clayton <gclayton@apple.com> Cleaned up many error codes. For any who is filling in error strings into
lldb_private::Error objects the rules are:
- short strings that don't start with a capitol letter unless the name is a
class or anything else that is always capitolized
- no trailing newline character
- should be one line if possible

Implemented a first pass at adding "--gdb-format" support to anything that
accepts format with optional size/count.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
a42880a8e464a3e4f93951ae797313e5e38cdcd3 25-Oct-2011 Greg Clayton <gclayton@apple.com> Updated all commands that use a "--format" / "-f" options to use the new
OptionGroupFormat. Updated OptionGroupFormat to be able to also use the
"--size" and "--count" options. Commands that use a OptionGroupFormat instance
can choose which of the options they want by initializing OptionGroupFormat
accordingly. Clients can either get only the "--format", "--format" + "--size",
or "--format" + "--size" + "--count". This is in preparation for upcoming
chnages where there are alternate ways (GDB format specification) to set a
format.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
ecd4feb5111432d2878e95461220c720cb2d24c8 14-Oct-2011 Johnny Chen <johnny.chen@apple.com> SBValue::Watch() and SBValue::WatchPointee() are now the official API for creating
a watchpoint for either the variable encapsulated by SBValue (Watch) or the pointee
encapsulated by SBValue (WatchPointee).

Removed SBFrame::WatchValue() and SBFrame::WatchLocation() API as a result of that.

Modified the watchpoint related test suite to reflect the change.

Plus replacing WatchpointLocation with Watchpoint throughout the code base.

There are still cleanups to be dome. This patch passes the whole test suite.
Check it in so that we aggressively catch regressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
7685ccc99dd2f85aa596f92d9ccd8999b30b2e9f 01-Oct-2011 Jason Molenda <jmolenda@apple.com> Small fix to "frame select" sans frame # feature added yesterday.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
1b4525213621b2179f0841edd54842eebecd28cd 30-Sep-2011 Johnny Chen <johnny.chen@apple.com> Add an accompanying option to the 'frame variable -w' command to, instead of watching the variable,
watch the location pointed to by the variable. An example,

(lldb) frame variable -w write -x 1 -g g_char_ptr
(char *) g_char_ptr = 0x0000000100100860 ""...
Watchpoint created: WatchpointLocation 1: addr = 0x100100860 size = 1 state = enabled type = w
declare @ '/Volumes/data/lldb/svn/trunk/test/functionalities/watchpoint/hello_watchlocation/main.cpp:21'

...

(lldb) c
Process 3936 resuming

...

rocess 3936 stopped
* thread #2: tid = 0x3403, 0x00000001000009b7 a.out`do_bad_thing_with_location(char*, char) + 23 at main.cpp:27, stop reason = watchpoint 1
frame #0: 0x00000001000009b7 a.out`do_bad_thing_with_location(char*, char) + 23 at main.cpp:27
24 do_bad_thing_with_location(char *char_ptr, char new_val)
25 {
26 *char_ptr = new_val;
-> 27 }
28
29 uint32_t access_pool (uint32_t flag = 0);
30
(lldb)

Also add TestWatchLocation.py test to exercise this functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
811ded5b244c20a9f39a04aba1a11ce02aa45f5e 30-Sep-2011 Jason Molenda <jmolenda@apple.com> Add an additional "frame select" usage where it will re-select the current frame
if no frame is specified. This is useful to get the source context lines re-displayed
when you need a reminder of where you are in the source currently.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
3a63fffe33027ccff9ee14aaa40e3b439b33b462 28-Sep-2011 Johnny Chen <johnny.chen@apple.com> Fix help string for "frame variable".


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
096c293f8d4171448908801d5a1a74b152af1430 27-Sep-2011 Johnny Chen <johnny.chen@apple.com> Add SB API class SBWatchpointLocation and some extra methods to the SBTarget class to
iterate on the available watchpoint locations and to perform watchpoint manipulations.

I still need to export the SBWatchpointLocation class as well as the added watchpoint
manipulation methods to the Python interface. And write test cases for them.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
567e7f3ba16eb48cb9fd6a2f26f2f7269eb6983c 22-Sep-2011 Greg Clayton <gclayton@apple.com> Converted the lldb_private::Process over to use the intrusive
shared pointers.

Changed the ExecutionContext over to use shared pointers for
the target, process, thread and frame since these objects can
easily go away at any time and any object that was holding onto
an ExecutionContext was running the risk of using a bad object.

Now that the shared pointers for target, process, thread and
frame are just a single pointer (they all use the instrusive
shared pointers) the execution context is much safer and still
the same size.

Made the shared pointers in the the ExecutionContext class protected
and made accessors for all of the various ways to get at the pointers,
references, and shared pointers.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
26ec874be668e2c945d9eef9f50fd36f5a4d01a2 16-Sep-2011 Johnny Chen <johnny.chen@apple.com> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
f9f3302fb05aa8ffdb1e676b6b2abb0435900bac 16-Sep-2011 Johnny Chen <johnny.chen@apple.com> Add comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
10b12b3aa8542721fa9485c1d520433de0e0e720 16-Sep-2011 Johnny Chen <johnny.chen@apple.com> Add a declaraion info member field to the WatchpointLocation class.
Modify CommandObjectFrame.cpp to populate this field when creating a watchpoint location.
Update the test case to verify that the declaration info matches the file and line number.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
61286a55344e906e78b2f3819221f41995a2f743 13-Sep-2011 Johnny Chen <johnny.chen@apple.com> Get the address and the size of the variable for passing to the Target::CreateWatchpointLocation() method.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
649d3f1daa5af2a3b420b3d83b8a26b68ce21228 13-Sep-2011 Johnny Chen <johnny.chen@apple.com> Remove an unnecessary 'else { ... }', which adds to vertical as well as horizontal spans,
from CommandObjectFrame::Execute().


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
34bbf85e60949752de9c8272a70d59383e523cc5 13-Sep-2011 Johnny Chen <johnny.chen@apple.com> Watchpoint WIP:

o Rename from OptionGroupWatchpoint::WatchMode to OptionGroupWatchpoint::WatchType,
and CommandArgumentType::eArgTypeWatchMode to CommandArgumentType::eArgTypeWatchType.
Update the sources to reflect the change.

o Add a CreateWatchpointLocation() method to Target class, which is currently not implmeneted
(returns an empty WatchpointLocationSP object). Add logic to CommandObjectFrame::Execute()
to exercise the added API for creating a watchpoint location.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139560 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
ca3e91a8526ae3b8969f47832712214437d25b74 12-Sep-2011 Johnny Chen <johnny.chen@apple.com> Fix indentations, add some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
3066b250c109ee52ffa24411793ad1ecfa8ee9ab 12-Sep-2011 Johnny Chen <johnny.chen@apple.com> Fix a bug in OptionGroupWatchpoint.cpp where the '-w' option arg parsing result was not checked
to effect an early error return.

Plus add logic to 'frame variable' command object to check that when watchpoint option is on,
only one variable with exact name (no regex) is specified as the sole command arg.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
3b23d2097b526c6326b7b7c56d5fc84884d4e08b 10-Sep-2011 Enrico Granata <granata.enrico@gmail.com> Renaming a bulk of method calls from Get() to something more descriptive

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
58dba3ce82715249c068abb7bf99f0d43dfbe8f9 10-Sep-2011 Johnny Chen <johnny.chen@apple.com> Add OptionGroupWatchpoint.cpp/.h (preparatory work) for hooking up watchpoint to the 'frame variable' comand.
To watch a variable for read/write, issue:

frame variable -w read_write

Note that '-w' option is not working yet. :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
677aabdaa5ac011769e5c88a99f1b6e4ec6a6fc6 09-Sep-2011 Johnny Chen <johnny.chen@apple.com> Remove code rot (unused class OptionGroupFrameVariable) from CommandObjectFrameVariable.
Plus minor indentation change.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
d9fa9d7c77adecaa22ae5dc8624a96afc6cf9edb 08-Sep-2011 Jim Ingham <jingham@apple.com> "frame select -r" should return an error if you are already at the top of the stack & try to go up or at the bottom and try to go down.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
994aba0f2ea5ce37eb166e5a3c206903555c8dc7 27-Aug-2011 Jim Ingham <jingham@apple.com> Hold onto a shared pointer to the frame CommandObjectFrameVariable::Execute is
analyzing so it won't get deleted on us if a formatter runs code.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
0be2e9be82cb20dbf03dac41dd48e376e8fee4cb 23-Aug-2011 Enrico Granata <granata.enrico@gmail.com> More cleanups ; Separated implementation of FormatManager from class DataVisualization as a front-end by using separate .h/.cpp files - Final aim is to break up FormatManager.h/cpp into several separate files

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
f501c5913d5daaf45a906477bdf466bb74ed10fb 18-Aug-2011 Enrico Granata <granata.enrico@gmail.com> First round of code cleanups:
- all instances of "vobj" have been renamed to "valobj"
- class Debugger::Formatting has been renamed to DataVisualization (defined in FormatManager.h/cpp)
The interface to this class has not changed
- FormatCategory now uses ConstString's as keys to the navigators instead of repeatedly casting
from ConstString to const char* and back all the time
Next step is making the same happen for categories themselves
- category gnu-libstdc++ is defined in the constructor for a FormatManager
The source code for it is defined in gnu_libstdcpp.py, drawn from examples/synthetic at compile time
All references to previous 'osxcpp' name have been removed from both code and file names
Functional changes:
- the name of the option to use a summary string for 'type summary add' has changed from the previous --format-string
to the new --summary-string. It is expected that the short option will change from -f to -s, and -s for --python-script
will become -o


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
19030d8e5545e0edbd59d8e44a16a11728089afa 15-Aug-2011 Enrico Granata <granata.enrico@gmail.com> Refactoring of ValueObject::DumpValueObject and 'frame variable', 'target variable' commands to use an Options object instead of passing an ever-increasing number of arguments to the DumpValueObject() method, with the ultimate aim of making that call private implementation

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
db64d95b32062acbf961019aa6c1025237d3145c 12-Aug-2011 Enrico Granata <granata.enrico@gmail.com> Giving a warning to the user the first time children are truncated by the new cap setting

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
018921dd162d818e71cf1ac86d03422e88f0a674 12-Aug-2011 Enrico Granata <granata.enrico@gmail.com> *Some more optimizations in usage of ConstString
*New setting target.max-children-count gives an upper-bound to the number of child objects that will be displayed at each depth-level
This might be a breaking change in some scenarios. To override the new limit you can use the --show-all-children (-A) option
to frame variable or increase the limit in your lldbinit file
*Command "type synthetic" has been split in two:
- "type synthetic" now only handles Python synthetic children providers
- the new command "type filter" handles filters
Because filters and synthetic providers are both ways to replace the children of a ValueObject, only one can be effective at any given time.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137416 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
79d9136fbc3fa9d8a50f3b5f8d70b2be8b42f9be 10-Aug-2011 Jason Molenda <jmolenda@apple.com> Remove extra newline from end of 'frame info' command output.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
840eb267769b943926bb9fcb527ab91221cf7a07 10-Aug-2011 Enrico Granata <granata.enrico@gmail.com> CFString.py now shows contents in a more NSString-like way (e.g. you get @"Hello" instead of "Hello")
new --raw-output (-R) option to frame variable prevents using summaries and synthetic children
other future formatting enhancements will be excluded by using the -R option
test case enhanced to check that -R works correctly


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
e4e3e2c0448bb0c77f8f8a3bbb47b951a481d3d8 22-Jul-2011 Enrico Granata <granata.enrico@gmail.com> when typing a summary string you can use the %S symbol to explicitly indicate that you want the summary to be used to print the target object
(e.g. ${var%S}). this might already be the default if your variable is of an aggregate type
new feature: synthetic filters. you can restrict the number of children for your variables to only a meaningful subset
- the restricted list of children obeys the typical rules (e.g. summaries prevail over children)
- one-line summaries show only the filtered (synthetic) children, if you type an expanded summary string, or you use Python scripts, all the real children are accessible
- to provide a synthetic children list use the "type synth add" command, as in:
type synth add foo_type --child varA --child varB[0] --child varC->packet->flags[1-4]
(you can use ., ->, single-item array operator [N] and bitfield operator [N-M]; array slice access is not supported, giving simplified names to expression paths is not supported)
- a new -S option to frame variable and target variable lets you override synthetic children and instead show real ones

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
8a717e596312951672ecd8c54df2d255e6da20ba 19-Jul-2011 Enrico Granata <granata.enrico@gmail.com> Fixed a bug where deleting a regex summary would not immediately reflect in the variables display
The "systemwide summaries" feature has been removed and replaced with a more general and
powerful mechanism.
Categories:
- summaries can now be grouped into buckets, called "categories" (it is expected that categories
correspond to libraries and/or runtime environments)
- to add a summary to a category, you can use the -w option to type summary add and give
a category name (e.g. type summary add -f "foo" foo_t -w foo_category)
- categories are by default disabled, which means LLDB will not look into them for summaries,
to enable a category use "type category enable". once a category is enabled, LLDB will
look into that category for summaries. the rules are quite trivial: every enabled category
is searched for an exact match. if an exact match is nowhere to be found, any match is
searched for in every enabled category (whether it involves cascading, going to base classes,
...). categories are searched into the order in which they were enabled (the most recently
enabled category first, then the second most and so on..)
- by default, most commands that deal with summaries, use a category named "default" if no
explicit -w parameter is given (the observable behavior of LLDB should not change when
categories are not explicitly used)
- the systemwide summaries are now part of a "system" category

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
7f163b363aeccffeec8eda23bd31e4965abc7226 16-Jul-2011 Enrico Granata <granata.enrico@gmail.com> Some descriptive text for the Python script feature:
- help type summary add now gives some hints on how to use it
frame variable and target variable now have a --no-summary-depth (-Y) option:
- simply using -Y without an argument will skip one level of summaries, i.e.
your aggregate types will expand their children and display no summary, even
if they have one. children will behave normally
- using -Y<int>, as in -Y4, -Y7, ..., will skip as many levels of summaries as
given by the <int> parameter (obviously, -Y and -Y1 are the same thing). children
beneath the given depth level will behave normally
-Y0 is the same as omitting the --no-summary-depth parameter entirely
This option replaces the defined-but-unimplemented --no-summary

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
1a102087f54079c25c8827afac6153a44ca535da 12-Jul-2011 Enrico Granata <granata.enrico@gmail.com> named summaries:
- a new --name option for "type summary add" lets you give a name to a summary
- a new --summary option for "frame variable" lets you bind a named summary to one or more variables
${var%s} now works for printing the value of 0-terminated CStrings
type format test case now tests for cascading
- this is disabled on GCC because GCC may end up stripping typedef chains, basically breaking cascading
new design for the FormatNavigator class
new template class CleanUp2 meant to support cleanup routines with 1 additional parameter beyond resource handle

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
fb81642e03567a3413d94cdb632b6005a0ad4273 10-Jul-2011 Greg Clayton <gclayton@apple.com> Allow the built in ValueObject summary providers for C strings
use lldb_private::Target::ReadMemory(...) to allow constant strings
to be displayed in global variables prior on in between process
execution.

Centralized the variable declaration dumping into:

bool
Variable::DumpDeclaration (Stream *s, bool show_fullpaths, bool show_module);

Fixed an issue if you used "target variable --regex <regex>" where the
variable name would not be displayed, but the regular expression would.

Fixed an issue when viewing global variables through "target variable"
might not display correctly when doing DWARF in object files.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
368f8226b1f75fbb4758748fafcee70f18fc248e 07-Jul-2011 Greg Clayton <gclayton@apple.com> Centralize the variable display prefs into a new option
group class: OptionGroupVariable. It gets initialized with
a boolean that indicates if the frame specific options are
included so that this can be used in both the "frame variable"
and "target variable" commands.

Removed the global functionality from the "frame variable"
command. Users should switch to using the "target variable"
command.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
10de7d1db3ec782ea2ccda1f39c0a40b9c301594 04-May-2011 Jim Ingham <jingham@apple.com> Change "frame var" over to using OptionGroups (and thus the OptionGroupVariableObjectDisplay).
Change the boolean "use_dynamic" over to a tri-state, no-dynamic, dynamic-w/o running target,
and dynamic with running target.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
56bbdaf817cb19a2f133e8501473f499be447c2d 28-Apr-2011 Greg Clayton <gclayton@apple.com> Added the ability to specify dumping options (show types, show location,
depth control, pointer depth, and more) when dumping memory and viewing as
a type.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
47da810225d8674eb9158bcf5f1f5b847cbaeedf 23-Apr-2011 Jim Ingham <jingham@apple.com> Fix up how the ValueObjects manage their life cycle so that you can hand out a shared
pointer to a ValueObject or any of its dependent ValueObjects, and the whole cluster will
stay around as long as that shared pointer stays around.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
abe0fed36d83e1c37af9dae90c2d25db742b4515 18-Apr-2011 Greg Clayton <gclayton@apple.com> 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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
e41494a9092e15192012a5e0a8a1ffd66c70b8bb 16-Apr-2011 Jim Ingham <jingham@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
143fcc3a15425659b381502ed4e1e50a3e726f36 13-Apr-2011 Greg Clayton <gclayton@apple.com> Added two new classes for command options:

lldb_private::OptionGroup
lldb_private::OptionGroupOptions

OptionGroup lets you define a class that encapsulates settings that you want
to reuse in multiple commands. It contains only the option definitions and the
ability to set the option values, but it doesn't directly interface with the
lldb_private::Options class that is the front end to all of the CommandObject
option parsing. For that the OptionGroupOptions class can be used. It aggregates
one or more OptionGroup objects and directs the option setting to the
appropriate OptionGroup class. For an example of this, take a look at the
CommandObjectFile and how it uses its "m_option_group" object shown below
to be able to set values in both the FileOptionGroup and PlatformOptionGroup
classes. The members used in CommandObjectFile are:

OptionGroupOptions m_option_group;
FileOptionGroup m_file_options;
PlatformOptionGroup m_platform_options;

Then in the constructor for CommandObjectFile you can combine the option
settings. The code below shows a simplified version of the constructor:

CommandObjectFile::CommandObjectFile(CommandInterpreter &interpreter) :
CommandObject (...),
m_option_group (interpreter),
m_file_options (),
m_platform_options(true)
{
m_option_group.Append (&m_file_options);
m_option_group.Append (&m_platform_options);
m_option_group.Finalize();
}

We append the m_file_options and then the m_platform_options and then tell
the option group the finalize the results. This allows the m_option_group to
become the organizer of our prefs and after option parsing we end up with
valid preference settings in both the m_file_options and m_platform_options
objects. This also allows any other commands to use the FileOptionGroup and
PlatformOptionGroup classes to implement options for their commands.

Renamed:
virtual void Options::ResetOptionValues();
to:
virtual void Options::OptionParsingStarting();

And implemented a new callback named:

virtual Error Options::OptionParsingFinished();

This allows Options subclasses to verify that the options all go together
after all of the options have been specified and gives the chance for the
command object to return an error. It also gives a chance to take all of the
option values and produce or initialize objects after all options have
completed parsing.

Modfied:

virtual Error
SetOptionValue (int option_idx, const char *option_arg) = 0;

to be:

virtual Error
SetOptionValue (uint32_t option_idx, const char *option_arg) = 0;

(option_idx is now unsigned).




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
b72d0f098e45936fa72e26b1a026c603e17e2d6c 12-Apr-2011 Greg Clayton <gclayton@apple.com> Moved the execution context that was in the Debugger into
the CommandInterpreter where it was always being used.

Make sure that Modules can track their object file offsets correctly to
allow opening of sub object files (like the "__commpage" on darwin).

Modified the Platforms to be able to launch processes. The first part of this
move is the platform soon will become the entity that launches your program
and when it does, it uses a new ProcessLaunchInfo class which encapsulates
all process launching settings. This simplifies the internal APIs needed for
launching. I want to slowly phase out process launching from the process
classes, so for now we can still launch just as we used to, but eventually
the platform is the object that should do the launching.

Modified the Host::LaunchProcess in the MacOSX Host.mm to correctly be able
to launch processes with all of the new eLaunchFlag settings. Modified any
code that was manually launching processes to use the Host::LaunchProcess
functions.

Fixed an issue where lldb_private::Args had implicitly defined copy
constructors that could do the wrong thing. This has now been fixed by adding
an appropriate copy constructor and assignment operator.

Make sure we don't add empty ModuleSP entries to a module list.

Fixed the commpage module creation on MacOSX, but we still need to train
the MacOSX dynamic loader to not get rid of it when it doesn't have an entry
in the all image infos.

Abstracted many more calls from in ProcessGDBRemote down into the
GDBRemoteCommunicationClient subclass to make the classes cleaner and more
efficient.

Fixed the default iOS ARM register context to be correct and also added support
for targets that don't support the qThreadStopInfo packet by selecting the
current thread (only if needed) and then sending a stop reply packet.

Debugserver can now start up with a --unix-socket (-u for short) and can
then bind to port zero and send the port it bound to to a listening process
on the other end. This allows the GDB remote platform to spawn new GDB server
instances (debugserver) to allow platform debugging.







git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129351 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
9335643418cfaeba8e42a6c8e4084eae623b1acd 09-Apr-2011 Johnny Chen <johnny.chen@apple.com> Really fix the test suite crasher this time.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
f15996eea072cdaa8a092f22d3a1212b3d95f0ec 08-Apr-2011 Greg Clayton <gclayton@apple.com> Modified the ArchSpec to take an optional "Platform *" when setting the triple.
This allows you to have a platform selected, then specify a triple using
"i386" and have the remaining triple items (vendor, os, and environment) set
automatically.

Many interpreter commands take the "--arch" option to specify an architecture
triple, so now the command options needed to be able to get to the current
platform, so the Options class now take a reference to the interpreter on
construction.

Modified the build LLVM building in the Xcode project to use the new
Xcode project level user definitions:

LLVM_BUILD_DIR - a path to the llvm build directory
LLVM_SOURCE_DIR - a path to the llvm sources for the llvm that will be used to build lldb
LLVM_CONFIGURATION - the configuration that lldb is built for (Release,
Release+Asserts, Debug, Debug+Asserts).

I also changed the LLVM build to not check if "lldb/llvm" is a symlink and
then assume it is a real llvm build directory versus the unzipped llvm.zip
package, so now you can actually have a "lldb/llvm" directory in your lldb
sources.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
fa3a16a2ea380ef38388ebe323817bd1b32c20cd 31-Mar-2011 Jim Ingham <jingham@apple.com> 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
24bc5d9bfad2a1c562c27e7cf37e1c56d85c45e7 30-Mar-2011 Greg Clayton <gclayton@apple.com> Many improvements to the Platform base class and subclasses. The base Platform
class now implements the Host functionality for a lot of things that make
sense by default so that subclasses can check:

int
PlatformSubclass::Foo ()
{
if (IsHost())
return Platform::Foo (); // Let the platform base class do the host specific stuff

// Platform subclass specific code...
int result = ...
return result;
}

Added new functions to the platform:

virtual const char *Platform::GetUserName (uint32_t uid);
virtual const char *Platform::GetGroupName (uint32_t gid);

The user and group names are cached locally so that remote platforms can avoid
sending packets multiple times to resolve this information.

Added the parent process ID to the ProcessInfo class.

Added a new ProcessInfoMatch class which helps us to match processes up
and changed the Host layer over to using this new class. The new class allows
us to search for processs:
1 - by name (equal to, starts with, ends with, contains, and regex)
2 - by pid
3 - And further check for parent pid == value, uid == value, gid == value,
euid == value, egid == value, arch == value, parent == value.

This is all hookup up to the "platform process list" command which required
adding dumping routines to dump process information. If the Host class
implements the process lookup routines, you can now lists processes on
your local machine:

machine1.foo.com % lldb
(lldb) platform process list
PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME
====== ====== ========== ========== ========== ========== ======================== ============================
99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge
94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker
94852 244 username usergroup username usergroup x86_64-apple-darwin Safari
94727 244 username usergroup username usergroup x86_64-apple-darwin Xcode
92742 92710 username usergroup username usergroup i386-apple-darwin debugserver


This of course also works remotely with the lldb-platform:

machine1.foo.com % lldb-platform --listen 1234

machine2.foo.com % lldb
(lldb) platform create remote-macosx
Platform: remote-macosx
Connected: no
(lldb) platform connect connect://localhost:1444
Platform: remote-macosx
Triple: x86_64-apple-darwin
OS Version: 10.6.7 (10J869)
Kernel: Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
Hostname: machine1.foo.com
Connected: yes
(lldb) platform process list
PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME
====== ====== ========== ========== ========== ========== ======================== ============================
99556 244 username usergroup username usergroup x86_64-apple-darwin trustevaluation
99548 65539 username usergroup username usergroup x86_64-apple-darwin lldb
99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge
94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker
94852 244 username usergroup username usergroup x86_64-apple-darwin Safari

The lldb-platform implements everything with the Host:: layer, so this should
"just work" for linux. I will probably be adding more stuff to the Host layer
for launching processes and attaching to processes so that this support should
eventually just work as well.

Modified the target to be able to be created with an architecture that differs
from the main executable. This is needed for iOS debugging since we can have
an "armv6" binary which can run on an "armv7" machine, so we want to be able
to do:

% lldb
(lldb) platform create remote-ios
(lldb) file --arch armv7 a.out

Where "a.out" is an armv6 executable. The platform then can correctly decide
to open all "armv7" images for all dependent shared libraries.

Modified the disassembly to show the current PC value. Example output:

(lldb) disassemble --frame
a.out`main:
0x1eb7: pushl %ebp
0x1eb8: movl %esp, %ebp
0x1eba: pushl %ebx
0x1ebb: subl $20, %esp
0x1ebe: calll 0x1ec3 ; main + 12 at test.c:18
0x1ec3: popl %ebx
-> 0x1ec4: calll 0x1f12 ; getpid
0x1ec9: movl %eax, 4(%esp)
0x1ecd: leal 199(%ebx), %eax
0x1ed3: movl %eax, (%esp)
0x1ed6: calll 0x1f18 ; printf
0x1edb: leal 213(%ebx), %eax
0x1ee1: movl %eax, (%esp)
0x1ee4: calll 0x1f1e ; puts
0x1ee9: calll 0x1f0c ; getchar
0x1eee: movl $20, (%esp)
0x1ef5: calll 0x1e6a ; sleep_loop at test.c:6
0x1efa: movl $12, %eax
0x1eff: addl $20, %esp
0x1f02: popl %ebx
0x1f03: leave
0x1f04: ret

This can be handy when dealing with the new --line options that was recently
added:

(lldb) disassemble --line
a.out`main + 13 at test.c:19
18 {
-> 19 printf("Process: %i\n\n", getpid());
20 puts("Press any key to continue..."); getchar();
-> 0x1ec4: calll 0x1f12 ; getpid
0x1ec9: movl %eax, 4(%esp)
0x1ecd: leal 199(%ebx), %eax
0x1ed3: movl %eax, (%esp)
0x1ed6: calll 0x1f18 ; printf

Modified the ModuleList to have a lookup based solely on a UUID. Since the
UUID is typically the MD5 checksum of a binary image, there is no need
to give the path and architecture when searching for a pre-existing
image in an image list.

Now that we support remote debugging a bit better, our lldb_private::Module
needs to be able to track what the original path for file was as the platform
knows it, as well as where the file is locally. The module has the two
following functions to retrieve both paths:

const FileSpec &Module::GetFileSpec () const;
const FileSpec &Module::GetPlatformFileSpec () const;





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
b344843f75ef893762c93fd0a22d2d45712ce74d 24-Mar-2011 Greg Clayton <gclayton@apple.com> Fixed the LLDB build so that we can have private types, private enums and
public types and public enums. This was done to keep the SWIG stuff from
parsing all sorts of enums and types that weren't needed, and allows us to
abstract our API better.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
b1888f24fa181489840b9acf193e224d125d0776 19-Mar-2011 Greg Clayton <gclayton@apple.com> Added more platform support. There are now some new commands:

platform status -- gets status information for the selected platform
platform create <platform-name> -- creates a new instance of a remote platform
platform list -- list all available platforms
platform select -- select a platform instance as the current platform (not working yet)

When using "platform create" it will create a remote platform and make it the
selected platform. For instances for iPhone OS debugging on Mac OS X one can
do:

(lldb) platform create remote-ios --sdk-version=4.0
Remote platform: iOS platform
SDK version: 4.0
SDK path: "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0"
Not connected to a remote device.
(lldb) file ~/Documents/a.out
Current executable set to '~/Documents/a.out' (armv6).
(lldb) image list
[ 0] /Volumes/work/gclayton/Documents/devb/attach/a.out
[ 1] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/dyld
[ 2] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/libSystem.B.dylib


Note that this is all happening prior to running _or_ connecting to a remote
platform. Once connected to a remote platform the OS version might change which
means we will need to update our dependecies. Also once we run, we will need
to match up the actualy binaries with the actualy UUID's to files in the
SDK, or download and cache them locally.

This is just the start of the remote platforms, but this modification is the
first iteration in getting the platforms really doing something.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
cd548034fa23113e995b8463d14f910ba2f7298c 01-Feb-2011 Greg Clayton <gclayton@apple.com> Endian patch from Kirk Beitz that allows better cross platform building.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
bdcb6abaa287df2c5f312c51d993c1d0b0cb120c 26-Jan-2011 Greg Clayton <gclayton@apple.com> Enabled extra warnings and fixed a bunch of small issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
c67efa41a83b0f8b2bab467436a23b50a44e7f30 20-Jan-2011 Greg Clayton <gclayton@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
a7a9c89873a888ec0f354d19e1da37428e6923e6 23-Dec-2010 Jim Ingham <jingham@apple.com> "frame variable" requires that the process be running and paused or there aren't any frames... So mark the command properly as such.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@122464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
c3b61d239a53271d013b82ffaba6ab4e92b7fcc1 15-Dec-2010 Greg Clayton <gclayton@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
36b73363a07aa630cfc540ac33fae4955768981f 15-Nov-2010 Greg Clayton <gclayton@apple.com> Added the address of operator for the "frame variable" command.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
3bc52d0a96c18be384028a90914f534ac252fbe4 14-Nov-2010 Greg Clayton <gclayton@apple.com> Just like functions can have a basename and a mangled/demangled name, variable
can too. So now the lldb_private::Variable class has support for this.

Variables now have support for having a basename ("i"), and a mangled name
("_ZN12_GLOBAL__N_11iE"), and a demangled name ("(anonymous namespace)::i").

Nowwhen searching for a variable by name, users might enter the fully qualified
name, or just the basename. So new test functions were added to the Variable
and Mangled classes as:

bool NameMatches (const ConstString &name);
bool NameMatches (const RegularExpression &regex);

I also modified "ClangExpressionDeclMap::FindVariableInScope" to also search
for global variables that are not in the current file scope by first starting
with the current module, then moving on to all modules.

Fixed an issue in the DWARF parser that could cause a varaible to get parsed
more than once. Now, once we have parsed a VariableSP for a DIE, we cache
the result even if a variable wasn't made so we don't do any re-parsing. Some
DW_TAG_variable DIEs don't have locations, or are missing vital info that
stops a debugger from being able to display anything for it, we parse a NULL
variable shared pointer for these DIEs so we don't keep trying to reparse it.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
fddc25a4990b0e01fdc69d4a095e424e0340207b 10-Nov-2010 Benjamin Kramer <benny.kra@googlemail.com> Silence a bunch of clang warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
9bd7e354c07c7a807c89d787995b28d7a7f4ca25 28-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed the "frame variable -G NAME" that would print global
variables by name. It was accidentally getting all the globals
for the compile unit that contained the global variable named
NAME.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
17a661cbf6cc87cd4d83e21c72195de9f99a7f7c 26-Oct-2010 Johnny Chen <johnny.chen@apple.com> Add an extra SPC character after '.' for the 'frame variable' help text.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
bf8e42b9da0e1c6349a727d644ad37610b00d556 15-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed an expression parsing issue where if you were stopped somewhere without
debug information and you evaluated an expression, a crash would occur as a
result of an unchecked pointer.

Added the ability to get the expression path for a ValueObject. For a rectangle
point child "x" the expression path would be something like: "rect.top_left.x".
This will allow GUI and command lines to get ahold of the expression path for
a value object without having to explicitly know about the hierarchy. This
means the ValueObject base class now has a "ValueObject *m_parent;" member.
All ValueObject subclasses now correctly track their lineage and are able
to provide value expression paths as well.

Added a new "--flat" option to the "frame variable" to allow for flat variable
output. An example of the current and new outputs:

(lldb) frame variable
argc = 1
argv = 0x00007fff5fbffe80
pt = {
x = 2
y = 3
}
rect = {
bottom_left = {
x = 1
y = 2
}
top_right = {
x = 3
y = 4
}
}
(lldb) frame variable --flat
argc = 1
argv = 0x00007fff5fbffe80
pt.x = 2
pt.y = 3
rect.bottom_left.x = 1
rect.bottom_left.y = 2
rect.top_right.x = 3
rect.top_right.y = 4


As you can see when there is a lot of hierarchy it can help flatten things out.
Also if you want to use a member in an expression, you can copy the text from
the "--flat" output and not have to piece it together manually. This can help
when you want to use parts of the STL in expressions:

(lldb) frame variable --flat
argc = 1
argv = 0x00007fff5fbffea8
hello_world._M_dataplus._M_p = 0x0000000000000000
(lldb) expr hello_world._M_dataplus._M_p[0] == '\0'




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
b227e142b5eb7d1825e85f0d797f12e817bf89c7 13-Oct-2010 Greg Clayton <gclayton@apple.com> Default "frame variable" to not show types before values by default. You now enable type display with --show-types or -t (instead of disabling it with --no-types or -t).

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
6bc0b5d69f6f5f46055be6cfea6f9a0eb11b1943 11-Oct-2010 Greg Clayton <gclayton@apple.com> Added the ability to get error strings back from failed
lldb_private::RegularExpression compiles and matches with:

size_t
RegularExpression::GetErrorAsCString (char *err_str,
size_t err_str_max_len) const;

Added the ability to search a variable list for variables whose names match
a regular expression:

size_t
VariableList::AppendVariablesIfUnique (const RegularExpression& regex,
VariableList &var_list,
size_t& total_matches);


Also added the ability to append a variable to a VariableList only if it is
not already in the list:

bool
VariableList::AddVariableIfUnique (const lldb::VariableSP &var_sp);

Cleaned up the "frame variable" command:
- Removed the "-n NAME" option as this is the default way for the command to
work.
- Enable uniqued regex searches on variable names by fixing the "--regex RE"
command to work correctly. It will match all variables that match any
regular expressions and only print each variable the first time it matches.
- Fixed the option type for the "--regex" command to by eArgTypeRegularExpression
instead of eArgTypeCount




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
c12b6b40b93687539b0ca303f64eb77b6af6924d 11-Oct-2010 Greg Clayton <gclayton@apple.com> Added a new test case to test signals with.

Added frame relative frame selection to "frame select". You can now select
frames relative to the current frame (which defaults to zero if the current
frame hasn't yet been set for a thread):

The gdb "up" command can be done as:
(lldb) frame select -r 1
The gdb "down" command can be done as:
(lldb) frame select -r -1

Place the following in your ~/.lldbinit file for "up" and "down":

command alias up frame select -r 1
command alias down frame select -r -1




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
66ed2fbeaf588fe4105a1305f7e956dcf9fbe299 05-Oct-2010 Greg Clayton <gclayton@apple.com> Added a new ValueObject type that will be used to freeze dry expression
results. The clang opaque type for the expression result will be added to the
Target's ASTContext, and the bytes will be stored in a DataBuffer inside
the new object. The class is named: ValueObjectConstResult

Now after an expression is evaluated, we can get a ValueObjectSP back that
contains a ValueObjectConstResult object.

Relocated the value object dumping code into a static function within
the ValueObject class instead of being in the CommandObjectFrame.cpp file
which is what contained the code to dump variables ("frame variables").




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
43b014aa33e20e61790e16ed69a2c57aae2fbc6e 05-Oct-2010 Caroline Tice <ctice@apple.com> Modify existing commands with arguments to use the new argument mechanism
(for standardized argument names, argument help, etc.)



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
a830adbcd63d1995a01e6e18da79893c1426ca43 04-Oct-2010 Greg Clayton <gclayton@apple.com> 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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
4d6675c8e1cab6360f59865229835ae137d6f68a 01-Oct-2010 Caroline Tice <ctice@apple.com> Modify command options to use the new arguments mechanism. Now all command option
arguments are specified in a standardized way, will have a standardized name, and
have functioning help.

The next step is to start writing useful help for all the argument types.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
462d4147f3bb9141bf62d904f58a623db00669df 29-Sep-2010 Greg Clayton <gclayton@apple.com> Fixed the forward declaration issue that was present in the DWARF parser after
adding methods to C++ and objective C classes. In order to make methods, we
need the function prototype which means we need the arguments. Parsing these
could cause a circular reference that caused an assertion.

Added a new typedef for the clang opaque types which are just void pointers:
lldb::clang_type_t. This appears in lldb-types.h.

This was fixed by enabling struct, union, class, and enum types to only get
a forward declaration when we make the clang opaque qual type for these
types. When they need to actually be resolved, lldb_private::Type will call
a new function in the SymbolFile protocol to resolve a clang type when it is
not fully defined (clang::TagDecl::getDefinition() returns NULL). This allows
us to be a lot more lazy when parsing clang types and keeps down the amount
of data that gets parsed into the ASTContext for each module.

Getting the clang type from a "lldb_private::Type" object now takes a boolean
that indicates if a forward declaration is ok:

clang_type_t lldb_private::Type::GetClangType (bool forward_decl_is_ok);

So function prototypes that define parameters that are "const T&" can now just
parse the forward declaration for type 'T' and we avoid circular references in
the type system.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
5bc8c97d62b2e399bd90fb7e00c903d7887412ab 20-Sep-2010 Caroline Tice <ctice@apple.com> Add UserSettings to Target class, making Target settings
the parent of Process settings; add 'default-arch' as a
class-wide setting for Target. Replace lldb::GetDefaultArchitecture
with Target::GetDefaultArchitecture & Target::SetDefaultArchitecture.

Add 'use-external-editor' as user setting to Debugger class & update
code appropriately.

Add Error parameter to methods that get user settings, for easier
reporting of bad requests.

Fix various other minor related bugs.

Fix test cases to work with new changes.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
aa44805e19afee2e2796ad294bd77a5f952df5d3 18-Sep-2010 Greg Clayton <gclayton@apple.com> Added a better error message to the "frame variable" when you try to view
frame variables and are not stopped in a valid frame.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114267 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
1e30afd4c299debbd421add473668a0de580e94c 18-Sep-2010 Greg Clayton <gclayton@apple.com> Fixed an issue with:

(lldb) frame variable --location

Where the address of variables wasn't being formatted consistently.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
fe424a92fc6fd92f810d243912461fe028a2b63c 18-Sep-2010 Greg Clayton <gclayton@apple.com> General command line help cleanup:
- All single character options will now be printed together
- Changed all options that contains underscores to contain '-' instead
- Made the help come out a little flatter by showing the long and short
option on the same line.
- Modified the short character for "--ignore-count" options to "-i"



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
238c0a1e7b733cee539258faa656159c63f9e893 18-Sep-2010 Greg Clayton <gclayton@apple.com> Fixed the way set/show variables were being accessed to being natively
accessed by the objects that own the settings. The previous approach wasn't
very usable and made for a lot of unnecessary code just to access variables
that were already owned by the objects.

While I fixed those things, I saw that CommandObject objects should really
have a reference to their command interpreter so they can access the terminal
with if they want to output usaage. Fixed up all CommandObjects to take
an interpreter and cleaned up the API to not need the interpreter to be
passed in.

Fixed the disassemble command to output the usage if no options are passed
down and arguments are passed (all disassebmle variants take options, there
are no "args only").



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
a357ecfaec0c9c718e26d5558499622110993e73 14-Sep-2010 Greg Clayton <gclayton@apple.com> Fixed the implementation of "bool Block::Contains (const Block *block) const"
to return the correct result.

Fixed "bool Variable::IsInScope (StackFrame *frame)" to return the correct
result when there are no location lists.

Modified the "frame variable" command such that:
- if no arguments are given (dump all frame variables), then we only show
variables that are currently in scope
- if some arguments are given, we show an error if the variable is out of
scope



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
178710cd4307f3d44dc76ebd70fc7daf7ebe17c5 14-Sep-2010 Greg Clayton <gclayton@apple.com> 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".



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
c0cf52d198b38f98d1bb302123c9ea536a8e66c9 13-Sep-2010 Greg Clayton <gclayton@apple.com> Make sure we have a variable list so we don't crash when a frame has no
frame variables.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113736 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
3b71737fef27f2e68cf0ea4aefbc0ae58418575c 13-Sep-2010 Greg Clayton <gclayton@apple.com> Removed unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
aed588178b54d221ef1784862adeb5262d3612f2 13-Sep-2010 Greg Clayton <gclayton@apple.com> Added a work in the DWARF parser when we parse an array that ends up having
no elements so that they at least have 1 element.

Added the ability to show the declaration location of variables to the
"frame variables" with the "--show-declaration" option ("-c" for short).

Changed the "frame variables" command over to use the value object code
so that we use the same code path as the public API does when accessing and
displaying variable values.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
4ae519666628cca07c194bf677163009cc2e5a8b 11-Sep-2010 Jim Ingham <jingham@apple.com> Move the "Object Description" into the ValueObject, and the add an API to
SBValue to access it. For now this is just the result of ObjC NSPrintForDebugger,
but could be extended. Also store the results of the ObjC Object Printer in a
Stream, not a ConstString.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
abb507ae79e20ab2dd8365049921df73a24c95a5 08-Sep-2010 Caroline Tice <ctice@apple.com> Clean up, clarify and standardize help text, and fix a few help text formatting problems.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
72b7158235500ae6d4b69ed378cbc36bf6e5cbe1 02-Sep-2010 Greg Clayton <gclayton@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
17dae081d7b88d24a7af6b07c10fc5981f81e2a9 02-Sep-2010 Greg Clayton <gclayton@apple.com> StackFrame objects now own ValueObjects for any frame variables (locals, args,
function statics, file globals and static variables) that a frame contains.
The StackFrame objects can give out ValueObjects instances for
each variable which allows us to track when a variable changes and doesn't
depend on variable names when getting value objects.

StackFrame::GetVariableList now takes a boolean to indicate if we want to
get the frame compile unit globals and static variables.

The value objects in the stack frames can now correctly track when they have
been modified. There are a few more tweaks needed to complete this work. The
biggest issue is when stepping creates partial stacks (just frame zero usually)
and causes previous stack frames not to match up with the current stack frames
because the previous frames only has frame zero. We don't really want to
require that all previous frames be complete since stepping often must check
stack frames to complete their jobs. I will fix this issue tomorrow.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
537926c76e5bc7b92ce9a74c864f1d2e2a346596 02-Sep-2010 Jim Ingham <jingham@apple.com> Move "variable list" to "frame variable"



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
74989e88af7e04f3fe0bb3a800163113d7e0ca12 30-Aug-2010 Jim Ingham <jingham@apple.com> Added a way to open the current source file & line in an external editor, and you can turn this on with:

lldb -e

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
c833295baeec641086f536e78050388af36784f8 26-Aug-2010 Jim Ingham <jingham@apple.com> 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
63094e0bb161580564954dee512955c1c79d3476 23-Jun-2010 Greg Clayton <gclayton@apple.com> Very large changes that were needed in order to allow multiple connections
to the debugger from GUI windows. Previously there was one global debugger
instance that could be accessed that had its own command interpreter and
current state (current target/process/thread/frame). When a GUI debugger
was attached, if it opened more than one window that each had a console
window, there were issues where the last one to setup the global debugger
object won and got control of the debugger.

To avoid this we now create instances of the lldb_private::Debugger that each
has its own state:
- target list for targets the debugger instance owns
- current process/thread/frame
- its own command interpreter
- its own input, output and error file handles to avoid conflicts
- its own input reader stack

So now clients should call:

SBDebugger::Initialize(); // (static function)

SBDebugger debugger (SBDebugger::Create());
// Use which ever file handles you wish
debugger.SetErrorFileHandle (stderr, false);
debugger.SetOutputFileHandle (stdout, false);
debugger.SetInputFileHandle (stdin, true);

// main loop

SBDebugger::Terminate(); // (static function)

SBDebugger::Initialize() and SBDebugger::Terminate() are ref counted to
ensure nothing gets destroyed too early when multiple clients might be
attached.

Cleaned up the command interpreter and the CommandObject and all subclasses
to take more appropriate arguments.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@106615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
84cdc15005983e5244d665fa779e33c2b6fac95f 15-Jun-2010 Jim Ingham <jingham@apple.com> Move Args.{cpp,h} and Options.{cpp,h} to Interpreter where they really belong.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@106034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp
24943d2ee8bfaa7cf5893e4709143924157a5c1e 08-Jun-2010 Chris Lattner <sabre@nondot.org> Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Commands/CommandObjectFrame.cpp