Added SBTarget::EvaluateExpression() so expressions can be evaluated without needing a process.
Also fixed many functions that deal with clang AST types to be able to properly handle the clang::Type::Elaborated types ("struct foo", "class bar").
llvm-svn: 171476
migration in r171366.
I don't know anything about lldb, but a force run of the build bot indicated it
would need this patch. I'll try to watch the build bot to get it green.
llvm-svn: 171374
The results from Clang name lookups changed to
be ArrayRefs, so I had to change the way we
check for the presence of a result and the way
we iterate across results.
llvm-svn: 170927
Not all of the expected instructions were being generated for the function being disassembled on x86-64-based Linux. It had no push, pop or leave.
llvm-svn: 170818
When looking for the Python script to load for a given module, replace dots with underscores if there are any after stripping the extension
This means that for a module named foo.devel.xyz a file named foo_devel.py will be what we try to load
llvm-svn: 170633
Note that the test actually fails before reaching the assertion described in that bug, but the failure is a trivial matter of adding OS-conditional expected stop reason strings (as noted by new comments in this patch). However, with the stop reason strings changed, the test fails for the more substantial reason noted in bugzilla 14662.
llvm-svn: 170619
Implement the ability for Python commands to be interrupted by pressing CTRL+C
Also add a new Mutex subclass that attempts to be helpful for debugging by logging actions performed on it
FYI of all interested - there is a separate deadlocking issue related to how LLDB dispatches CTRL+C that might cause LLDB to deadlock upon pressing CTRL+C while in a Python command.
This is not a regression, and was just previously masked by us not even trying to bail out of Python commands, so that it would not be clear from a user perspective whether we were
deadlocked or stuck in an inconsistent state within the Python interpreter.
llvm-svn: 170612
for reporting class types from Objective-C runtime
class symbols. Instead, LLDB now queries the
Objective-C runtime for class types.
We have also added a (minimal) Objective-C runtime
type vendor for Objective-C runtime version 1, to
prevent regressions when calling class methods in
the V1 runtime.
Other components of this fix include:
- We search the Objective-C runtime in a few more
places.
- We enable enumeration of all members of
Objective-C classes, which Clang does in certain
circumstances.
- SBTarget::FindFirstType and SBTarget::FindTypes
now query the Objective-C runtime as needed.
- I fixed several test cases.
<rdar://problem/12885034>
llvm-svn: 170601
Update the debugserver "qProcessInfo" implementation to return the
cpu type, cpu subtype, OS and vendor information just like qHostInfo
does so lldb can create an ArchSpec based on the returned values.
Add a new GetProcessArchitecture to GDBRemoteCommunicationClient akin
to GetHostArchitecture. If the qProcessInfo packet is supported,
GetProcessArchitecture will return the cpu type / subtype of the
process -- e.g. a 32-bit user process running on a 64-bit x86_64 Mac
system.
Have ProcessGDBRemote set the Target's architecture based on the
GetProcessArchitecture when we've completed an attach/launch/connect.
llvm-svn: 170491
This can be used by lldb to ask for information
about the process debugserver is attached to/launched.
Particularly useful on a 64-bit x86 Mac system which
can run 32-bit or 64-bit user-land processes.
llvm-svn: 170409
Memory read's "repeat" behavior forgets "-t" option. It also formatted the type as hex bytes + ASCII. Now we revert to the default format when displaying types unless the user sets the format option manually.
llvm-svn: 170265
x/a print wouldn't always reset the word size to the size of a pointer if a previous memory read using x/<gdb-format> had been used that set it to another width.
llvm-svn: 170264
to report a structure with an array of size 1
at the end without accounting for that array
when reporting the struct's total size to Clang.
LLDB now coerces such an array to size 0.
<rdar://problem/12822204>
llvm-svn: 170168
This should be more consistent with the notion of command success/failure and avoids spewing warnings that the user might not care about
There will need to be an option to specify the level of verbosity desired (never show anything, only show failures, errors and warning, everything)
llvm-svn: 170167
Supporting a compact display syntax for ObjC pointers where 0x00.....0 is replaced by a much more legible "nil"
e.g. this would show:
(NSArray *) $2 = nil
instead of:
(NSArray *) $2 = 0x0000000000000000 <nil>
llvm-svn: 170161
Should be that if any of the threads wants to stop, we should stop. The opposite was what was actually happening
<rdar://problem/12869725>
llvm-svn: 170153
equality can be strict or loose and we want code to
explicitly choose one or the other.
Also renamed the Compare function to IsEqualTo, to
avoid confusion.
<rdar://problem/12856749>
llvm-svn: 170152
Fixing an issue where errors in command files sourced as arguments to command-line lldb (e.g. ./lldb -s foo.cmd) would not be shown to the user
llvm-svn: 170146
For iOS native lldb, don't initialize the ModuleList notifier
callback. See the added comment for details on how this is a problem
in that environment. We'll need to restructure how the ModuleDidLoad
notification is called vrs. when the DynamicLoader pluging has had
a chance to set the Sectino load addresses.
llvm-svn: 170082
Emitting a warning when defining a summary or a synthetic provider and the function/class name provided does not correspond to a valid scripting object
Also using this chance to edit a few error messages from weird "internal error" markers to actual user-legible data!
llvm-svn: 170013
Added a "step-in-target" flag to "thread step-in" so if you have something like:
Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63
and you want to get into "complex" skipping a, b and c, you can do:
(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])
llvm-svn: 170008
the option to print the runtime-specific description has been modified in the frame variable, memory read and expression command.
All three commands now support a --object-description option, with a shortcut of -O (uppercase letter o)
This is a breaking change:
frame variable used --objc as the long option name
expression used -o as a shortcut
memory read uses --objd as the long option name
Hopefully, most users won't be affected by the change since people tend to access "expression --object-description" under the alias "po" which still works
The test suite has been tweaked accordingly.
llvm-svn: 169961
Using this mechanism, making sure that the options to pass a summary string or a named summary to frame variable do not have invalid values
<rdar://problem/11576143>
llvm-svn: 169927
"self" when those pointers are in registers.
Previously in this case the IRInterpreter would
handle them just as if the user had typed in
"$rdi", which isn't safe because $rdi is passed
in through the argument struct.
Now we correctly break out all three cases (i.e.,
normal variables in registers, $reg, and this/self),
and handle them in a way that's a little bit easier
to read and change.
This results in more accurate printing of "this" and
"self" pointers all around. I have strengthened the
optimized-code test case for Objective-C to ensure
that we catch regressions in this area reliably in
the future.
<rdar://problem/12693963>
llvm-svn: 169924
When displaying function.name-with-args format will now print "varname=<unavailable>" instead of omitting argument names and values when there is an error reading the value.
llvm-svn: 169781
Making MightHaveChildren() always return true regardless for our own data formatters
This is meant to optimize performance for common most-often-not-empty container classes
llvm-svn: 169759
Fix the OptionValueFileSpec option value to correctly get the file path when trailing spaces are on the path. The "settings set" command uses the OptionValueFileSpec class to set file paths and if extra spaces are at the end it will include those in the paths. Now we chop up the value send to to OptionValueFileSpec::SetValueFromCString(...) function with "lldb_private::Args" and give an appropriate error if more than one path is used. It also allows for quotes to be used when specifying the path.
llvm-svn: 169753
Change the wording of NSNumber summary from absurd value to unexpected value when a tagged pointer shows up that does not match our knowledge of the internals
llvm-svn: 169751
lldb.target
lldb.process
lldb.thread
lldb.frame
are initialized to at least contain empty lldb classes in case some python gets imported that uses them.
llvm-svn: 169750
- remove unused members
- add NO_PEDANTIC to selected Makefiles
- fix return values (removed NULL as needed)
- disable warning about four-char-constants
- remove unneeded const from operator*() declaration
- add missing lambda function return types
- fix printf() with no format string
- change sizeof to use a type name instead of variable name
- fix Linux ProcessMonitor.cpp to be 32/64 bit friendly
- disable warnings emitted by swig-generated C++ code
Patch by Matt Kopec!
llvm-svn: 169645
When using the same-device optimization for shared cache libraries, if
we have an invalid load address for __LINKEDIT, don't try to read
anything out of lldb's own address space. Reading it out of the remote
address space will fail gracefully if we have bad addresses but reading
it out of lldb's own address space will result in a crash.
llvm-svn: 169582
I modified the "Args::StringtoAddress(...)" function to be able to evaluate address expressions. This is now used for any command line arguments or options that takes addresses like:
memory read <addr> [<end-addr>]
memory write <addr>
breakpoint set --address <addr>
disassemble --start-address <addr> --end-address <addr>
It calls the expression parser to evaluate the address expression and will also work around the issue where the compiler doesn't like to add offsets to function pointers (which is what happens when you try to evaluate "main + 12"). So there is a temp fix in the Args::StringtoAddress() to work around this until we can get special compiler support for debug expressions with function pointers.
llvm-svn: 169556
Fixed zero sized arrays to work correctly. This will only happen once we get a clang that emits correct debug info for zero sized arrays. For now I have marked the TestStructTypes.py as an expected failure.
llvm-svn: 169465
of the "self"/"this" pointer for the current stack
frame before wrapping expressions in C++ or
Objective-C methods. This works around bad debug
info where the compiler emits a "this" or "self"
but doesn't give any way to find its location.
<rdar://problem/12809985>
llvm-svn: 169461
- Removed the BitfieldMap class because it is unnecessary.
We now just track the most recently added field.
- Moved the code that calculates bitfield widths so it
can also be used to determine whether it's necessary
to insert anonymous fields.
- Simplified the anonymous field calculation code into
three cases (two of which are resolved identically).
- Beefed up the bitfield testcase.
llvm-svn: 169449
I filed this to track the fix:
<rdar://problem/12817918> Recent i386 ABI changes break the i386 test suite because stack backtracing is busted when stopped in trampolines
llvm-svn: 169409
- add new header lldb-python.h to be included before other system headers
- short term fix (eventually python dependencies must be cleaned up)
Patch by Matt Kopec!
llvm-svn: 169341
these are the *non-volatile* registers on Darwin/i386, not the
volatile registers.
Recognize the sp, pc, fp generic reg names as well.
llvm-svn: 169316
type of an Objective-C selector, don't bother
making the expression parser resolve it all over
again. Just send the message straight to the
object pointer as if it were an id, and cast the
result.
<rdar://problem/12799087>
llvm-svn: 169300
Add the ability to get a symbol or symbols by name and type from a SBModule, and also the ability to get all symbols by name and type from SBTarget objects.
llvm-svn: 169205
Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite.
This fix does the following:
- make sure all short options are treated as "int"
- make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired
- fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates
- fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value
llvm-svn: 169189
- use const char* instead of char* as needed in ObjC language runtime plugin
- use int to iterate through enum (operator++ on enum not defined)
- use initializer list instead of inline initialization of const field
llvm-svn: 169185
that kexts were newly added.
The Darwin userland dynamic loader provides lldb with a list of
newly-added or newly-removed binaries but in the kernel case we
only know that something has changed. DynamicLoaderDarwinKernel
really needs to maintain its own persistent list of kexts that
it has been notified about (most importantly, it will not detect
kext unlods) but for now we'll at least avoid re-adding an already
present kext.
<rdar://problem/12658487>, <rdar://problem/12658487>
llvm-svn: 169082
For "target create" you can now specify "--no-dependents" to not track down and add all dependent shared libraries. This can be handy when doing manual symbolication. Also added the "--symfile" or "-s" for short so you can specify a module and a stand alone debug info file:
(lldb) target create --symfile /tmp/a.dSYM /usr/bin/a
Added the "--symfile" option to the "target modules add" for the same reason. These all help with manualy symbolication and expose functionality that was previously only available through the public API layer.
llvm-svn: 169023
Emit an error when using "target modules add PATH" where PATH points to a debug info only (dSYM) file.
Also added a "--uuid" option for "target modules add --uuid UUID" to locate and load a module by UUID if the host supports it.
llvm-svn: 168949
Prevent async and sync calls to get profile data from stomping on each other.
At the same time, don't use '$' as end delimiter per chunk of profile data.
llvm-svn: 168948
Make stack frames fix up their line table entries when the target has source remappings. Also rearranged how the m_sc.target_sp was filled in so it can be used during the StackFrame::GetSymbolContext(...) function.
llvm-svn: 168845
versions of UnknownAnyTy for ObjectiveC value types.
<unknown type>* makes no sense and can cause the
parser to behave very oddly.
<rdar://problem/12518999>
llvm-svn: 168844
the frame and then getting the run lock. Which means that our frame could have gotten
invalidated by stopping between the time we got the frame and assured the the target was
stopped. Now we get the run lock first, and THEN resolve the underlying frame object.
<rdar://problem/12621607>
llvm-svn: 168838
Simplify the logging on ObjectFile::~ObjectFile() to not access an classes above the object file (like the module) so we don't crash when logging object lifetimes. The log message contains the "this" pointer value which can be matched up with the constructor log.
llvm-svn: 168754
DebugClang builds of LLDB to build a properly
codesigned debugserver. I did this by adding
a DebugClang configuration to debugserver that's
just a clone of the Debug configuration.
llvm-svn: 168746
Make sure that ValueObjectDynamicValue clears itself when no dynamic type information can be found
This behavior was supposed to be already happening (as per the comment lines)
llvm-svn: 168743
Allow the expression parser to see more than just data symbols. We now accept any symbol that has an address. We take precautions to only accept symbols by their mangled or demangled names only if the demangled name was not synthesized. If the demangled name is synthesized, then we now mark symbols accordingly and only compare against the mangled original name.
llvm-svn: 168668
- use lldb settings command instead of os.environ
- use dyldPath fixture variable instead of hardcoding LD_LIBRARY_PATH
- add tear-down hook to restore environment after testcase is run
llvm-svn: 168613
- use lldb 'settings' command to help testcase find shared library
- pull up dyldPath variable from TestLoadUnload.py to fixture base class (applicable in multiple cases)
llvm-svn: 168612
- Handle EINVAL return code from ptrace(GETSIGINFO, ...): not an error, but 'group-stop' state on Linux
- propagate SIGSTOP to inferior in above case
- this commit resolves the failure in expression_command/timeout testcase
Thanks to Sean Callanan & Matt Kopec for helping debug this problem
llvm-svn: 168523
- missing includes in cpp test programs
- mismatched dwarf/dsym test cases
- make "com.apple.main-thread" expected string conditional on darwin platform
llvm-svn: 168452