#
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 ...
|
#
ded470d3 |
| 19-Mar-2011 |
Greg Clayton <gclayton@apple.com> |
Added more platform support. There are now some new commands:
platform status -- gets status information for the selected platform platform create <platform-name> -- creates a new instance of a remo
Added more platform support. There are now some new commands:
platform status -- gets status information for the selected platform platform create <platform-name> -- creates a new instance of a remote platform platform list -- list all available platforms platform select -- select a platform instance as the current platform (not working yet)
When using "platform create" it will create a remote platform and make it the selected platform. For instances for iPhone OS debugging on Mac OS X one can do:
(lldb) platform create remote-ios --sdk-version=4.0 Remote platform: iOS platform SDK version: 4.0 SDK path: "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0" Not connected to a remote device. (lldb) file ~/Documents/a.out Current executable set to '~/Documents/a.out' (armv6). (lldb) image list [ 0] /Volumes/work/gclayton/Documents/devb/attach/a.out [ 1] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/dyld [ 2] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/libSystem.B.dylib
Note that this is all happening prior to running _or_ connecting to a remote platform. Once connected to a remote platform the OS version might change which means we will need to update our dependecies. Also once we run, we will need to match up the actualy binaries with the actualy UUID's to files in the SDK, or download and cache them locally.
This is just the start of the remote platforms, but this modification is the first iteration in getting the platforms really doing something.
llvm-svn: 127934
show more ...
|
Revision tags: llvmorg-2.9.0-rc1 |
|
#
7fb56d0a |
| 01-Feb-2011 |
Greg Clayton <gclayton@apple.com> |
Endian patch from Kirk Beitz that allows better cross platform building.
llvm-svn: 124643
|
#
1a65ae11 |
| 25-Jan-2011 |
Greg Clayton <gclayton@apple.com> |
Enabled extra warnings and fixed a bunch of small issues.
llvm-svn: 124250
|
#
6d5e68ea |
| 20-Jan-2011 |
Greg Clayton <gclayton@apple.com> |
Added the ability to StackFrame::GetValueForVariableExpressionPath(...) to avoid fragile ivars if requested. This was done by changing the previous second parameter to an options bitfield that can be
Added the ability to StackFrame::GetValueForVariableExpressionPath(...) to avoid fragile ivars if requested. This was done by changing the previous second parameter to an options bitfield that can be populated by logical OR'ing the new StackFrame::ExpressionPathOption enum values together:
typedef enum ExpressionPathOption { eExpressionPathOptionCheckPtrVsMember = (1u << 0), eExpressionPathOptionsNoFragileObjcIvar = (1u << 1), };
So the old function was: lldb::ValueObjectSP StackFrame::GetValueForVariableExpressionPath (const char *var_expr, bool check_ptr_vs_member, Error &error);
But it is now:
lldb::ValueObjectSP StackFrame::GetValueForVariableExpressionPath (const char *var_expr, uint32_t options, Error &error);
This allows the expression parser in Target::EvaluateExpression(...) to avoid using simple frame variable expression paths when evaluating something that might be a fragile ivar.
llvm-svn: 123938
show more ...
|
#
ff471a94 |
| 23-Dec-2010 |
Jim Ingham <jingham@apple.com> |
"frame variable" requires that the process be running and paused or there aren't any frames... So mark the command properly as such.
llvm-svn: 122464
|
#
54979cdd |
| 15-Dec-2010 |
Greg Clayton <gclayton@apple.com> |
Fixed the "expression" command object to use the StackFrame::GetValueForExpressionPath() function and also hooked up better error reporting for when things fail.
Fixed issues with trying to display
Fixed the "expression" command object to use the StackFrame::GetValueForExpressionPath() function and also hooked up better error reporting for when things fail.
Fixed issues with trying to display children of pointers when none are supposed to be shown (no children for function pointers, and more like this). This was causing child value objects to be made that were correctly firing an assertion.
llvm-svn: 121841
show more ...
|
#
ce5c9a8f |
| 15-Nov-2010 |
Greg Clayton <gclayton@apple.com> |
Added the address of operator for the "frame variable" command.
llvm-svn: 119100
|
#
83c5cd9d |
| 14-Nov-2010 |
Greg Clayton <gclayton@apple.com> |
Just like functions can have a basename and a mangled/demangled name, variable can too. So now the lldb_private::Variable class has support for this.
Variables now have support for having a basename
Just like functions can have a basename and a mangled/demangled name, variable can too. So now the lldb_private::Variable class has support for this.
Variables now have support for having a basename ("i"), and a mangled name ("_ZN12_GLOBAL__N_11iE"), and a demangled name ("(anonymous namespace)::i").
Nowwhen searching for a variable by name, users might enter the fully qualified name, or just the basename. So new test functions were added to the Variable and Mangled classes as:
bool NameMatches (const ConstString &name); bool NameMatches (const RegularExpression ®ex);
I also modified "ClangExpressionDeclMap::FindVariableInScope" to also search for global variables that are not in the current file scope by first starting with the current module, then moving on to all modules.
Fixed an issue in the DWARF parser that could cause a varaible to get parsed more than once. Now, once we have parsed a VariableSP for a DIE, we cache the result even if a variable wasn't made so we don't do any re-parsing. Some DW_TAG_variable DIEs don't have locations, or are missing vital info that stops a debugger from being able to display anything for it, we parse a NULL variable shared pointer for these DIEs so we don't keep trying to reparse it.
llvm-svn: 119085
show more ...
|
#
2c88643a |
| 10-Nov-2010 |
Benjamin Kramer <benny.kra@googlemail.com> |
Silence a bunch of clang warnings.
llvm-svn: 118710
|
#
bcf1217e |
| 28-Oct-2010 |
Greg Clayton <gclayton@apple.com> |
Fixed the "frame variable -G NAME" that would print global variables by name. It was accidentally getting all the globals for the compile unit that contained the global variable named NAME.
llvm-svn
Fixed the "frame variable -G NAME" that would print global variables by name. It was accidentally getting all the globals for the compile unit that contained the global variable named NAME.
llvm-svn: 117516
show more ...
|
#
8c0142fd |
| 25-Oct-2010 |
Johnny Chen <johnny.chen@apple.com> |
Add an extra SPC character after '.' for the 'frame variable' help text.
llvm-svn: 117330
|
#
8f92f0a3 |
| 14-Oct-2010 |
Greg Clayton <gclayton@apple.com> |
Fixed an expression parsing issue where if you were stopped somewhere without debug information and you evaluated an expression, a crash would occur as a result of an unchecked pointer.
Added the ab
Fixed an expression parsing issue where if you were stopped somewhere without debug information and you evaluated an expression, a crash would occur as a result of an unchecked pointer.
Added the ability to get the expression path for a ValueObject. For a rectangle point child "x" the expression path would be something like: "rect.top_left.x". This will allow GUI and command lines to get ahold of the expression path for a value object without having to explicitly know about the hierarchy. This means the ValueObject base class now has a "ValueObject *m_parent;" member. All ValueObject subclasses now correctly track their lineage and are able to provide value expression paths as well.
Added a new "--flat" option to the "frame variable" to allow for flat variable output. An example of the current and new outputs:
(lldb) frame variable argc = 1 argv = 0x00007fff5fbffe80 pt = { x = 2 y = 3 } rect = { bottom_left = { x = 1 y = 2 } top_right = { x = 3 y = 4 } } (lldb) frame variable --flat argc = 1 argv = 0x00007fff5fbffe80 pt.x = 2 pt.y = 3 rect.bottom_left.x = 1 rect.bottom_left.y = 2 rect.top_right.x = 3 rect.top_right.y = 4
As you can see when there is a lot of hierarchy it can help flatten things out. Also if you want to use a member in an expression, you can copy the text from the "--flat" output and not have to piece it together manually. This can help when you want to use parts of the STL in expressions:
(lldb) frame variable --flat argc = 1 argv = 0x00007fff5fbffea8 hello_world._M_dataplus._M_p = 0x0000000000000000 (lldb) expr hello_world._M_dataplus._M_p[0] == '\0'
llvm-svn: 116532
show more ...
|
#
b6e8cf96 |
| 13-Oct-2010 |
Greg Clayton <gclayton@apple.com> |
Default "frame variable" to not show types before values by default. You now enable type display with --show-types or -t (instead of disabling it with --no-types or -t).
llvm-svn: 116418
|
#
46747022 |
| 10-Oct-2010 |
Greg Clayton <gclayton@apple.com> |
Added the ability to get error strings back from failed lldb_private::RegularExpression compiles and matches with:
size_t RegularExpression::GetErrorAsCString (char *err_str,
Added the ability to get error strings back from failed 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
show more ...
|
#
864174e1 |
| 10-Oct-2010 |
Greg Clayton <gclayton@apple.com> |
Added a new test case to test signals with.
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 fra
Added a new test case to test signals with.
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
show more ...
|
Revision tags: llvmorg-2.8.0 |
|
#
1d3afba3 |
| 05-Oct-2010 |
Greg Clayton <gclayton@apple.com> |
Added a new ValueObject type that will be used to freeze dry expression results. The clang opaque type for the expression result will be added to the Target's ASTContext, and the bytes will be stored
Added a new ValueObject type that will be used to freeze dry expression 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
show more ...
|
#
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 |
|
#
1be10fca |
| 29-Sep-2010 |
Greg Clayton <gclayton@apple.com> |
Fixed the forward declaration issue that was present in the DWARF parser after adding methods to C++ and objective C classes. In order to make methods, we need the function prototype which means we n
Fixed the forward declaration issue that was present in the DWARF parser after 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
show more ...
|
#
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 |
|
#
340b2baa |
| 18-Sep-2010 |
Greg Clayton <gclayton@apple.com> |
Added a better error message to the "frame variable" when you try to view frame variables and are not stopped in a valid frame.
llvm-svn: 114267
|
#
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
|