summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix the completion of "fr " and the like.Jim Ingham2010-12-141-0/+17
| | | | llvm-svn: 121785
* Fix small bugs:Caroline Tice2010-12-141-2/+42
| | | | | | | | | | | - Make sure cmd_obj & cmd_obj_sp contain a valid objects before attempting to dereference, in CommandObjectCommandsAlias::Execute and CommandInterpreter::HandleCommand. - Modify CommandInterpreter::GetCommandSPExact to properly handle multi-word command inputs. llvm-svn: 121779
* Fix bug where using incomplete strings for command names causesCaroline Tice2010-12-111-1/+10
| | | | | | | lldb to crash (because of attempt to look for full names when full names were not used). llvm-svn: 121607
* Various fixes mostly relating to the User Settings stuff:Caroline Tice2010-12-101-0/+22
| | | | | | | | | | | | | | | | | - Added new utility function to Arg, GetQuotedCommandString, which re-assembles the args into a string, replacing quotes that were originally there. - Modified user settings stuff to always show individual elements when printing out arrays and dictionaries. - Added more extensive help to 'settings set', explaining more about dictionaries and arrays (including current dictionary syntax). - Fixed bug in user settings where quotes were being stripped and lost, so that sometimes array or dictionary elements that ought to have been a single element were being split up. llvm-svn: 121438
* Modify HandleCommand to not do any argument processing until it has ↵Caroline Tice2010-12-092-157/+343
| | | | | | | | | | | | | | | | determined whether or not the command should take raw input, then handle & dispatch the arguments appropriately. Also change the 'alias' command to be a command that takes raw input. This is necessary to allow aliases to be created for other commands that take raw input and might want to include raw input in the alias itself. Fix a bug in the aliasing mechanism when creating aliases for commands with 3-or-more words. Raw input should now be properly handled by all the command and alias mechanisms. llvm-svn: 121423
* - Fix alias-building & resolving to properly handle optional arguments for ↵Caroline Tice2010-12-072-39/+186
| | | | | | | | | | | | | | | | | | command options. - Add logging for command resolution ('log enable lldb commands') - Fix alias resolution to properly handle commands that take raw input (resolve the alias, but don't muck up the raw arguments). Net result: Among other things, 'expr' command can now take strings with escaped characters and not have the command handling & alias resolution code muck up the escaped characters. E.g. 'expr printf ("\n\n\tHello there!")' should now work properly. Not working yet: Creating aliases with raw input for commands that take raw input. Working on that. e.g. 'command alias print_hi expr printf ("\n\tHi!")' does not work yet. llvm-svn: 121171
* Add the ability to catch and do the right thing with Interrupts (often ↵Caroline Tice2010-11-192-31/+29
| | | | | | | | control-c) and end-of-file (often control-d). llvm-svn: 119837
* Move the embedded Python interpreter onto a separate thread, to preventCaroline Tice2010-11-101-9/+118
| | | | | | | main thread from having to wait on it (which was causing some I/O hangs). llvm-svn: 118700
* Modified lldb_private::SymboleFile to be able to override where its TypeListGreg Clayton2010-11-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | comes from by using a virtual function to provide it from the Module's SymbolVendor by default. This allows the DWARF parser, when being used to parse DWARF in .o files with a parent DWARF + debug map parser, to get its type list from the DWARF + debug map parser so when we go and find full definitions for types (that might come from other .o files), we can use the type list from the debug map parser. Otherwise we ended up mixing clang types from one .o file (say a const pointer to a forward declaration "class A") with the a full type from another .o file. This causes expression parsing, when copying the clang types from those parsed by the DWARF parser into the expression AST, to fail -- for good reason. Now all types are created in the same list. Also added host support for crash description strings that can be set before doing a piece of work. On MacOSX, this ties in with CrashReporter support that allows a string to be dispalyed when the app crashes and allows LLDB.framework to print a description string in the crash log. Right now this is hookup up the the CommandInterpreter::HandleCommand() where each command notes that it is about to be executed, so if we crash while trying to do this command, we should be able to see the command that caused LLDB to exit. For all other platforms, this is a nop. llvm-svn: 118672
* Added a top level Timer to the interpreter execute command. Also added an ↵Jim Ingham2010-11-041-0/+2
| | | | | | | | | | option to pass the depth to "log timer enable". That allows you to time just command execution with: log timer enable 1 <command> log timer dump llvm-svn: 118267
* Cleaned up the API logging a lot more to reduce redundant information and Greg Clayton2010-10-311-2/+5
| | | | | | | | | keep the file size a bit smaller. Exposed SBValue::GetExpressionPath() so SBValue users can get an expression path for their values. llvm-svn: 117851
* Remove references to particular Python version (use the system defaultCaroline Tice2010-10-281-0/+4
| | | | | | | | | | version); change include statements to use Python.h in the Python framework on Mac OS X systems; leave it using regular Python.h on other systems. Note: I think this *ought* to work properly on Linux systems, but I don't have a system to test it on... llvm-svn: 117612
* Flush the prompts immediately in the breakpoint command input readers, to make Caroline Tice2010-10-271-0/+7
| | | | | | sure they come out at the correct times. llvm-svn: 117470
* Updated the lldb_private::Flags class to have better method names and madeGreg Clayton2010-10-271-3/+3
| | | | | | | | | | | | | | | | | all of the calls inlined in the header file for better performance. Fixed the summary for C string types (array of chars (with any combo if modifiers), and pointers to chars) work in all cases. Fixed an issue where a forward declaration to a clang type could cause itself to resolve itself more than once if, during the resolving of the type itself it caused something to try and resolve itself again. We now remove the clang type from the forward declaration map in the DWARF parser when we start to resolve it and avoid this additional call. This should stop any duplicate members from appearing and throwing all the alignment of structs, unions and classes. llvm-svn: 117437
* First pass at adding logging capabilities for the API functions. At the momentCaroline Tice2010-10-261-1/+2
| | | | | | | | | | | | | | | | | | it logs the function calls, their arguments and the return values. This is not complete or polished, but I am committing it now, at the request of someone who really wants to use it, even though it's not really done. It currently does not attempt to log all the functions, just the most important ones. I will be making further adjustments to the API logging code over the next few days/weeks. (Suggestions for improvements are welcome). Update the Python build scripts to re-build the swig C++ file whenever the python-extensions.swig file is modified. Correct the help for 'log enable' command (give it the correct number & type of arguments). llvm-svn: 117349
* Changed "run" to alias "process launch --".Jim Ingham2010-10-221-4/+7
| | | | | | Added "po" alias for "expression -o --" llvm-svn: 117125
* Fixed an issue where we were resolving paths when we should have been.Greg Clayton2010-10-202-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So the issue here was that we have lldb_private::FileSpec that by default was always resolving a path when using the: FileSpec::FileSpec (const char *path); and in the: void FileSpec::SetFile(const char *pathname, bool resolve = true); This isn't what we want in many many cases. One example is you have "/tmp" on your file system which is really "/private/tmp". You compile code in that directory and end up with debug info that mentions "/tmp/file.c". Then you type: (lldb) breakpoint set --file file.c --line 5 If your current working directory is "/tmp", then "file.c" would be turned into "/private/tmp/file.c" which won't match anything in the debug info. Also, it should have been just a FileSpec with no directory and a filename of "file.c" which could (and should) potentially match any instances of "file.c" in the debug info. So I removed the constructor that just takes a path: FileSpec::FileSpec (const char *path); // REMOVED You must now use the other constructor that has a "bool resolve" parameter that you must always supply: FileSpec::FileSpec (const char *path, bool resolve); I also removed the default parameter to SetFile(): void FileSpec::SetFile(const char *pathname, bool resolve); And fixed all of the code to use the right settings. llvm-svn: 116944
* Combine eArgTypeSignalName and eArgTypeUnixSignalNumber into a singleCaroline Tice2010-10-181-3/+2
| | | | | | argument type, eArgTypeUnixSignal. llvm-svn: 116764
* Fix small mistake in previous commit (fixing aliases for commands thatCaroline Tice2010-10-181-1/+1
| | | | | | take raw input). llvm-svn: 116760
* Fix bug where aliases for commands that take raw input were notCaroline Tice2010-10-181-0/+11
| | | | | | executing properly. llvm-svn: 116735
* Prevent Python script interpreter initialization from changingCaroline Tice2010-10-181-8/+40
| | | | | | the termios settings on the debugger's input handle. llvm-svn: 116725
* Added a new Host call to find LLDB related paths:Greg Clayton2010-10-171-26/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | static bool Host::GetLLDBPath (lldb::PathType path_type, FileSpec &file_spec); This will fill in "file_spec" with an appropriate path that is appropriate for the current Host OS. MacOSX will return paths within the LLDB.framework, and other unixes will return the paths they want. The current PathType enums are: typedef enum PathType { ePathTypeLLDBShlibDir, // The directory where the lldb.so (unix) or LLDB mach-o file in LLDB.framework (MacOSX) exists ePathTypeSupportExecutableDir, // Find LLDB support executable directory (debugserver, etc) ePathTypeHeaderDir, // Find LLDB header file directory ePathTypePythonDir // Find Python modules (PYTHONPATH) directory } PathType; All places that were finding executables are and python paths are now updated to use this Host call. Added another new host call to launch the inferior in a terminal. This ability will be very host specific and doesn't need to be supported on all systems. MacOSX currently will create a new .command file and tell Terminal.app to open the .command file. It also uses the new "darwin-debug" app which is a small app that uses posix to exec (no fork) and stop at the entry point of the program. The GDB remote plug-in is almost able launch a process and attach to it, it currently will spawn the process, but it won't attach to it just yet. This will let LLDB not have to share the terminal with another process and a new terminal window will pop up when you launch. This won't get hooked up until we work out all of the kinks. The new Host function is: static lldb::pid_t Host::LaunchInNewTerminal ( const char **argv, // argv[0] is executable const char **envp, const ArchSpec *arch_spec, bool stop_at_entry, bool disable_aslr); Cleaned up FileSpec::GetPath to not use strncpy() as it was always zero filling the entire path buffer. Fixed an issue with the dynamic checker function where I missed a '$' prefix that should have been added. llvm-svn: 116690
* Add an initial version of test that exercise the lldb commands: 'process signal'Johnny Chen2010-10-141-6/+1
| | | | | | | | | | | | and 'process handle'. The test suite would like to control the asynch/sync execution of the interpreter during the middle of the test method, so the CommandInterpreter::SetSynchronous(bool value) is modified to allow the mode to be changed more than once. In practice, it would be advisable to control the process and to set the async/sync mode from a single thread, too. llvm-svn: 116467
* Add new argument type, eArgSignalName,Caroline Tice2010-10-131-0/+1
| | | | | | | | | | | 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
* Replace contains_string with 'strcasestr' from libc.Caroline Tice2010-10-121-33/+4
| | | | llvm-svn: 116351
* Fix some memory leaks.Caroline Tice2010-10-121-12/+9
| | | | | | | Add call to lldb.SBDebugger.Initialize() to lldb.py, so it automatically gets called when the lldb Python module gets loaded. llvm-svn: 116345
* Regular expression commands now print the command that results from ↵Greg Clayton2010-10-121-5/+4
| | | | | | expanding the regular expression command. llvm-svn: 116320
* Fix bug where alias command options were being duplicated as command ↵Caroline Tice2010-10-121-6/+28
| | | | | | arguments as well. llvm-svn: 116316
* Added a "--no-lldbinit" option (-n for short (which magically matchesGreg Clayton2010-10-111-1/+6
| | | | | | | what gdb uses)) so we can tell our "lldb" driver program to not automatically parse any .lldbinit files. llvm-svn: 116179
* Fixed process.gdb-remote to be able to properly propagate the signals andGreg Clayton2010-10-091-2/+2
| | | | | | obey the UnixSignals table that we have in the process. llvm-svn: 116139
* Emit a diagnostic message instead of crashing when an argument entry is missing.Johnny Chen2010-10-081-1/+6
| | | | llvm-svn: 116114
* Fixed a crasher when doing 'help image dump symtab'. Supply the entry to ↵Johnny Chen2010-10-081-0/+1
| | | | | | the global arguments table. llvm-svn: 116058
* More SWIG cleanup. Moved the breakpoint callback function back to theGreg Clayton2010-10-071-2/+44
| | | | | | | | | | ScriptInterpreterPython class and made a simple callback function that ScriptInterpreterPython::BreakpointCallbackFunction() now calls so we don't include any internal API stuff into the cpp file that is generated by SWIG. Fixed a few build warnings in debugserver. llvm-svn: 115926
* Add an "auto-confirm" setting to the debugger so you can turn off the ↵Jim Ingham2010-10-041-1/+4
| | | | | | confirmations if you want to. llvm-svn: 115572
* Modify existing commands with arguments to use the new argument mechanismCaroline Tice2010-10-042-62/+112
| | | | | | (for standardized argument names, argument help, etc.) llvm-svn: 115570
* Add a "Confirm" function to the CommandInterpreter so you can confirm ↵Jim Ingham2010-10-041-0/+93
| | | | | | potentially dangerous operations in a generic way. llvm-svn: 115546
* Modify command options to use the new arguments mechanism. Now all command ↵Caroline Tice2010-10-012-18/+37
| | | | | | | | | | | 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-012-1/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix one-liner Python breakpoint commands to be wrapped up in an automaticallyCaroline Tice2010-09-271-5/+11
| | | | | | | generated Python function, and passed the stoppoint context frame and bp_loc as parameters. llvm-svn: 114894
* Automatically wrap *all* Python code entered for a breakpoint command insideCaroline Tice2010-09-271-198/+22
| | | | | | | | an auto-generated Python function, and pass the stoppoint context frame and breakpoint location as parameters to the function (named 'frame' and 'bp_loc'), to be used inside the breakpoint command Python code, if desired. llvm-svn: 114849
* Update help text for breakpoint command one-liners.Caroline Tice2010-09-211-1/+1
| | | | | | | | | | 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-113/+158
| | | | | | | Add a warning if no command was attached to the breakpoint. Update the help slightly. llvm-svn: 114467
* Make the short option print out before the long option in the Caroline Tice2010-09-201-2/+2
| | | | | | command options detailed help section (since it's sorted by short option). llvm-svn: 114364
* Add UserSettings to Target class, making Target settingsCaroline Tice2010-09-201-20/+3
| | | | | | | | | | | | | | | | | | 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
* General command line help cleanup:Greg Clayton2010-09-181-13/+76
| | | | | | | | | | - 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-189-98/+76
| | | | | | | | | | | | | | | | | | 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
* Added default more aliases to ease gdb converts:Greg Clayton2010-09-161-1/+3
| | | | | | | | "b" is now aliased to "regexp-break" "p" is now aliased to "frame variable" "print" is now aliased to "frame variable" llvm-svn: 114092
* Remove help text that is no longer correct.Caroline Tice2010-09-141-4/+26
| | | | | | | Fix Python script interpreter to not fail when the Debugger does not have input/output file handles. llvm-svn: 113880
* Clean up help text.Caroline Tice2010-09-131-1/+1
| | | | llvm-svn: 113738
* Add missing result.SetStatus, to allow aliases to be created withCaroline Tice2010-09-121-0/+1
| | | | | | missing arguments for some of the command options. llvm-svn: 113714
OpenPOWER on IntegriCloud