debugserver now returns $X09 as the immediate response to
a $k kill process request rather than $W09.
ProcessGDBRemote now properly handles X as indication of
a process exit state.
The @debugserver_test and @lldb_test for $k now properly expects
an X notification (signal-caused exit) after killing a just-attached
inferior that was still in the stopped state.
llvm-svn: 209108
Rationale:
Pretty simply, the idea is that sometimes type names are way too long and contain way too many details for the average developer to care about. For instance, a plain ol' vector of int might be shown as
std::__1::vector<int, std::__1::allocator<....
rather than the much simpler std::vector<int> form, which is what most developers would actually type in their code
Proposed solution:
Introduce a notion of "display name" and a corresponding API GetDisplayTypeName() to return such a crafted for visual representation type name
Obviously, the display name and the fully qualified (or "true") name are not necessarily the same - that's the whole point
LLDB could choose to pick the "display name" as its one true notion of a type name, and if somebody really needs the fully qualified version of it, let them deal with the problem
Or, LLDB could rename what it currently calls the "type name" to be the "display name", and add new APIs for the fully qualified name, making the display name the default choice
The choice that I am making here is that the type name will keep meaning the same, and people who want a type name suited for display will explicitly ask for one
It is the less risky/disruptive choice - and it should eventually make it fairly obvious when someone is asking for the wrong type
Caveats:
- for now, GetDisplayTypeName() == GetTypeName(), there is no logic to produce customized display type names yet.
- while the fully-qualified type name is still the main key to the kingdom of data formatters, if we start showing custom names to people, those should match formatters
llvm-svn: 209072
Also moved it into the lldb_private namespace.
The llgs branch is making use of this interface and its use is not
strictly limited to POSIX.
llvm-svn: 209016
See thread here:
http://lists.cs.uiuc.edu/pipermail/lldb-dev/2014-May/003992.html
This is meant to address case 3 that I recently broke with an earlier
change to rectify usage of the $qC message for thread ids, specifically:
3. TOT lldb <=> gdbserver (without $qProcessInfo support and not Apple/iOS).
llvm-svn: 208741
the SystemRuntime to check if a thread will have any problems
performing an inferior function call so the driver can skip
making that function call on that thread. Often the function
call can be executed on another thread instead.
<rdar://problem/16777874>
llvm-svn: 208732
another way to indicate that this register is a generic
Return Address register (in addition to "ra") - this is
used primarily by OperatingSystem plugins.
Correctly annotate the UnwindPlan created by EmulateInstructionARM64
to indicate that it was not sourced from a compiler and it
is valid at every instruction.
<rdar://problem/16639754>
llvm-svn: 208390
$qC from debugserver now returns the current thread's thread-id (and, like $?, will set a current thread if one is not already selected). Previously it was returning the current process id.
lldb will now query $qProcessInfo to retrieve the process id. The process id is now cached lazily and reset like other cached values. Retrieval of the process id will fall back to the old $qC method for vendor==Apple and os==iOS if the qProcessInfo retrieval fails.
Added a gdb remote protocol-level test to verify that $qProcessInfo reports a valid process id after launching a process, while the process is in the initial stopped state. Verifies the given process id is a currently valid process on host OSes for which we know how to check (MacOSX, Linux, {Free/Net}BSD). Ignores the live process check for OSes where we don't know how to do this. (I saw no portable way to do this in stock Python without pulling in other libs).
llvm-svn: 208241
data if it is available.
Change ProcessGDBRemote's maximum read/write packet size from a
fixed 512 byte value to asking the remote gdb stub what its maximum
is, using up to 128kbyte sizes if that's allowed, and falling back
to 512 if the remote gdb stub doesn't advertise a max packet size.
Add a new "process plugin packet xfer-size" command that can be used
to override the maximum packet size (although not exceeding any packet
size maximum published by the remote gdb stub).
<rdar://problem/16032150>
llvm-svn: 208058
Add a callback that will allow an expression to be cancelled between the
expression evaluation stages (for the ClangUserExpressions.)
<rdar://problem/16790467>, <rdar://problem/16573440>
llvm-svn: 207944
- CTRL+C wasn't clearing the command in lldb
- CTRL+C doesn't work in python macros in lldb
- Ctrl+C no longer interrupts the running process that you attach to
<rdar://problem/15949205>
<rdar://problem/16778652>
<rdar://problem/16774411>
llvm-svn: 207816
- Remove default for switch which covers all enumeration values
- Remove unused functions
LSL_C is left in the source under #if 0, as it may be needed in the
future for emulating other instructions.
Differential Revision: http://reviews.llvm.org/D3528
llvm-svn: 207449
Currently if you run _any_ python, python has the "lldb.debugger" global variable and it has a strong reference to a lldb_private::Debugger since it is a lldb::SBDebugger object with a shared pointer.
This makes sure that your LLDB command interpreter history is saved each time you quit command line LLDB.
llvm-svn: 207164
currently associated with a given thread, on relevant targets.
Change the queue detection code to verify that the queues
associated with all live threads are included in the list.
<rdar://problem/16411314>
llvm-svn: 207160
values of variables in the Materializer.
The Materializer should not write the variable
back if its new value is the *same* as the old
value, not if the new value is *different*.
<rdar://problem/16712205>
llvm-svn: 207148
This decision has always been statically-bound to the individual formatter. With this patch, the idea is that this decision could potentially be dynamic depending on the ValueObject itself
llvm-svn: 207046
When compiling on Linux with GCC 4.8, compilation would fail due to the use of
the offsetof macro. This is a standard macro, defined in stddef.h. Include
this header to ensure that offsetof is declared.
llvm-svn: 206702
when it is reading the kext table, in case we're reading out of a core file with
corrupt contents in this region.
<rdar://problem/16601915>
llvm-svn: 206233
The "unexpected value" message only matters to me, but is bound to make the experience more confusing for people when some uninitialized memory looks like an NSNumber and then can't be formatted properly, and that error comes out in the UI
Just drop the error message entirely - nobody but me cares
llvm-svn: 205978
Enable data formatters to see-through pointers/references to typedefs
For instance, if Foo is a typedef to Bar, and there is a formatter for any/all of Bar*, Bar&, Bar&&, then Foo*, Foo&, and Foo&& should pick these up if Foo-specific formatters don't exist
llvm-svn: 205939
Set the correct FormatManager revision before starting to figure out the new formatters
This can avoid entering some corner cases where as part of figuring out formatters we try to figure out dynamic types, and in turn that causes us to go back in trying to fetch new formatters - it is not only a futile exercise, it's also prone to endless recursion
This would only cause a behavior change if getting this chain started would eventually cause something to run and alter the formatters, a very unlikely if at all possible sequence of events
llvm-svn: 205928
TIDs are conventionally shown as decimal values on FreeBSD and Linux.
Thus, use the ${thread.id%tid} format string to display the thread ID,
instead of a fixed hex format.
llvm.org/pr19380
llvm-svn: 205912
but by the time we go to halt, it has already stopped by hitting the
function end breakpoint. That wasn't being shown to the threads so the
Function call thread plan didn't know its job was done.
<rdar://problem/16515785>
llvm-svn: 205803
SBTarget::AddModule(const char *path,
const char *triple,
const char *uuid_cstr,
const char *symfile);
If "symfile" was filled in, it would cause us to not correctly add the module. Same goes for:
SBTarget::AddModule(SBModuleSpec ...)
Where you filled in the symfile.
<rdar://problem/16529799>
llvm-svn: 205750
This fix reduces the stack size of SymbolFileDWARF::ParseType(). It seems that clang is not very good at sharing locations on the stack with local variables in large functions that have many blocks and each variable gets unique locations. The reduction in size was done by:
1 - removing some large locals that were default constructed by not used
2 - Placing some larger local variables into std::unique_ptr<> to make them on the heap
3 - removing local variables there were large and being populated but not being used
4 - reducing the size of some typedefs to llvm::SmallVector<T, N> so that N wasn’t excessively large
<rdar://problem/16431645>
llvm-svn: 205640
This is a purely mechanical change explicitly casting any parameters for printf
style conversion. This cleans up the warnings emitted by gcc 4.8 on Linux.
llvm-svn: 205607
This is a mechanical change addressing the various sign comparison warnings that
are identified by both clang and gcc. This helps cleanup some of the warning
spew that occurs during builds.
llvm-svn: 205390
You can either provide the function name, or function body text.
Also propagate the compilation error up from where it is checked so we can report compilation errors.
<rdar://problem/9898371>
llvm-svn: 205380
On FreeBSD ptrace(PT_KILL) is used to terminate the traced process
(as if PT_CONTINUE had been used with SIGKILL as the signal to be
delivered), and is the desired behaviour for ProcessPOSIX::DoDestroy.
On Linux, after ptrace(PTRACE_KILL) the traced process still exists
and can be interrogated. It is only upon resume that it exits as though
it received SIGKILL.
As the Linux PTRACE_KILL behaviour is not used by LLDB, rename
BringProcessIntoLimbo to Kill, and change the implementation to simply
call kill() instead of using ptrace.
Thanks to Todd F for testing (Ubuntu 12.04, gcc 4.8.2).
Sponsored by: DARPA, AFRL
Differential Revision: http://llvm-reviews.chandlerc.com/D3159
llvm-svn: 205337
Store the gpr data in a DataBufferHeap and use a DataExtractor to
extract register values with appropriate endianness. This avoids hard-
coding the register count, and with some further work would allow this
class to provide generic register context storage for any CPU.
llvm-svn: 205329
On FreeBSD ptrace(PT_KILL) is used to terminate the traced process
(as if PT_CONTINUE had been used with SIGKILL as the signal to be
delivered), and is the desired behaviour for ProcessPOSIX::DoDestroy.
On Linux, after ptrace(PTRACE_KILL) the traced process still exists
and can be interrogated. It is only upon resume that it exits as though
it received SIGKILL.
For now I'm committing only the FreeBSD change, until the Linux change
(review D3159) is successfully tested.
http://llvm.org/pr18894
llvm-svn: 205315
For some reason, the libc++ vector<bool> data formatter was essentially a costly no-up, doing everything required of it, except actually generating the child values!
This restores its functionality
llvm-svn: 205259
These changes were written by Greg Clayton, Jim Ingham, Jason Molenda.
It builds cleanly against TOT llvm with xcodebuild. I updated the
cmake files by visual inspection but did not try a build. I haven't
built these sources on any non-Mac platforms - I don't think this
patch adds any code that requires darwin, but please let me know if
I missed something.
In debugserver, MachProcess.cpp and MachTask.cpp were renamed to
MachProcess.mm and MachTask.mm as they picked up some new Objective-C
code needed to launch processes when running on iOS.
llvm-svn: 205113
condition where we could end up killing debugserver (and thus the target) before it had a chance
to detach.
Also fix debugserver to send the OK AFTER it detaches to avoid the same race condition.
<rdar://problem/16202713>
llvm-svn: 205043
if they didn't change, just like it does for
registers. This makes life easier for kernel
debugging and any other situation where values
are read-only.
<rdar://problem/16367795>
llvm-svn: 204764
For small structs, the frame format now prints them as one-liners
This follows the same definition that frame variable does for deciding what a "small struct" is, and as such should be fairly consistent with the variable display in general
llvm-svn: 204762
Add a GetFoundationVersion() to AppleObjCRuntime
This API is used to return and cache the major version of Foundation.framework, which is potentially a useful piece of data to key off of to enable or disable certain ObjC related behaviors (especially in data formatters)
llvm-svn: 204756
This change makes significant improvements in the performance of
calculating a UUID within ObjectFileELF, and handles both running
processes and core files correctly. This does lazy evaluation of
UUID generation and caches the result when calculated.
Change by Piotr Rak.
llvm-svn: 204749
When there was no process, the expression options were set to not ignore breakpoints. This causes debug info to be generated and causes errors when evaluating simple expressions.
llvm-svn: 204745
(lldb) b puts
(lldb) expr -g -i0 -- (int)puts("hello")
First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression.
Main features:
- New ObjectFileJIT class that can be easily created for JIT functions
- debug info can now be enabled when parsing expressions
- source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit
- "expr -g --" allows you to single step through your expression function with source code
<rdar://problem/16382881>
llvm-svn: 204682
Previous check relied on -DLLDB_DISABLE_PYTHON which was not valid as
it is defined in the top level LLDB Makefile which is included after the check.
If this check is moved after the inclusion of top level Makefile then
BUILT_SOURCES is not properly handled. So I am using the scheme present
in the Host/Makefile.
llvm-svn: 204459
This is a mechanical cleanup of unused functions. In the case where the
functions are referenced (in comment form), I've simply commented out the
functions. A second pass to clean that up is warranted.
The functions which are otherwise unused have been removed. Some of these were
introduced in the initial commit and not in use prior to that point!
NFC
llvm-svn: 204310
TestPromptFormats appears as though it may be a useful unit test.
Unfortunately, there is no invocation mechanism in place right now. It is
unclear how to add a unit test for this scenario to the existing tests. It
would be ideal to remove this entirely, but I am hopeful that this can/will be
pulled out into a test still since it uses a user accessible interface.
llvm-svn: 204309
The standard JIT has been discarded in favour of MCJIT. USE_STANDARD_JIT is no
longer defined. Furthermore, the execution engine is now built in
IRExecutionUnit. Simply remove inclusion of both JIT headers.
llvm-svn: 204112
Multichar constants are not portable as the byte order is undefined. Use a
constant value instead. This avoids a warning when compiling with gcc 4.8+
(-Wmultichar) and makes the code more portable.
llvm-svn: 204110
libxml2's include path was unconditionally set to /usr/include/libxml2. This
would work previously, however, Mavericks removed the /usr/include directory.
Since LLDB already requires clang, which via LLVM's build infrastructure
searches for libxml2, we have a proper include path for libxml2. If
LIBXML2_FOUND is set, do not touch the libxml2 search path. Instead, allow the
clang's definition to propagate throughout the LLVM build. Otherwise, switch to
find_package(LibXml2) as clang does. This will ensure that the correct path is
used for libxml2 irrespective of the platform.
Furthermore, treat libxml2 as a system provided library. It is not part of the
LLVM source base so it is of little value to enable all warnings on its headers.
This unifies the treatment of libxml2 across clang and LLDB.
llvm-svn: 203955
for customizing "step-in" behavior (e.g. step-in doesn't step into code with no debug info), but also
the behavior of step-in/step-out and step-over when they step out of the frame they started in.
I also added as a proof of concept of this reworking a mode for stepping where stepping out of a frame
into a frame with no debug information will continue stepping out till it arrives at a frame that does
have debug information. This is useful when you are debugging callback based code where the callbacks
are separated from the code that initiated them by some library glue you don't care about, among other
things.
llvm-svn: 203747
Fix Windows build by adding JITLoaderGDB and ProcessElfCore.
RegisterContext: fixes for Windows build: sizeof(GPR::register) didn't work, switched to sizeof(((GPR*)NULL)->register).
llvm-svn: 203667
erroneously completing Objective-C classes sourced
from the Objective-C runtime without checking if
there was an authoritative version in the debug
information.
<rdar://problem/16065049>
llvm-svn: 203600
What was use_iterator is now user_iterator. Also switch to range-based
APIs, as in Clang r203365.
(This part of the change was missed in r203463)
Differential Revision: http://llvm-reviews.chandlerc.com/D3030
llvm-svn: 203475
Seed the QueueItem objects with the item_refs and addresses when they are fetched
in one batch. If additional information is needed from the QueueItem, fetch it
lazily one pending item per function call.
<rdar://problem/16270007>, <rdar://problem/16032150>
llvm-svn: 203449
changing the data it returns; this change accepts either the old format or
the new format. It doesn't yet benefit from the new format's additions -
but I need to get this checked in so we aren't rev-locked.
Also add a missing .i entry for SBQueue::GetNumRunningItems() missing from
the last checkin.
<rdar://problem/16272115>
llvm-svn: 203421
items; the backing Queue object has the number of pending items
already cached. Also, add SBQueue::GetNumRunningItems() to provide
that information.
<rdar://problem/16272016>
llvm-svn: 203420
memcpy cannot be passed NULL. Ensuring that the destination pointer is non-NULL
requires checking success. Rather than performing the success check at that
point, increasing indentation an additional level, fold it into the previous
statement.
llvm-svn: 203359