summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
Commit message (Collapse)AuthorAgeFilesLines
...
* LookupAddressInModule: Remove a couple of the extraJason Molenda2011-09-231-3/+1
| | | | | | newlines output at the end of 'image lookup' / 'image lookup -v'. llvm-svn: 140357
* Watchpoint IDs and ID Ranges are not quite the same as Breakpoint IDs and ID ↵Johnny Chen2011-09-222-8/+8
| | | | | | | | | | | | | | | | | Ranges. Add eArgTypeWatchpointID and eArgTypeWatchpointIDRange to the CommandArgumentType enums and modify the signature of CommandObject::AddIDsArgumentData() from: AddIDsArgumentData(CommandArgumentEntry &arg) to: AddIDsArgumentData(CommandArgumentEntry &arg, CommandArgumentType ID, CommandArgumentType IDRange) to accommodate. llvm-svn: 140346
* Add initial implementation of watchpoint commands for list, enable, disable, ↵Johnny Chen2011-09-222-0/+702
| | | | | | | | and delete. Test cases to be added later. llvm-svn: 140322
* Converted the lldb_private::Process over to use the intrusiveGreg Clayton2011-09-2213-136/+147
| | | | | | | | | | | | | | | | | | | | 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
* Add a new breakpoint type "break by source regular expression".Jim Ingham2011-09-212-132/+116
| | | | | | | | | Fix the RegularExpression class so it has a real copy constructor. Fix the breakpoint setting with multiple shared libraries so it makes one breakpoint not one per shared library. Add SBFileSpecList, to be used to expose the above to the SB interface (not done yet.) llvm-svn: 140225
* A little refactoring of the way to add break IDs or ID ranges as command ↵Johnny Chen2011-09-211-64/+4
| | | | | | | | | | | | | argument data to the command argument entry. Add a static helper function: CommandObject::AddIDsArgumentData(CommandArgumentEntry &arg) to be used from CommandObjectBreakpoint.cpp. The helper function could also be useful for commands in the future to manipulate watchpoints. llvm-svn: 140221
* Update declarations for all functions/methods that accept printf-styleJason Molenda2011-09-206-28/+24
| | | | | | | | stdarg formats to use __attribute__ format so the compiler can flag incorrect uses. Fix all incorrect uses. Most of these are innocuous, a few were resulting in crashes. llvm-svn: 140185
* Change Error::SetErrorStringWithFormat() prototype to use anJason Molenda2011-09-201-1/+1
| | | | | | | | | __attribute__ format so the compiler knows that this method takes printf style formatter arguments and checks that it's being used correctly. Fix a couple dozen incorrect SetErrorStringWithFormat() calls throughout the sources. llvm-svn: 140115
* Adopt the intrusive pointers in:Greg Clayton2011-09-171-1/+1
| | | | | | | | | | | | lldb_private::Breakpoint lldb_private::BreakpointLocations lldb_private::BreakpointSite lldb_private::Debugger lldb_private::StackFrame lldb_private::Thread lldb_private::Target llvm-svn: 139985
* Removed the function:Greg Clayton2011-09-171-1/+1
| | | | | | | | | | | ModuleSP Module::GetSP(); Since we are now using intrusive ref counts, we can easily turn any pointer to a module into a shared pointer just by assigning it. llvm-svn: 139984
* Convert lldb::ModuleSP to use an instrusive ref counted pointer.Greg Clayton2011-09-171-1/+1
| | | | | | | | | We had some cases where getting the shared pointer for a module from the global module list was causing a performance issue when debugging with DWARF in .o files. Now that the module uses intrusive ref counts, we can easily convert any pointer to a shared pointer. llvm-svn: 139983
* 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
* This patch modifies the expression parser to allow itSean Callanan2011-09-151-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to execute expressions even in the absence of a process. This allows expressions to run in situations where the target cannot run -- e.g., to perform calculations based on type information, or to inspect a binary's static data. This modification touches the following files: lldb-private-enumerations.h Introduce a new enum specifying the policy for processing an expression. Some expressions should always be JITted, for example if they are functions that will be used over and over again. Some expressions should always be interpreted, for example if the target is unsafe to run. For most, it is acceptable to JIT them, but interpretation is preferable when possible. Target.[h,cpp] Have EvaluateExpression now accept the new enum. ClangExpressionDeclMap.[cpp,h] Add support for the IR interpreter and also make the ClangExpressionDeclMap more robust in the absence of a process. ClangFunction.[cpp,h] Add support for the new enum. IRInterpreter.[cpp,h] New implementation. ClangUserExpression.[cpp,h] Add support for the new enum, and for running expressions in the absence of a process. ClangExpression.h Remove references to the old DWARF-based method of evaluating expressions, because it has been superseded for now. ClangUtilityFunction.[cpp,h] Add support for the new enum. ClangExpressionParser.[cpp,h] Add support for the new enum, remove references to DWARF, and add support for checking whether the expression could be evaluated statically. IRForTarget.[h,cpp] Add support for the new enum, and add utility functions to support the interpreter. IRToDWARF.cpp Removed CommandObjectExpression.cpp Remove references to the obsolete -i option. Process.cpp Modify calls to ClangUserExpression::Evaluate to pass the correct enum (for dlopen/dlclose) SBValue.cpp Add support for the new enum. SBFrame.cpp Add support for he new enum. BreakpointOptions.cpp Add support for the new enum. llvm-svn: 139772
* Change the "attach" command to always wait synchronously for the target to ↵Jim Ingham2011-09-151-26/+11
| | | | | | stop. It's not very useful to return the prompt in mid-attach, and it makes reporting the result of the attach hard to do. llvm-svn: 139764
* 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-092-17/+17
| | | | 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
* Adding two new options to the 'help' command:Enrico Granata2011-09-092-4/+84
| | | | | | | | | | | --show-aliases (-a) shows aliases for commands, as well as built-in commands --hide-user-defined (-u) hides user defined commands by default 'help' without arguments does not show aliases anymore. to see them, add --show-aliases to have only built-in commands appear, use 'help --hide-user-defined' ; there is currently no way to hide built-in commands from the help output 'help command' is not changed by this commit, and help is shown even if command is an alias and -a is not specified llvm-svn: 139377
* Remove code rot (unused class OptionGroupFrameVariable) from ↵Johnny Chen2011-09-081-81/+1
| | | | | | | | CommandObjectFrameVariable. Plus minor indentation change. llvm-svn: 139335
* Move the SourceManager from the Debugger to the Target. That way it can ↵Jim Ingham2011-09-082-59/+60
| | | | | | | | | | store the per-Target default Source File & Line. Set the default Source File & line to main (if it can be found.) at startup. Selecting the current thread & or frame resets the current source file & line, and "source list" as well as the breakpoint command "break set -l <NUM>" will use the current source file. llvm-svn: 139323
* "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
* Refactoring of Get() methods in FormatManager/FormatCategory to have ↵Enrico Granata2011-09-061-0/+8
| | | | | | | | | explicative names and return shared-pointers instead of bools Reduced the amount of memory required to avoid loops in DumpPrintableRepresentation() from 32 bits down to 1 bit - Additionally, disallowed creating summary strings of the form ${var%S} which did nothing but cause endless loops by definition llvm-svn: 139201
* Redesign of the interaction between Python and frozen objects:Enrico Granata2011-09-063-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored in frozen objects ; now such reads transparently move from host to target as required - as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also removed code that enabled to recognize an expression result VO as such - introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO representing a T* or T[], and doing dereferences transparently in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData - as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it en lieu of doing the raw read itself - introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers, this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory) in public layer this returns an SBData, just like GetPointeeData() - introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values - added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing Solved a bug where global pointers to global variables were not dereferenced correctly for display New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128 Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file addresses that generate file address children UNLESS we have a live process) Updated help text for summary-string Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers Edited the syntax and help for some commands to have proper argument types llvm-svn: 139160
* disassemble with no arguments disassembles at the pc. Also got "disassemble ↵Jim Ingham2011-09-012-8/+48
| | | | | | -f" to work, that had gotten broken at some point in the past. llvm-svn: 138929
* 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
* Emit an error message if we're unable to write a value to a register.Jason Molenda2011-08-251-2/+8
| | | | | | | | | (in addition to the previous error message if the value could not be parsed as a numbe). These both generate reasonable errors now - reg write rip 0x500000000000000000000a reg write rip 0x5jjjj llvm-svn: 138543
* Added support for persistent types to theSean Callanan2011-08-231-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expression parser. You can use a persistent type like this: (lldb) expr struct $foo { int a; int b; }; (lldb) struct $foo i; i.a = 2; i.b = 3; i ($foo) $0 = { (int) a = 2 (int) b = 3 } typedefs work similarly. This patch affects the following files: test/expression_command/persistent_types/* A test case for persistent types, in particular structs and typedefs. ClangForward.h Added TypeDecl, needed to declare some functions in ASTResultSynthesizer.h ClangPersistentVariables.[h,cpp] Added a list of persistent types to the persistent variable store. ASTResultSynthesizer.[h,cpp] Made the AST result synthesizer iterate across TypeDecls in the expression, and record any persistent types found. Also made a minor documentation fix. ClangUserExpression.[h,cpp] Extended the user expression class to keep the state needed to report the persistent variable store for the target to the AST result synthesizers. Also introduced a new error code for expressions that executed normally but did not return a result. CommandObjectExpression.cpp Improved output for expressions (like declarations of new persistent types) that don't return a result. This is no longer treated as an error. llvm-svn: 138383
* Short option for --summary-string in 'type summary add' is now -s. This ↵Enrico Granata2011-08-231-3/+3
| | | | | | might be a breaking change for those who have summaries defined. llvm-svn: 138331
* Additional code cleanups ; Short option name for --python-script in type ↵Enrico Granata2011-08-231-4/+31
| | | | | | summary add moved from -s to -o (this is a preliminary step in moving the short option for --summary-string from -f to -s) ; Accordingly updated the test suite llvm-svn: 138315
* Separated FormatNavigator and FormatManager in two different files ; moved ↵Enrico Granata2011-08-221-10/+10
| | | | | | FormatCategoryItem enum out of FormatManager.h as a debugger-wide lldb_private enum ; minor style cleanups llvm-svn: 138307
* Fix the 'target variable' help syntax to output one or more <variable-name>'s.Johnny Chen2011-08-221-0/+13
| | | | | | Add a simple test case for that. llvm-svn: 138281
* More cleanups ; Separated implementation of FormatManager from class ↵Enrico Granata2011-08-222-2/+2
| | | | | | 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
* Code cleanup and refactoring (round 4):Enrico Granata2011-08-221-13/+19
| | | | | | | | | - FormatCategories now are directly mapped by ConstString objects instead of going through const char* -> ConstString -> const char* - FormatCategory callback does not pass category name anymore. This is not necessary because FormatCategory objects themselves hold their name as a member variable llvm-svn: 138254
* Third round of code cleanups:Enrico Granata2011-08-192-3/+3
| | | | | | | | | | | - reorganizing the PTS (Partial Template Specializations) in FormatManager.h - applied a patch by Filipe Cabecinhas to make LLDB compile with GCC Functional changes: - fixed an issue where command type summary add for type "struct Foo" would not match any types. currently, "struct" will be stripped off and type "Foo" will be matched. similar behavior occurs for class, enum and union specifiers. llvm-svn: 138020
* Second round of code cleanups:Enrico Granata2011-08-181-60/+72
| | | | | | | | | | | | | | | - reorganizing classes layout to have public part first Typedefs that we want to keep private, but must be defined for some public code to work correctly are an exception - avoiding methods in the form T foo() { code; } all on one-line - moving method implementations from .h to .cpp whenever feasible Templatized code is an exception and so are very small methods - generally, adhering to coding conventions followed project-wide Functional changes: - fixed an issue where using ${var} in a summary for an aggregate, and then displaying a pointer-to-aggregate would lead to no summary being displayed The issue was not a major one because all ${var} was meant to do in that context was display an error for invalid use of pointer Accordingly fixed test cases and added a new test case llvm-svn: 137944
* Fix the "command alias" help string to make clear that the $<N> ↵Jim Ingham2011-08-181-2/+10
| | | | | | substitutions should be whole words in the output command. llvm-svn: 137921
* First round of code cleanups:Enrico Granata2011-08-172-84/+83
| | | | | | | | | | | | | | | | | | - 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
* New category "gnu-libstdc++" provides summary for std::string and synthetic ↵Enrico Granata2011-08-171-3/+3
| | | | | | | | | | children for types std::map, std::list and std::vector The category is enabled by default. If you run into issues with it, disable it and the previous behavior of LLDB is restored ** This is a temporary solution. The general solution to having formatters pulled in at startup should involve going through the Platform. Fixed an issue in type synthetic list where a category with synthetic providers in it was not shown if all the providers were regex-based llvm-svn: 137850
* When defining a scripted command, it is possible to provide a docstring and ↵Enrico Granata2011-08-171-0/+17
| | | | | | | | | | that will be used as the help text for the command If no docstring is provided, a default help text is created LLDB will refuse to create scripted commands if the scripting language is anything but Python Some additional comments in AppleObjCRuntimeV2.cpp to describe the memory layout expected by the dynamic type lookup code llvm-svn: 137801
* Changes to Python commands:Enrico Granata2011-08-164-361/+531
| | | | | | | | | | | | - They now have an SBCommandReturnObject instead of an SBStream as third argument - The class CommandObjectPythonFunction has been merged into CommandObjectCommands.cpp - The command to manage them is now: command script with subcommands add, list, delete, clear command alias is returned to its previous functionality - Python commands are now part of an user dictionary, instead of being seen as aliases llvm-svn: 137785
* Python commands:Enrico Granata2011-08-163-0/+368
| | | | | | | | | | | | | It is now possible to use 'command alias --python' to define a command name that actually triggers execution of a Python function (e.g. command alias --python foo foo_impl makes a command named 'foo' that runs Python function 'foo_impl') The Python function foo_impl should have as signature: def foo_impl(debugger, args, stream, dict): where debugger is an object wrapping an LLDB SBDebugger args is the command line arguments, as an unparsed Python string stream is an SBStream that represents the standard output dict is an internal utility parameter and should be left untouched The function should return None on no error, or an error string to describe any problems llvm-svn: 137722
* Refactoring of ValueObject::DumpValueObject and 'frame variable', 'target ↵Enrico Granata2011-08-152-55/+37
| | | | | | 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
* Added an error message when the user tries to add a filter when a synthetic ↵Enrico Granata2011-08-121-24/+69
| | | | | | | | provider for the same type is already defined in the same category The converse is also true: an error is shown when the user tries to add a synthetic provider to a category that already has a filter for the same type llvm-svn: 137493
* Giving a warning to the user the first time children are truncated by the ↵Enrico Granata2011-08-122-0/+16
| | | | | | new cap setting llvm-svn: 137462
OpenPOWER on IntegriCloud