summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
Commit message (Collapse)AuthorAgeFilesLines
...
* Modify "process handle" so that if no signals are specified it lists/updates ↵Caroline Tice2010-10-141-47/+113
| | | | | | | | | | them all, if no update commands are specified it just lists the current values, and show that it always shows the new values for a signal after it has been updated. Also updated the help text to match the new functionality. llvm-svn: 116520
* Add new argument type, eArgSignalName,Caroline Tice2010-10-131-0/+240
| | | | | | | | | | | Add missing break statment to case statement in Process::ShouldBroadcastEvent. Add new command, "process handle" to allow users to control process behavior on the receipt of various Unix signals (whether the process should stop; whether the process should be passed the signal; whether the debugger user should be notified that the signal came in). llvm-svn: 116430
* Default "frame variable" to not show types before values by default. You now ↵Greg Clayton2010-10-131-3/+3
| | | | | | enable type display with --show-types or -t (instead of disabling it with --no-types or -t). llvm-svn: 116418
* Comment out code that was preventing commands that take raw input stringsCaroline Tice2010-10-121-9/+9
| | | | | | from being alias-able. llvm-svn: 116357
* Fix bug where alias command options were being duplicated as command ↵Caroline Tice2010-10-121-2/+3
| | | | | | arguments as well. llvm-svn: 116316
* Modified the "breakpoint set --name NAME" to be the auto breakpoint set Greg Clayton2010-10-121-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | function. It will inspect NAME and do the following: - if the name contains '(' or starts with "-[" or "+[" then a full name search will happen to match full function names with args (C++ demangled names) or full objective C method prototypes. - if the name contains "::" and no '(', then it is assumed to be a qualified function name that is in a namespace or class. For "foo::bar::baz" we will search for any functions with the basename or method name of "baz", then filter the results to only those that contain "foo::bar::baz". This allows setting breakpoint on C++ functions and methods without having to fully qualify all of the types that would appear in C++ mangled names. - if the name contains ":" (not "::"), then NAME is assumed to be an ObjC selector. _ otherwise, we assume just a plain function basename. Now that "--name" is our "auto" mode, I introduced the new "--basename" option ("breakpoint set --basename NAME") to allow for function names that aren't methods or selectors, just basenames. This can also be used to ignore C++ namespaces and class hierarchies for class methods. Fixed clang enumeration promotion types to be correct. llvm-svn: 116293
* Added a "--no-lldbinit" option (-n for short (which magically matchesGreg Clayton2010-10-111-57/+58
| | | | | | | what gdb uses)) so we can tell our "lldb" driver program to not automatically parse any .lldbinit files. llvm-svn: 116179
* Added the ability to get error strings back from failed Greg Clayton2010-10-101-126/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 116178
* Added a new test case to test signals with.Greg Clayton2010-10-102-38/+135
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 116176
* Added new options to memory read to allow saving memory to disk Greg Clayton2010-10-101-29/+185
| | | | | | | | | | | | | | | | | | | | | as binary bytes or as an ASCII text dump. - The output file is specified with the "--outfile FILE" option. - The memory can be appended to an existing file using the "--append" option. - The memory will be written as an ASCII text dump by default, or as binary with the "--binary" option. Added new options to memory write to allow writing all or part of a file on disk to target memory: - The input file is specified using the "--infile FILE" option - The offset at which to start in the file defaults to zero, but can be overridden using the "--offset OFFSET" option. If the size is not specified, the remaining number of bytes in the file will be used as the default byte size. - The number of bytes to write defaults to the entire file byte size, but can be changed with the "--size COUNT" option. llvm-svn: 116172
* Fixed process.gdb-remote to be able to properly propagate the signals andGreg Clayton2010-10-091-2/+9
| | | | | | obey the UnixSignals table that we have in the process. llvm-svn: 116139
* Fixed a missing space when using the "apropos" command and you don't find ↵Greg Clayton2010-10-091-2/+1
| | | | | | any matches. llvm-svn: 116133
* o TestStdCXXDisassembly.py:Johnny Chen2010-10-081-0/+4
| | | | | | | | | | | | | | | | | | | | Update the expected match string. o lldbtest.py: Indicate when a command fails, even if there is nothing in the error stream. o TestHelp.py: Add a regression test case for 'help image dump symtab'. o CommandObjectHelp.cpp: Some of the logic branches with successful help command results were not tagged with a Success Status. They are fixed now. This is important for Python interaction. llvm-svn: 116062
* Added mutex protection to the Symtab class.Greg Clayton2010-10-082-12/+115
| | | | | | | | Added a new SortOrder enumeration and hooked it up to the "image dump symtab" command so we can dump symbol tables in the original order, sorted by address, or sorted by name. llvm-svn: 116049
* Hooked up ability to look up data symbols so they show up in disassemblyGreg Clayton2010-10-081-0/+7
| | | | | | | | | | | | if the address comes from a data section. Fixed an issue that could occur when looking up a symbol that has a zero byte size where no match would be returned even if there was an exact symbol match. Cleaned up the section dump output and added the section type into the output. llvm-svn: 116017
* Cleaned up the SWIG stuff so all includes happen as they should, no pullingGreg Clayton2010-10-071-15/+18
| | | | | | | | | | | | | | | | | | tricks to get types to resolve. I did this by correctly including the correct files: stdint.h and all lldb-*.h files first before including the API files. This allowed me to remove all of the hacks that were in the lldb.swig file and it also allows all of the #defines in lldb-defines.h and enumerations in lldb-enumerations.h to appear in the lldb.py module. This will make the python script code a lot more readable. Cleaned up the "process launch" command to not execute a "process continue" command, it now just does what it should have with the internal API calls instead of executing another command line command. Made the lldb_private::Process set the state to launching and attaching if WillLaunch/WillAttach return no error respectively. llvm-svn: 115902
* Restored the ability to set the format for expressions after changing the ↵Greg Clayton2010-10-061-0/+3
| | | | | | expression results over to ValueObjectSP objects. llvm-svn: 115733
* Added the notion that a value object can be constant by adding:Greg Clayton2010-10-051-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bool ValueObject::GetIsConstant() const; void ValueObject::SetIsConstant(); This will stop anything from being re-evaluated within the value object so that constant result value objects can maintain their frozen values without anything being updated or changed within the value object. Made it so the ValueObjectConstResult can be constructed with an lldb_private::Error object to allow for expression results to have errors. Since ValueObject objects contain error objects, I changed the expression evaluation in ClangUserExpression from static Error ClangUserExpression::Evaluate (ExecutionContext &exe_ctx, const char *expr_cstr, lldb::ValueObjectSP &result_valobj_sp); to: static lldb::ValueObjectSP Evaluate (ExecutionContext &exe_ctx, const char *expr_cstr); Even though expression parsing is borked right now (pending fixes coming from Sean Callanan), I filled in the implementation for: SBValue SBFrame::EvaluateExpression (const char *expr); Modified all expression code to deal with the above changes. llvm-svn: 115589
* Moved expression evaluation from CommandObjectExpression into Greg Clayton2010-10-052-45/+18
| | | | | | | ClangUserExpression::Evaluate () as a public static function so anyone can evaluate an expression. llvm-svn: 115581
* Added a new ValueObject type that will be used to freeze dry expressionGreg Clayton2010-10-052-180/+63
| | | | | | | | | | | | | | | 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"). llvm-svn: 115578
* Modify existing commands with arguments to use the new argument mechanismCaroline Tice2010-10-0420-63/+804
| | | | | | (for standardized argument names, argument help, etc.) llvm-svn: 115570
* There are now to new "settings set" variables that live in each debuggerGreg Clayton2010-10-043-23/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instance: settings set frame-format <string> settings set thread-format <string> This allows users to control the information that is seen when dumping threads and frames. The default values are set such that they do what they used to do prior to changing over the the user defined formats. This allows users with terminals that can display color to make different items different colors using the escape control codes. A few alias examples that will colorize your thread and frame prompts are: settings set frame-format 'frame #${frame.index}: \033[0;33m${frame.pc}\033[0m{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{ \033[0;35mat \033[1;35m${line.file.basename}:${line.number}}\033[0m\n' settings set thread-format 'thread #${thread.index}: \033[1;33mtid\033[0;33m = ${thread.id}\033[0m{, \033[0;33m${frame.pc}\033[0m}{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{, \033[1;35mstop reason\033[0;35m = ${thread.stop-reason}\033[0m}{, \033[1;36mname = \033[0;36m${thread.name}\033[0m}{, \033[1;32mqueue = \033[0;32m${thread.queue}}\033[0m\n' A quick web search for "colorize terminal output" should allow you to see what you can do to make your output look like you want it. The "settings set" commands above can of course be added to your ~/.lldbinit file for permanent use. Changed the pure virtual void ExecutionContextScope::Calculate (ExecutionContext&); To: void ExecutionContextScope::CalculateExecutionContext (ExecutionContext&); I did this because this is a class that anything in the execution context heirarchy inherits from and "target->Calculate (exe_ctx)" didn't always tell you what it was really trying to do unless you look at the parameter. llvm-svn: 115485
* Uncomment/fix "-f" command option for disassemble command.Caroline Tice2010-10-011-1/+1
| | | | llvm-svn: 115351
* Modify command options to use the new arguments mechanism. Now all command ↵Caroline Tice2010-10-0114-138/+140
| | | | | | | | | | | 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. llvm-svn: 115335
* Add infrastructure for standardizing arguments for commands andCaroline Tice2010-10-013-28/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | command options; makes it easier to ensure that the same type of argument will have the same name everywhere, hooks up help for command arguments, so that users can ask for help when they are confused about what an argument should be; puts in the beginnings of the ability to do tab-completion for certain types of arguments, allows automatic syntax help generation for commands with arguments, and adds command arguments into command options help correctly. Currently only the breakpoint-id and breakpoint-id-range arguments, in the breakpoint commands, have been hooked up to use the new mechanism. The next steps will be to fix the command options arguments to use this mechanism, and to fix the rest of the regular command arguments to use this mechanism. Most of the help text is currently missing or dummy text; this will need to be filled in, and the existing argument help text will need to be cleaned up a bit (it was thrown in quickly, mostly for testing purposes). Help command now works for all argument types, although the help may not be very helpful yet. Those commands that take "raw" command strings now indicate it in their help text. llvm-svn: 115318
* Fixed indentation.Johnny Chen2010-09-301-1/+1
| | | | llvm-svn: 115186
* Fixed 'expr' help message.Johnny Chen2010-09-301-1/+1
| | | | llvm-svn: 115185
* Add "-o" option to "expression" which prints the object description if ↵Jim Ingham2010-09-302-11/+40
| | | | | | available. llvm-svn: 115115
* Fix breakpoint id range testing to disallow ranges that specify breakpoint ↵Caroline Tice2010-09-291-6/+6
| | | | | | | | | | | | | | locations from crossing major breakpoint boundaries (must be within a single breakpoint if specifying locations). Add .* as a means of specifying all the breakpoint locations under a major breakpoint, e.g. "3.*" means "all the breakpoint locations of breakpoint 3". Fix error message to make more sense, if user attempts to specify a breakpoint command when there isn't a target yet. llvm-svn: 115077
* Fixed the forward declaration issue that was present in the DWARF parser afterGreg Clayton2010-09-292-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 115012
* Change command option "--no_override" to "--no-override" (hypen instead of ↵Caroline Tice2010-09-271-1/+1
| | | | | | underscore). llvm-svn: 114840
* Create more useful instance names for target, process and thread instances.Caroline Tice2010-09-271-12/+12
| | | | | | | Change default 'set' behavior so that all instance settings for the specified variable will be updated, unless the "-n" ("--no_override") command options is specified. llvm-svn: 114808
* Update help text for breakpoint command one-liners.Caroline Tice2010-09-212-10/+13
| | | | | | | | | | Fix minor bug in 'commands alias'; alias commands can now handle command options and arguments in the same alias. Also fixes problem that disallowed "process launch --" as an alias. Fix typo in comment in Python script interpreter. llvm-svn: 114499
* Re-write/clean up code that generated Python breakpoint commands.Caroline Tice2010-09-211-0/+5
| | | | | | | Add a warning if no command was attached to the breakpoint. Update the help slightly. llvm-svn: 114467
* Add UserSettings to Target class, making Target settingsCaroline Tice2010-09-203-10/+12
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 114352
* Added a better error message to the "frame variable" when you try to viewGreg Clayton2010-09-181-1/+1
| | | | | | frame variables and are not stopped in a valid frame. llvm-svn: 114267
* Fixed an issue with:Greg Clayton2010-09-182-4/+4
| | | | | | | | (lldb) frame variable --location Where the address of variables wasn't being formatted consistently. llvm-svn: 114266
* General command line help cleanup:Greg Clayton2010-09-188-54/+42
| | | | | | | | | | - 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" llvm-svn: 114265
* Fixed the way set/show variables were being accessed to being natively Greg Clayton2010-09-1836-929/+881
| | | | | | | | | | | | | | | | | | 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"). llvm-svn: 114252
* Modify "settings list" so you can specify a particular instance setting name,Caroline Tice2010-09-152-6/+57
| | | | | | | or a settings prefix, and it will list information about the subset of settings you requested. Also added tab-completion (now that it takes an optional argument). llvm-svn: 113952
* Fixed a missing newline when dumping mixed disassembly.Greg Clayton2010-09-151-1/+1
| | | | | | | | | | | | | | | | | Added a "bool show_fullpaths" to many more objects that were previously always dumping full paths. Fixed a few places where the DWARF was not indexed when we we needed it to be when making queries. Also fixed an issue where the DWARF in .o files wasn't searching all .o files for the types. Fixed an issue with the output from "image lookup --type <TYPENAME>" where the name and byte size might not be resolved and might not display. We now call the accessors so we end up seeing all of the type info. llvm-svn: 113951
* If you have already loaded a file into the debugger, "process attach" will ↵Jim Ingham2010-09-151-20/+34
| | | | | | attach to a process with the filename, unless you specify otherwise. llvm-svn: 113916
* Moved the section load list up into the target so we can use the targetGreg Clayton2010-09-142-11/+11
| | | | | | to symbolicate things without the need for a valid process subclass. llvm-svn: 113895
* Remove help text that is no longer correct.Caroline Tice2010-09-141-2/+0
| | | | | | | Fix Python script interpreter to not fail when the Debugger does not have input/output file handles. llvm-svn: 113880
* Fixed the implementation of "bool Block::Contains (const Block *block) const"Greg Clayton2010-09-141-22/+44
| | | | | | | | | | | | | | | 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 llvm-svn: 113830
* Looking at some of the test suite failures in DWARF in .o files with theGreg Clayton2010-09-141-85/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | debug map showed that the location lists in the .o files needed some refactoring in order to work. The case that was failing was where a function that was in the "__TEXT.__textcoal_nt" in the .o file, and in the "__TEXT.__text" section in the main executable. This made symbol lookup fail due to the way we were finding a real address in the debug map which was by finding the section that the function was in in the .o file and trying to find this in the main executable. Now the section list supports finding a linked address in a section or any child sections. After fixing this, we ran into issue that were due to DWARF and how it represents locations lists. DWARF makes a list of address ranges and expressions that go along with those address ranges. The location addresses are expressed in terms of a compile unit address + offset. This works fine as long as nothing moves around. When stuff moves around and offsets change between the remapped compile unit base address and the new function address, then we can run into trouble. To deal with this, we now store supply a location list slide amount to any location list expressions that will allow us to make the location list addresses into zero based offsets from the object that owns the location list (always a function in our case). With these fixes we can now re-link random address ranges inside the debugger for use with our DWARF + debug map, incremental linking, and more. Another issue that arose when doing the DWARF in the .o files was that GCC 4.2 emits a ".debug_aranges" that only mentions functions that are externally visible. This makes .debug_aranges useless to us and we now generate a real address range lookup table in the DWARF parser at the same time as we index the name tables (that are needed because .debug_pubnames is just as useless). llvm-gcc doesn't generate a .debug_aranges section, though this could be fixed, we aren't going to rely upon it. Renamed a bunch of "UINT_MAX" to "UINT32_MAX". llvm-svn: 113829
* Fixed an error in Debugger::UpdateExecutionContext() where an invalid index ID 0Johnny Chen2010-09-141-0/+1
| | | | | | | | | | | | | was used to set the selected thread if none was selected. Use a more robust API to accomplish the task. Also fixed an error found, while investigating, in CommandObjectThreadSelect:: Execute() where the return status was not properly set if successful. As a result, both the stl step-in test cases with expectedFailure decorators now passed. llvm-svn: 113825
* Bugfixes to the expression parser. Fixes include:Sean Callanan2010-09-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - If you put a semicolon at the end of an expression, this no longer causes the expression parser to error out. This was a two-part fix: first, ClangExpressionDeclMap::Materialize now handles an empty struct (such as when there is no return value); second, ASTResultSynthesizer walks backward from the end of the ASTs until it reaches something that's not a NullStmt. - ClangExpressionVariable now properly byte-swaps when printing itself. - ClangUtilityFunction now cleans up after itself when it's done compiling itself. - Utility functions can now use external functions just like user expressions. - If you end your expression with a statement that does not return a value, the expression now runs correctly anyway. Also, added the beginnings of an Objective-C object validator function, which is neither installed nor used as yet. llvm-svn: 113789
* Make sure we have a variable list so we don't crash when a frame has noGreg Clayton2010-09-131-182/+185
| | | | | | frame variables. llvm-svn: 113736
* Removed unused variable.Greg Clayton2010-09-131-1/+0
| | | | llvm-svn: 113734
OpenPOWER on IntegriCloud