summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectFrame.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+2
| | | | | | | | | - 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! llvm-svn: 169341
* <rdar://problem/12798131> Greg Clayton2012-12-041-1/+1
| | | | | | | | | | | | 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 llvm-svn: 169189
* Change the Thread constructor over to take a Process& rather than a ↵Jim Ingham2012-10-101-2/+3
| | | | | | | | | | | | | 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> llvm-svn: 165640
* Change the NULL to a 0 since we need a uint32_tFilipe Cabecinhas2012-09-111-1/+1
| | | | llvm-svn: 163625
* <rdar://problem/11578397> Adding a new --summary-string option for the frame ↵Enrico Granata2012-08-091-2/+4
| | | | | | 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 llvm-svn: 161623
* <rdar://problem/11870357>Greg Clayton2012-07-141-1/+2
| | | | | | Allow "frame variable" to find ivars without the need for "this->" or "self->". llvm-svn: 160211
* <rdar://problem/11852100>Greg Clayton2012-07-111-8/+1
| | | | | | The "stop-line-count-after" and "stop-line-count-before" settings are broken. This fixes them. llvm-svn: 160071
* Make raw & parsed commands subclasses of CommandObject rather than having ↵Jim Ingham2012-06-081-31/+29
| | | | | | | | | | | | | | | | 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". llvm-svn: 158235
* Massive enumeration name changes: a number of enums in ValueObject were not ↵Enrico Granata2012-03-191-1/+1
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 153061
* 1) solving a bug where, after Jim's fixes to stack frames, synthetic ↵Enrico Granata2012-03-011-16/+13
| | | | | | | | | | | | | | | | | 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 llvm-svn: 151801
* Make the StackFrameList::GetFrameAtIndex only fetch as many stack frames as ↵Jim Ingham2012-02-291-3/+5
| | | | | | | | | needed to get the frame requested. <rdar://problem/10943135> llvm-svn: 151705
* The second part in thread hardening the internals of LLDB where we makeGreg Clayton2012-02-181-2/+3
| | | | | | | | | | | | | | | | the lldb_private::StackFrame objects hold onto a weak pointer to the thread object. The lldb_private::StackFrame objects the the most volatile objects we have as when we are doing single stepping, frames can often get lost or thrown away, only to be re-created as another object that still refers to the same frame. We have another bug tracking that. But we need to be able to have frames no longer be able to get the thread when they are not part of a thread anymore, and this is the first step (this fix makes that possible but doesn't implement it yet). Also changed lldb_private::ExecutionContextScope to return shared pointers to all objects in the execution context to further thread harden the internals. llvm-svn: 150871
* <rdar://problem/10062621>Enrico Granata2012-02-151-1/+1
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 150558
* Remove the functionality of using 'frame variable -w' to set a watchpoint ↵Johnny Chen2012-02-141-73/+1
| | | | | | | | now that 'watchpoint set variable/expression' is working. Also update the relevant test cases. llvm-svn: 150514
* After discussions with Jim and Greg, modify the 'watchpoint set' command to ↵Johnny Chen2012-02-081-2/+2
| | | | | | | | | | | | | | | | 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 '. llvm-svn: 150109
* Clarify the 'frame variable' help message regarding the watchpoint ↵Johnny Chen2012-02-081-1/+4
| | | | | | functionality. llvm-svn: 150039
* Add help string for 'frame variable' to link to 'watchpoint set' which ↵Johnny Chen2012-02-061-1/+3
| | | | | | | | allows for using an expression to specify the address to watch for. rdar://problem/10703290 llvm-svn: 149917
* Fixed formats being able to be applied recursively when using:Greg Clayton2012-01-261-9/+12
| | | | | | | | target variable -f <format> [args] frame variable -f <format> [args] expression -f <format> -- expr llvm-svn: 149080
* Added support for the new ".apple_objc" accelerator tables. These tables areGreg Clayton2011-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 143114
* Cleaned up many error codes. For any who is filling in error strings intoGreg Clayton2011-10-261-2/+2
| | | | | | | | | | | | | 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. llvm-svn: 142999
* Updated all commands that use a "--format" / "-f" options to use the newGreg Clayton2011-10-251-6/+13
| | | | | | | | | | | | 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. llvm-svn: 142911
* SBValue::Watch() and SBValue::WatchPointee() are now the official API for ↵Johnny Chen2011-10-141-6/+6
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 141925
* Small fix to "frame select" sans frame # feature added yesterday.Jason Molenda2011-09-301-1/+3
| | | | llvm-svn: 140901
* Add an accompanying option to the 'frame variable -w' command to, instead of ↵Johnny Chen2011-09-301-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 140836
* Add an additional "frame select" usage where it will re-select the current frameJason Molenda2011-09-291-0/+6
| | | | | | | 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. llvm-svn: 140819
* Fix help string for "frame variable".Johnny Chen2011-09-281-1/+0
| | | | llvm-svn: 140714
* Add SB API class SBWatchpointLocation and some extra methods to the SBTarget ↵Johnny Chen2011-09-261-0/+1
| | | | | | | | | | | 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. llvm-svn: 140575
* Converted the lldb_private::Process over to use the intrusiveGreg Clayton2011-09-221-29/+29
| | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 140298
* Fix typo.Johnny Chen2011-09-161-1/+1
| | | | llvm-svn: 139948
* Add comment.Johnny Chen2011-09-161-0/+1
| | | | llvm-svn: 139947
* Add a declaraion info member field to the WatchpointLocation class.Johnny Chen2011-09-161-1/+10
| | | | | | | 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. llvm-svn: 139946
* Get the address and the size of the variable for passing to the ↵Johnny Chen2011-09-131-1/+7
| | | | | | Target::CreateWatchpointLocation() method. llvm-svn: 139614
* Remove an unnecessary 'else { ... }', which adds to vertical as well as ↵Johnny Chen2011-09-121-192/+186
| | | | | | | | horizontal spans, from CommandObjectFrame::Execute(). llvm-svn: 139561
* Watchpoint WIP:Johnny Chen2011-09-121-2/+26
| | | | | | | | | | | | 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. llvm-svn: 139560
* Fix indentations, add some comments.Johnny Chen2011-09-121-5/+5
| | | | llvm-svn: 139534
* Fix a bug in OptionGroupWatchpoint.cpp where the '-w' option arg parsing ↵Johnny Chen2011-09-121-0/+16
| | | | | | | | | | | 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. llvm-svn: 139524
* Renaming a bulk of method calls from Get() to something more descriptiveEnrico Granata2011-09-091-1/+1
| | | | llvm-svn: 139435
* Add OptionGroupWatchpoint.cpp/.h (preparatory work) for hooking up ↵Johnny Chen2011-09-091-1/+8
| | | | | | | | | | | | 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. :-) llvm-svn: 139434
* Remove code rot (unused class OptionGroupFrameVariable) from ↵Johnny Chen2011-09-081-81/+1
| | | | | | | | CommandObjectFrameVariable. Plus minor indentation change. llvm-svn: 139335
* "frame select -r" should return an error if you are already at the top of ↵Jim Ingham2011-09-081-2/+22
| | | | | | the stack & try to go up or at the bottom and try to go down. llvm-svn: 139273
* Hold onto a shared pointer to the frame CommandObjectFrameVariable::Execute is Jim Ingham2011-08-271-4/+10
| | | | | | analyzing so it won't get deleted on us if a formatter runs code. llvm-svn: 138692
* More cleanups ; Separated implementation of FormatManager from class ↵Enrico Granata2011-08-221-1/+1
| | | | | | DataVisualization as a front-end by using separate .h/.cpp files - Final aim is to break up FormatManager.h/cpp into several separate files llvm-svn: 138279
* First round of code cleanups:Enrico Granata2011-08-171-1/+2
| | | | | | | | | | | | | | | | | | - 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 llvm-svn: 137886
* Refactoring of ValueObject::DumpValueObject and 'frame variable', 'target ↵Enrico Granata2011-08-151-43/+23
| | | | | | 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 llvm-svn: 137622
* Giving a warning to the user the first time children are truncated by the ↵Enrico Granata2011-08-121-0/+8
| | | | | | new cap setting llvm-svn: 137462
* *Some more optimizations in usage of ConstStringEnrico Granata2011-08-121-3/+6
| | | | | | | | | | | | *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. llvm-svn: 137416
* Remove extra newline from end of 'frame info' command output.Jason Molenda2011-08-101-1/+0
| | | | llvm-svn: 137208
* CFString.py now shows contents in a more NSString-like way (e.g. you get ↵Enrico Granata2011-08-091-6/+6
| | | | | | | | | | @"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 llvm-svn: 137185
* when typing a summary string you can use the %S symbol to explicitly ↵Enrico Granata2011-07-221-1/+4
| | | | | | | | | | | | | | | 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 llvm-svn: 135731
* Fixed a bug where deleting a regex summary would not immediately reflect in ↵Enrico Granata2011-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 135463
OpenPOWER on IntegriCloud