#
b5964212 |
| 02-Jun-2011 |
Johnny Chen <johnny.chen@apple.com> |
Add comment about Thread::GetStatus(), which returns the number of frames shown.
llvm-svn: 132470
|
#
f2ddc713 |
| 01-Jun-2011 |
Johnny Chen <johnny.chen@apple.com> |
The 'thread backtrace all' logical branch had the if (thread->GetStatus()) condition inverted.
rdar://problem/9530511
llvm-svn: 132435
|
#
9b70ddb3 |
| 08-May-2011 |
Jim Ingham <jingham@apple.com> |
StepUntil should check whether the target of the step until is in the current function and if not return an error.
llvm-svn: 131061
|
#
effe5c95 |
| 03-May-2011 |
Greg Clayton <gclayton@apple.com> |
Added new OptionGroup classes for UInt64, UUID, File and Boolean values.
Removed the "image" command and moved it to "target modules". Added an alias for "image" to "target modules".
Added some ne
Added new OptionGroup classes for UInt64, UUID, File and Boolean values.
Removed the "image" command and moved it to "target modules". Added an alias for "image" to "target modules".
Added some new target commands to be able to add and load modules to a target: (lldb) target modules add <path> (lldb) target modules load [--file <path>] [--slide <offset>] [<sect-name> <sect-load-addr> ...]
So you can load individual sections without running a target:
(lldb) target modules load --file /usr/lib/libSystem.B.dylib __TEXT 0x7fccc80000 __DATA 0x1234000000
Or you can rigidly slide an entire shared library:
(lldb) target modules load --file /usr/lib/libSystem.B.dylib --slid 0x7fccc80000
This should improve bare board debugging when symbol files need to be slid around manually.
llvm-svn: 130796
show more ...
|
#
7260f620 |
| 18-Apr-2011 |
Greg Clayton <gclayton@apple.com> |
Centralized a lot of the status information for processes, threads, and stack frame down in the lldb_private::Process, lldb_private::Thread, lldb_private::StackFrameList and the lldb_private::StackF
Centralized a lot of the status information for processes, 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
show more ...
|
#
f6b8b581 |
| 13-Apr-2011 |
Greg Clayton <gclayton@apple.com> |
Added two new classes for command options:
lldb_private::OptionGroup lldb_private::OptionGroupOptions
OptionGroup lets you define a class that encapsulates settings that you want to reuse i
Added two new classes for command options:
lldb_private::OptionGroup lldb_private::OptionGroupOptions
OptionGroup lets you define a class that encapsulates settings that you want to reuse in multiple commands. It contains only the option definitions and the ability to set the option values, but it doesn't directly interface with the lldb_private::Options class that is the front end to all of the CommandObject option parsing. For that the OptionGroupOptions class can be used. It aggregates one or more OptionGroup objects and directs the option setting to the appropriate OptionGroup class. For an example of this, take a look at the CommandObjectFile and how it uses its "m_option_group" object shown below to be able to set values in both the FileOptionGroup and PlatformOptionGroup classes. The members used in CommandObjectFile are:
OptionGroupOptions m_option_group; FileOptionGroup m_file_options; PlatformOptionGroup m_platform_options;
Then in the constructor for CommandObjectFile you can combine the option settings. The code below shows a simplified version of the constructor:
CommandObjectFile::CommandObjectFile(CommandInterpreter &interpreter) : CommandObject (...), m_option_group (interpreter), m_file_options (), m_platform_options(true) { m_option_group.Append (&m_file_options); m_option_group.Append (&m_platform_options); m_option_group.Finalize(); }
We append the m_file_options and then the m_platform_options and then tell the option group the finalize the results. This allows the m_option_group to become the organizer of our prefs and after option parsing we end up with valid preference settings in both the m_file_options and m_platform_options objects. This also allows any other commands to use the FileOptionGroup and PlatformOptionGroup classes to implement options for their commands.
Renamed: virtual void Options::ResetOptionValues(); to: virtual void Options::OptionParsingStarting();
And implemented a new callback named:
virtual Error Options::OptionParsingFinished(); This allows Options subclasses to verify that the options all go together after all of the options have been specified and gives the chance for the command object to return an error. It also gives a chance to take all of the option values and produce or initialize objects after all options have completed parsing.
Modfied:
virtual Error SetOptionValue (int option_idx, const char *option_arg) = 0; to be:
virtual Error SetOptionValue (uint32_t option_idx, const char *option_arg) = 0;
(option_idx is now unsigned).
llvm-svn: 129415
show more ...
|
#
8b82f087 |
| 12-Apr-2011 |
Greg Clayton <gclayton@apple.com> |
Moved the execution context that was in the Debugger into the CommandInterpreter where it was always being used.
Make sure that Modules can track their object file offsets correctly to allow opening
Moved the execution context that was in the Debugger into the CommandInterpreter where it was always being used.
Make sure that Modules can track their object file offsets correctly to allow opening of sub object files (like the "__commpage" on darwin).
Modified the Platforms to be able to launch processes. The first part of this move is the platform soon will become the entity that launches your program and when it does, it uses a new ProcessLaunchInfo class which encapsulates all process launching settings. This simplifies the internal APIs needed for launching. I want to slowly phase out process launching from the process classes, so for now we can still launch just as we used to, but eventually the platform is the object that should do the launching.
Modified the Host::LaunchProcess in the MacOSX Host.mm to correctly be able to launch processes with all of the new eLaunchFlag settings. Modified any code that was manually launching processes to use the Host::LaunchProcess functions.
Fixed an issue where lldb_private::Args had implicitly defined copy constructors that could do the wrong thing. This has now been fixed by adding an appropriate copy constructor and assignment operator.
Make sure we don't add empty ModuleSP entries to a module list.
Fixed the commpage module creation on MacOSX, but we still need to train the MacOSX dynamic loader to not get rid of it when it doesn't have an entry in the all image infos.
Abstracted many more calls from in ProcessGDBRemote down into the GDBRemoteCommunicationClient subclass to make the classes cleaner and more efficient.
Fixed the default iOS ARM register context to be correct and also added support for targets that don't support the qThreadStopInfo packet by selecting the current thread (only if needed) and then sending a stop reply packet.
Debugserver can now start up with a --unix-socket (-u for short) and can then bind to port zero and send the port it bound to to a listening process on the other end. This allows the GDB remote platform to spawn new GDB server instances (debugserver) to allow platform debugging.
llvm-svn: 129351
show more ...
|
#
eb0103f2 |
| 07-Apr-2011 |
Greg Clayton <gclayton@apple.com> |
Modified the ArchSpec to take an optional "Platform *" when setting the triple. This allows you to have a platform selected, then specify a triple using "i386" and have the remaining triple items (ve
Modified the ArchSpec to take an optional "Platform *" when setting the triple. This allows you to have a platform selected, then specify a triple using "i386" and have the remaining triple items (vendor, os, and environment) set automatically.
Many interpreter commands take the "--arch" option to specify an architecture triple, so now the command options needed to be able to get to the current platform, so the Options class now take a reference to the interpreter on construction.
Modified the build LLVM building in the Xcode project to use the new Xcode project level user definitions:
LLVM_BUILD_DIR - a path to the llvm build directory LLVM_SOURCE_DIR - a path to the llvm sources for the llvm that will be used to build lldb LLVM_CONFIGURATION - the configuration that lldb is built for (Release, Release+Asserts, Debug, Debug+Asserts).
I also changed the LLVM build to not check if "lldb/llvm" is a symlink and then assume it is a real llvm build directory versus the unzipped llvm.zip package, so now you can actually have a "lldb/llvm" directory in your lldb sources.
llvm-svn: 129112
show more ...
|
Revision tags: llvmorg-2.9.0 |
|
#
32e0a750 |
| 30-Mar-2011 |
Greg Clayton <gclayton@apple.com> |
Many improvements to the Platform base class and subclasses. The base Platform class now implements the Host functionality for a lot of things that make sense by default so that subclasses can check
Many improvements to the Platform base class and subclasses. The base Platform class now implements the Host functionality for a lot of things that make sense by default so that subclasses can check:
int PlatformSubclass::Foo () { if (IsHost()) return Platform::Foo (); // Let the platform base class do the host specific stuff // Platform subclass specific code... int result = ... return result; }
Added new functions to the platform:
virtual const char *Platform::GetUserName (uint32_t uid); virtual const char *Platform::GetGroupName (uint32_t gid);
The user and group names are cached locally so that remote platforms can avoid sending packets multiple times to resolve this information.
Added the parent process ID to the ProcessInfo class.
Added a new ProcessInfoMatch class which helps us to match processes up and changed the Host layer over to using this new class. The new class allows us to search for processs: 1 - by name (equal to, starts with, ends with, contains, and regex) 2 - by pid 3 - And further check for parent pid == value, uid == value, gid == value, euid == value, egid == value, arch == value, parent == value. This is all hookup up to the "platform process list" command which required adding dumping routines to dump process information. If the Host class implements the process lookup routines, you can now lists processes on your local machine:
machine1.foo.com % lldb (lldb) platform process list PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME ====== ====== ========== ========== ========== ========== ======================== ============================ 99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge 94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker 94852 244 username usergroup username usergroup x86_64-apple-darwin Safari 94727 244 username usergroup username usergroup x86_64-apple-darwin Xcode 92742 92710 username usergroup username usergroup i386-apple-darwin debugserver
This of course also works remotely with the lldb-platform:
machine1.foo.com % lldb-platform --listen 1234
machine2.foo.com % lldb (lldb) platform create remote-macosx Platform: remote-macosx Connected: no (lldb) platform connect connect://localhost:1444 Platform: remote-macosx Triple: x86_64-apple-darwin OS Version: 10.6.7 (10J869) Kernel: Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 Hostname: machine1.foo.com Connected: yes (lldb) platform process list PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME ====== ====== ========== ========== ========== ========== ======================== ============================ 99556 244 username usergroup username usergroup x86_64-apple-darwin trustevaluation 99548 65539 username usergroup username usergroup x86_64-apple-darwin lldb 99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge 94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker 94852 244 username usergroup username usergroup x86_64-apple-darwin Safari
The lldb-platform implements everything with the Host:: layer, so this should "just work" for linux. I will probably be adding more stuff to the Host layer for launching processes and attaching to processes so that this support should eventually just work as well.
Modified the target to be able to be created with an architecture that differs from the main executable. This is needed for iOS debugging since we can have an "armv6" binary which can run on an "armv7" machine, so we want to be able to do:
% lldb (lldb) platform create remote-ios (lldb) file --arch armv7 a.out
Where "a.out" is an armv6 executable. The platform then can correctly decide to open all "armv7" images for all dependent shared libraries.
Modified the disassembly to show the current PC value. Example output:
(lldb) disassemble --frame a.out`main: 0x1eb7: pushl %ebp 0x1eb8: movl %esp, %ebp 0x1eba: pushl %ebx 0x1ebb: subl $20, %esp 0x1ebe: calll 0x1ec3 ; main + 12 at test.c:18 0x1ec3: popl %ebx -> 0x1ec4: calll 0x1f12 ; getpid 0x1ec9: movl %eax, 4(%esp) 0x1ecd: leal 199(%ebx), %eax 0x1ed3: movl %eax, (%esp) 0x1ed6: calll 0x1f18 ; printf 0x1edb: leal 213(%ebx), %eax 0x1ee1: movl %eax, (%esp) 0x1ee4: calll 0x1f1e ; puts 0x1ee9: calll 0x1f0c ; getchar 0x1eee: movl $20, (%esp) 0x1ef5: calll 0x1e6a ; sleep_loop at test.c:6 0x1efa: movl $12, %eax 0x1eff: addl $20, %esp 0x1f02: popl %ebx 0x1f03: leave 0x1f04: ret This can be handy when dealing with the new --line options that was recently added:
(lldb) disassemble --line a.out`main + 13 at test.c:19 18 { -> 19 printf("Process: %i\n\n", getpid()); 20 puts("Press any key to continue..."); getchar(); -> 0x1ec4: calll 0x1f12 ; getpid 0x1ec9: movl %eax, 4(%esp) 0x1ecd: leal 199(%ebx), %eax 0x1ed3: movl %eax, (%esp) 0x1ed6: calll 0x1f18 ; printf
Modified the ModuleList to have a lookup based solely on a UUID. Since the UUID is typically the MD5 checksum of a binary image, there is no need to give the path and architecture when searching for a pre-existing image in an image list.
Now that we support remote debugging a bit better, our lldb_private::Module needs to be able to track what the original path for file was as the platform knows it, as well as where the file is locally. The module has the two following functions to retrieve both paths:
const FileSpec &Module::GetFileSpec () const; const FileSpec &Module::GetPlatformFileSpec () const;
llvm-svn: 128563
show more ...
|
Revision tags: llvmorg-2.9.0-rc3, llvmorg-2.9.0-rc2 |
|
#
e0d378b3 |
| 24-Mar-2011 |
Greg Clayton <gclayton@apple.com> |
Fixed the LLDB build so that we can have private types, private enums and public types and public enums. This was done to keep the SWIG stuff from parsing all sorts of enums and types that weren't ne
Fixed the LLDB build so that we can have private types, private enums and 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
show more ...
|
Revision tags: llvmorg-2.9.0-rc1 |
|
#
85e8b814 |
| 19-Feb-2011 |
Jim Ingham <jingham@apple.com> |
- Changed all the places where CommandObjectReturn was exporting a StreamString to just exporting a Stream, and then added GetOutputData & GetErrorData to get the accumulated data. - Added a StreamTe
- Changed all the places where CommandObjectReturn was exporting a 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
show more ...
|
#
7fb56d0a |
| 01-Feb-2011 |
Greg Clayton <gclayton@apple.com> |
Endian patch from Kirk Beitz that allows better cross platform building.
llvm-svn: 124643
|
#
481cef25 |
| 21-Jan-2011 |
Greg Clayton <gclayton@apple.com> |
Added support for stepping out of a frame. If you have 10 stack frames, and you select frame #3, you can then do a step out and be able to go directly to the frame above frame #3!
Added StepOverUn
Added support for stepping out of a frame. If you have 10 stack frames, and you select frame #3, you can then do a step out and be able to go directly to the frame above frame #3!
Added StepOverUntil and StepOutOfFrame to the SBThread API to allow more powerful stepping.
llvm-svn: 123970
show more ...
|
#
19388cfc |
| 18-Oct-2010 |
Greg Clayton <gclayton@apple.com> |
Fixed debugserver to properly attach to a process by name with the "vAttachName;<PROCNAME>" packet, and wait for a new process by name to launch with the "vAttachWait;<PROCNAME>".
Fixed a few issu
Fixed debugserver to properly attach to a process by name with the "vAttachName;<PROCNAME>" packet, and wait for a new process by name to launch with the "vAttachWait;<PROCNAME>".
Fixed a few issues with attaching where if DoAttach() returned no error, yet there was no valid process ID, we would deadlock waiting for an event that would never happen.
Added a new "process launch" option "--tty" that will launch the process in a new terminal if the Host layer supports the "Host::LaunchInNewTerminal(...)" function. This currently works on MacOSX and will allow the debugging of terminal applications that do complex operations with the terminal.
Cleaned up the output when the process resumes, stops and halts to be consistent with the output format.
llvm-svn: 116693
show more ...
|
#
8087ca21 |
| 08-Oct-2010 |
Greg Clayton <gclayton@apple.com> |
Added mutex protection to the Symtab class.
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 addres
Added mutex protection to the Symtab class.
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
show more ...
|
Revision tags: llvmorg-2.8.0 |
|
#
405fe67f |
| 04-Oct-2010 |
Caroline Tice <ctice@apple.com> |
Modify existing commands with arguments to use the new argument mechanism (for standardized argument names, argument help, etc.)
llvm-svn: 115570
|
#
0603aa9d |
| 04-Oct-2010 |
Greg Clayton <gclayton@apple.com> |
There are now to new "settings set" variables that live in each debugger instance:
settings set frame-format <string> settings set thread-format <string>
This allows users to control the informatio
There are now to new "settings set" variables that live in each debugger 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
show more ...
|
#
deaab222 |
| 01-Oct-2010 |
Caroline Tice <ctice@apple.com> |
Modify command options to use the new arguments mechanism. Now all command option arguments are specified in a standardized way, will have a standardized name, and have functioning help.
The next s
Modify command options to use the new arguments mechanism. Now all command 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
show more ...
|
Revision tags: llvmorg-2.8.0-rc3 |
|
#
daccaa9e |
| 20-Sep-2010 |
Caroline Tice <ctice@apple.com> |
Add UserSettings to Target class, making Target settings the parent of Process settings; add 'default-arch' as a class-wide setting for Target. Replace lldb::GetDefaultArchitecture wi
Add UserSettings to Target class, making Target settings 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
show more ...
|
Revision tags: llvmorg-2.8.0-rc2 |
|
#
f5fb427d |
| 18-Sep-2010 |
Greg Clayton <gclayton@apple.com> |
Fixed an issue with:
(lldb) frame variable --location
Where the address of variables wasn't being formatted consistently.
llvm-svn: 114266
|
#
ed8a705c |
| 18-Sep-2010 |
Greg Clayton <gclayton@apple.com> |
General command line help cleanup: - 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
General command line help cleanup: - 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
show more ...
|
#
a7015092 |
| 18-Sep-2010 |
Greg Clayton <gclayton@apple.com> |
Fixed the way set/show variables were being accessed to being natively accessed by the objects that own the settings. The previous approach wasn't very usable and made for a lot of unnecessary code
Fixed the way set/show variables were being accessed to being natively 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
show more ...
|
#
f5e56de0 |
| 14-Sep-2010 |
Greg Clayton <gclayton@apple.com> |
Moved the section load list up into the target so we can use the target to symbolicate things without the need for a valid process subclass.
llvm-svn: 113895
|
#
c13ee52c |
| 14-Sep-2010 |
Johnny Chen <johnny.chen@apple.com> |
Fixed an error in Debugger::UpdateExecutionContext() where an invalid index ID 0 was used to set the selected thread if none was selected. Use a more robust API to accomplish the task.
Also fixed a
Fixed an error in Debugger::UpdateExecutionContext() where an invalid index ID 0 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
show more ...
|
#
09799af6 |
| 08-Sep-2010 |
Caroline Tice <ctice@apple.com> |
More help text fixes.
llvm-svn: 113421
|