summaryrefslogtreecommitdiffstats
path: root/lldb/tools/driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Incremental fixes of issues found by Xcode static analyzer.Johnny Chen2011-08-102-7/+4
| | | | llvm-svn: 137257
* Remove some commented out code that doesn't connect to anything yet...Jim Ingham2011-08-091-6/+0
| | | | llvm-svn: 137081
* Patch by David Forsythe to build lldb on FreeBSD!Johnny Chen2011-08-022-0/+10
| | | | | | | | | | | | | | | | | | I did not take the patch for ClangExpressionParser.cpp since there was a recent change by Peter for the same line. Feel free to disagree. :-) Reference: ---------------------------------------------------------------------- r136580 | pcc | 2011-07-30 15:42:24 -0700 (Sat, 30 Jul 2011) | 3 lines Add reloc arg to standard JIT createJIT() Fixes non-__APPLE__ build. Patch by Matt Johnson! ---------------------------------------------------------------------- Also, I ignore the part of the patch to remove the RegisterContextDarwin*.h/.cpp. llvm-svn: 136720
* Added "command history" command to dump the command history.Jim Ingham2011-07-121-0/+6
| | | | | | | | | | | | | | | | | Also made: (lldb) !<NUM> (lldb) !-<NUM> (lldb) !! work with the history. For added benefit: (lldb) !<NUM><TAB> will insert the command at position <NUM> in the history into the command line to be edited. This is only partial, I still need to sync up editline's history list with the one kept by the interpreter. llvm-svn: 134955
* Don't have the debugger default to ignoring EOF. This is only what the driverGreg Clayton2011-05-291-0/+3
| | | | | | | | (or anything running in a terminal) wants. Not what a UI (Xcode) would want where it creates a debugger per debug window. The current code had an infinite loop after a debug session ended. llvm-svn: 132280
* Fix places that were writing directly to the debugger's outputCaroline Tice2011-05-161-3/+8
| | | | | | handles to go through the appropriate channels instead. llvm-svn: 131415
* Make sure writing asynchronous output only backs upCaroline Tice2011-05-092-1/+7
| | | | | | | & overwrites prompt if the IOChannel input reader is the top input reader. llvm-svn: 131110
* Add ability to search backwards through commandCaroline Tice2011-05-041-2/+3
| | | | | | history for a particular substring, using ctrl-r key. llvm-svn: 130871
* Minor cleanup: When asynchronous output comes along,Caroline Tice2011-05-041-2/+5
| | | | | | | back up over and delete the prompt before writing out the asynchronous output, rather than just going to a new line. llvm-svn: 130843
* Make the driver listen for asynchronous output, rather thanCaroline Tice2011-05-033-20/+27
| | | | | | | the IOChannel, so that it can be written out even while the IOChannel is collecting user input. llvm-svn: 130789
* This patch captures and serializes all output being written by theCaroline Tice2011-05-024-111/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | command line driver, including the lldb prompt being output by editline, the asynchronous process output & error messages, and asynchronous messages written by target stop-hooks. As part of this it introduces a new Stream class, StreamAsynchronousIO. A StreamAsynchronousIO object is created with a broadcaster, who will eventually broadcast the stream's data for a listener to handle, and an event type indicating what type of event the broadcaster will broadcast. When the Write method is called on a StreamAsynchronousIO object, the data is appended to an internal string. When the Flush method is called on a StreamAsynchronousIO object, it broadcasts it's data string and clears the string. Anything in lldb-core that needs to generate asynchronous output for the end-user should use the StreamAsynchronousIO objects. I have also added a new notification type for InputReaders, to let them know that a asynchronous output has been written. This is to allow the input readers to, for example, refresh their prompts and lines, if desired. I added the case statements to all the input readers to catch this notification, but I haven't added any code for handling them yet (except to the IOChannel input reader). llvm-svn: 130721
* Centralized a lot of the status information for processes,Greg Clayton2011-04-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | threads, and stack frame down in the lldb_private::Process, lldb_private::Thread, lldb_private::StackFrameList and the lldb_private::StackFrame classes. We had some command line commands that had duplicate versions of the process status output ("thread list" and "process status" for example). Removed the "file" command and placed it where it should have been: "target create". Made an alias for "file" to "target create" so we stay compatible with GDB commands. We can now have multple usable targets in lldb at the same time. This is nice for comparing two runs of a program or debugging more than one binary at the same time. The new command is "target select <target-idx>" and also to see a list of the current targets you can use the new "target list" command. The flow in a debug session can be: (lldb) target create /path/to/exe/a.out (lldb) breakpoint set --name main (lldb) run ... hit breakpoint (lldb) target create /bin/ls (lldb) run /tmp Process 36001 exited with status = 0 (0x00000000) (lldb) target list Current targets: target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped ) * target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited ) (lldb) target select 0 Current targets: * target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped ) target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited ) (lldb) bt * thread #1: tid = 0x2d03, 0x0000000100000b9a a.out`main + 42 at main.c:16, stop reason = breakpoint 1.1 frame #0: 0x0000000100000b9a a.out`main + 42 at main.c:16 frame #1: 0x0000000100000b64 a.out`start + 52 Above we created a target for "a.out" and ran and hit a breakpoint at "main". Then we created a new target for /bin/ls and ran it. Then we listed the targest and selected our original "a.out" program, so we showed two concurent debug sessions going on at the same time. llvm-svn: 129695
* Added auto completion for architecture names and for platforms.Greg Clayton2011-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Modified the OptionGroupOptions to be able to specify only some of the options that should be appended by using the usage_mask in the group defintions and also provided a way to remap them to a new usage mask after the copy. This allows options to be re-used and also targetted for specific option groups. Modfied the CommandArgumentType to have a new eArgTypePlatform enumeration. Taught the option parser to be able to automatically use the appropriate auto completion for a given options if nothing is explicitly specified in the option definition. So you don't have to specify it in the option definition tables. Renamed the default host platform name to "host", and the default platform hostname to be "localhost". Modified the "file" and "platform select" commands to make sure all options and args are good prior to creating a new platform. Also defer the computation of the architecture in the file command until all options are parsed and the platform has either not been specified or reset to a new value to avoid computing the arch more than once. Switch the PluginManager code over to using llvm::StringRef for string comparisons and got rid of all the AccessorXXX functions in lieu of the newer mutex + collection singleton accessors. llvm-svn: 129483
* Order of initialization lists.Stephen Wilson2011-04-111-2/+2
| | | | | | | | This patch fixes all of the warnings due to unordered initialization lists. Patch by Marco Minutoli. llvm-svn: 129290
* Fixed the LLDB build so that we can have private types, private enums andGreg Clayton2011-03-242-35/+29
| | | | | | | | public types and public enums. This was done to keep the SWIG stuff from parsing all sorts of enums and types that weren't needed, and allows us to abstract our API better. llvm-svn: 128239
* Fix makefile builds when llvm is configured with -enable-shared.Stephen Wilson2011-03-131-5/+1
| | | | | | | | | | We were dropping the expansion of -rpath=$(LibDir) on linux, which resulted in the build not being able to resolve libLLVM.so. Bring in the definition before expanding the values hanging off LD.Flags. Thanks to Jason E. Aten for reporting this! llvm-svn: 127570
* LLDB now has "Platform" plug-ins. Platform plug-ins are plug-ins that provideGreg Clayton2011-03-081-127/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an interface to a local or remote debugging platform. By default each host OS that supports LLDB should be registering a "default" platform that will be used unless a new platform is selected. Platforms are responsible for things such as: - getting process information by name or by processs ID - finding platform files. This is useful for remote debugging where there is an SDK with files that might already or need to be cached for debug access. - getting a list of platform supported architectures in the exact order they should be selected. This helps the native x86 platform on MacOSX select the correct x86_64/i386 slice from universal binaries. - Connect to remote platforms for remote debugging - Resolving an executable including finding an executable inside platform specific bundles (macosx uses .app bundles that contain files) and also selecting the appropriate slice of universal files for a given platform. So by default there is always a local platform, but remote platforms can be connected to. I will soon be adding a new "platform" command that will support the following commands: (lldb) platform connect --name machine1 macosx connect://host:port Connected to "machine1" platform. (lldb) platform disconnect macosx This allows LLDB to be well setup to do remote debugging and also once connected process listing and finding for things like: (lldb) process attach --name x<TAB> The currently selected platform plug-in can now auto complete any available processes that start with "x". The responsibilities for the platform plug-in will soon grow and expand. llvm-svn: 127286
* Don't limit StreamTee to just two streams. It now can containGreg Clayton2011-02-201-39/+8
| | | | | | | | | | | | | | | | | | | | | | | | | N streams by making the stream a vector of stream shared pointers that is protected by a mutex. Streams can be get/set by index which allows indexes to be defined as stream indentifiers. If a stream is set at index 3 and there are now streams in the collection, then empty stream objects are inserted to ensure that stream at index 3 has a valid stream. There is also an append method that allows a stream to be pushed onto the stack. This will allow our streams to be very flexible in where the output goes. Modified the CommandReturnObject to use the new StreamTee functionality. This class now defines two StreamTee indexes: 0 for the stream string stream, and 1 for the immediate stream. This is used both on the output and error streams. Added the ability to get argument types as strings or as descriptions. This is exported through the SBCommandInterpreter API to allow external access. Modified the Driver class to use the newly exported argument names from SBCommandInterpreter::GetArgumentTypeAsCString(). llvm-svn: 126067
* - Changed all the places where CommandObjectReturn was exporting a ↵Jim Ingham2011-02-191-5/+7
| | | | | | | | | | | | | | | | StreamString to just exporting a Stream, and then added GetOutputData & GetErrorData to get the accumulated data. - Added a StreamTee that will tee output to two provided lldb::StreamSP's. - Made the CommandObjectReturn use this so you can Tee the results immediately to the debuggers output file, as well as saving up the results to return when the command is done executing. - HandleCommands now uses this so that if you have a set of commands that continue the target you will see the commands come out as they are processed. - The Driver now uses this to output the command results as you go, which makes the interface more reactive seeming. llvm-svn: 126015
* Patch that allows for thread_t to be something more complex than anGreg Clayton2011-02-081-3/+3
| | | | | | integer. Modified patch from Kirk Beitz. llvm-svn: 125067
* Applied a fix to qualify "UUID" with the lldb_private namespace to fixGreg Clayton2011-02-041-1/+1
| | | | | | build issues on MinGW. llvm-svn: 124888
* Added support for attaching to a remote debug server with the new command:Greg Clayton2011-02-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (lldb) process connect <remote-url> Currently when you specify a file with the file command it helps us to find a process plug-in that is suitable for debugging. If you specify a file you can rely upon this to find the correct debugger plug-in: % lldb a.out Current executable set to 'a.out' (x86_64). (lldb) process connect connect://localhost:2345 ... If you don't specify a file, you will need to specify the plug-in name that you wish to use: % lldb (lldb) process connect --plugin process.gdb-remote connect://localhost:2345 Other connection URL examples: (lldb) process connect connect://localhost:2345 (lldb) process connect tcp://127.0.0.1 (lldb) process connect file:///dev/ttyS1 We are currently treating the "connect://host:port" as a way to do raw socket connections. If there is a URL for this already, please let me know and we will adopt it. So now you can connect to a remote debug server with the ProcessGDBRemote plug-in. After connection, it will ask for the pid info using the "qC" packet and if it responds with a valid process ID, it will be equivalent to attaching. If it response with an error or invalid process ID, the LLDB process will be in a new state: eStateConnected. This allows us to then download a program or specify the program to run (using the 'A' packet), or specify a process to attach to (using the "vAttach" packets), or query info about the processes that might be available. llvm-svn: 124846
* Adding a Xcode workspace for lldb.Jim Ingham2011-01-271-1/+1
| | | | llvm-svn: 124416
* Any arguments that are not options to the "lldb" command line driver, now get Greg Clayton2010-12-082-31/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | used as the arguments for the inferior program. So for example you can do % lldb /bin/ls /tmp ~/Documents And "lldb" will use "/bin/ls" as the program and send arguments "/tmp" and "~/Documents" as the launch args. If you specify a file, then all remaining args after option parsing will be used for program arguments: % lldb -f /bin/ls /tmp ~/Documents If you need to pass option values to your inferior program, just terminate the "lldb" command line driver options with "--": % lldb -- /bin/ls -AFl /tmp The arguments are placed into the "settings" variable named "target.process.run-args". This allows you to just run the program using "process launch" and, if no args are specified on that command, the "target.process.run-args" values will be used: % lldb -- /bin/ls -AFl /tmp Current executable set to '/bin/ls' (x86_64). (lldb) settings show target.process.run-args target.process.run-args (array): [0]: '-AFl' [1]: '/tmp' (lldb) (lldb) r Process 56753 launched: '/bin/ls' (x86_64) lrwxr-xr-x@ 1 root wheel 11 Nov 19 2009 /tmp@ -> private/tmp llvm-svn: 121295
* More reverting of the EOF stuff as the API was changed which we don't want toGreg Clayton2010-12-041-1/+2
| | | | | | | | | | do. Closing on EOF is an option that can be set on the lldb_private::Communication or the lldb::SBCommunication objects after they are created. Of course the EOF support isn't hooked up, so they don't do anything at the moment, but they are left in so when the code is fixed, it will be easy to get working again. llvm-svn: 120885
* Add proper EOF handling to Communication & Connection classes:Caroline Tice2010-12-021-1/+1
| | | | | | | | | | Add bool member to Communication class indicating whether the Connection should be closed on receiving an EOF or not. Update the Connection read to return an EOF status when appropriate. Modify the Communication class to pass the EOF along or not, and to close the Connection or not, as appropriate. llvm-svn: 120723
* Add the ability to catch and do the right thing with Interrupts (often ↵Caroline Tice2010-11-192-5/+45
| | | | | | | | control-c) and end-of-file (often control-d). llvm-svn: 119837
* Modified the DWARF parser for both the single DWARF file and for the caseGreg Clayton2010-11-071-1/+1
| | | | | | | | | | | where the DWARF is in the .o files so they can track down the actual type for a forward declaration. This was working before for just DWARF files, but not for DWARF in .o files where the actual definition was in another .o file. Modified the main thread name in the driver to be more consistent with the other LLDB thread names. llvm-svn: 118383
* Stop the driver from handling SIGPIPE in case we communicate with stale Greg Clayton2010-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | sockets so the driver doesn't just crash. Added support for connecting to named sockets (unix IPC sockets) in ConnectionFileDescriptor. Modified the Host::LaunchInNewTerminal() for MacOSX to return the process ID of the inferior process instead of the process ID of the Terminal.app. This was done by modifying the "darwin-debug" executable to connect to lldb through a named unix socket which is passed down as an argument. This allows a quick handshake between "lldb" and "darwin-debug" so we can get the process ID of the inferior and then attach by process ID and avoid attaching to the inferior by process name since there could be more than one process with that name. This still has possible race conditions, those will be fixed in the near future. This fixes the SIGPIPE issues that were sometimes being seen when task_for_pid was failing. llvm-svn: 116792
* Fix some memory leaks.Caroline Tice2010-10-121-11/+20
| | | | | | | Add call to lldb.SBDebugger.Initialize() to lldb.py, so it automatically gets called when the lldb Python module gets loaded. llvm-svn: 116345
* Exit if the command line is started with "--help".Greg Clayton2010-10-111-0/+1
| | | | llvm-svn: 116180
* Added a "--no-lldbinit" option (-n for short (which magically matchesGreg Clayton2010-10-111-1/+9
| | | | | | | what gdb uses)) so we can tell our "lldb" driver program to not automatically parse any .lldbinit files. llvm-svn: 116179
* Modify command options to use the new arguments mechanism. Now all command ↵Caroline Tice2010-10-011-18/+54
| | | | | | | | | | | 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
* Fix various timing/threading problems in IOChannel & Driver thatCaroline Tice2010-09-294-14/+201
| | | | | | were causing the prompt to be stomped on, mangled or omitted occasionally. llvm-svn: 115059
* Fixed the way set/show variables were being accessed to being natively Greg Clayton2010-09-181-6/+1
| | | | | | | | | | | | | | | | | | 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
* If the file the user specifies can't be found in the current directory,Caroline Tice2010-09-101-0/+15
| | | | | | | and the user didn't specify a particular directory, search for the file using the $PATH environment variable. llvm-svn: 113575
* Make API calls for setting/getting user settable variables static.Caroline Tice2010-09-091-0/+23
| | | | | | | Modify Driver to handle SIGWINCH signals and automatically re-set the term-width variable. llvm-svn: 113506
* Fixed a buffer overrun error that could occur every time the program was run ↵Greg Clayton2010-09-061-2/+2
| | | | | | due to a "sprintf" with a destination string that was too short. llvm-svn: 113180
* Fixed an error where a random string would get executed after a recent fix ↵Greg Clayton2010-09-061-1/+3
| | | | | | that checked if the window column size was zero was added on the lldb driver startup. llvm-svn: 113179
* This is a very large commit that completely re-does the way lldbCaroline Tice2010-09-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | handles user settable internal variables (the equivalent of set/show variables in gdb). In addition to the basic infrastructure (most of which is defined in UserSettingsController.{h,cpp}, there are examples of two classes that have been set up to contain user settable variables (the Debugger and Process classes). The 'settings' command has been modified to be a command-subcommand structure, and the 'set', 'show' and 'append' commands have been moved into this sub-commabnd structure. The old StateVariable class has been completely replaced by this, and the state variable dictionary has been removed from the Command Interpreter. Places that formerly accessed the state variable mechanism have been modified to access the variables in this new structure instead (checking the term-width; getting/checking the prompt; etc.) Variables are attached to classes; there are two basic "flavors" of variables that can be set: "global" variables (static/class-wide), and "instance" variables (one per instance of the class). The whole thing has been set up so that any global or instance variable can be set at any time (e.g. on start up, in your .lldbinit file), whether or not any instances actually exist (there's a whole pending and default values mechanism to help deal with that). llvm-svn: 113041
* Move "variable list" to "frame variable"Jim Ingham2010-09-021-1/+1
| | | | llvm-svn: 112782
* Added a way to open the current source file & line in an external editor, ↵Jim Ingham2010-08-302-2/+13
| | | | | | | | and you can turn this on with: lldb -e llvm-svn: 112502
* o Exposed SBFileSpec to the Python APIs in lldb.py.Johnny Chen2010-08-271-2/+2
| | | | | | | | | | | o Fixed a crasher when getting it via SBTarget.GetExecutable(). >>> filespec = target.GetExecutable() Segmentation fault o And renamed SBFileSpec::GetFileName() to GetFilename() to be consistent with FileSpec::GetFilename(). llvm-svn: 112308
* Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to ↵Jim Ingham2010-08-262-12/+12
| | | | | | "Selected" i.e. GetSelectedThread. Selected makes more sense, since these are set by some user action (a selection). I didn't change "CurrentProcess" since this is always controlled by the target, and a given target can only have one process, so it really can't be selected. llvm-svn: 112221
* The unix "source" command maps to "command source" in lldb. :-)Johnny Chen2010-07-281-1/+1
| | | | llvm-svn: 109673
* I enabled some extra warnings for hidden local variables and for hiddenGreg Clayton2010-07-142-3/+3
| | | | | | virtual functions and caught some things and did some general code cleanup. llvm-svn: 108299
* Patch from Jean-Daniel Dupas:Greg Clayton2010-07-121-1/+1
| | | | | | | | | Makefile patch to explicitly use PROJ_SRC_DIR when required. It fixes build when obj dir is not source dir. I also fixed a build warning in ClangResultSynthesizer.cpp. llvm-svn: 108210
* Misc warning fixes.Eli Friedman2010-07-091-1/+1
| | | | llvm-svn: 108029
* Make current Makefiles work on Linux (at least, they work for me). PleaseEli Friedman2010-07-091-0/+4
| | | | | | tell me if this breaks anything. llvm-svn: 108025
* Merged Eli Friedman's linux build changes where he added Makefile files thatGreg Clayton2010-07-094-41/+67
| | | | | | | enabled LLVM make style building and made this compile LLDB on Mac OS X. We can now iterate on this to make the build work on both linux and macosx. llvm-svn: 108009
OpenPOWER on IntegriCloud