Commit Graph

8881 Commits

Author SHA1 Message Date
Enrico Granata e8daa2f843 Introduce the concept of a "display name" for types
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
2014-05-17 19:14:17 +00:00
Jason Molenda 64a68d6157 Update how we create our MCSymbolizer to keep working correctly
on arm64 binaries after the llvm r206063 changes.  
Patch written by Jim Ingham and Lang Hames.
<rdar://problem/16935671> 

llvm-svn: 209051
2014-05-17 00:27:44 +00:00
Greg Clayton 5c6a2cd920 Fix the copy constructor and assignement operator for the lldb_private::Value class to "do the right thing".
llvm-svn: 209036
2014-05-16 21:49:19 +00:00
Todd Fiala 4fc3cdd054 Refactored RegisterInfoInterface into its own header.
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
2014-05-16 20:43:19 +00:00
Jim Ingham ec47b2217e Fix from: Scott Knight(knightsc@gmail.com):
Use a map rather than a vector to store the objects managed by the shared 
cluster since mostly want this for random lookup, so the map is much faster.

llvm-svn: 209010
2014-05-16 19:46:56 +00:00
Deepak Panickal 95442c445f Do not require the triple to be hard-coded
llvm-svn: 208982
2014-05-16 13:26:45 +00:00
Deepak Panickal 6f9c468102 Initial commit of LLDB Machine Interface Frontend.
- Tested with Eclipse, likely to work with other GDB/MI compatible GUIs.
- Some but not all MI commands have been implemented. See MIReadme.txt for more info.
- Written from scratch, no GPL code, based on LLDB Public API.
- Built for Linux, Windows and OSX. Tested on Linux and Windows.
- GDB/MI Command Reference, https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html

llvm-svn: 208972
2014-05-16 10:51:01 +00:00
Todd Fiala d18b767b04 Added gdbremote tests to verify kill and continue after attach.
llvm-svn: 208804
2014-05-14 19:34:06 +00:00
Greg Clayton 24feaf70aa Fixed SectionLoadHistory::GetSectionLoadListForStopID() to always return a valid "SectionLoadList *".
<rdar://problem/15818525>

llvm-svn: 208796
2014-05-14 17:25:00 +00:00
Todd Fiala 028a43f910 Fix up TestLldbGdbServer C++ test slug exe.
Missing header for Linux, replaces with iostreams.

llvm-svn: 208794
2014-05-14 17:12:02 +00:00
Todd Fiala fd8ae3a140 Replace SIZE_T_MAX with std::numeric_limits value in Section.cpp.
SIZE_T_MAX is not available on Linux.

llvm-svn: 208789
2014-05-14 16:15:43 +00:00
Todd Fiala f05ca45b1e Added debugserver/llgs test for command-line --attach {pid} variant.
Checks that the pid reported by $qProcessInfo matches the pid that was
launched as the attach test subject.

test exe now supports "sleep:{sleep_seconds}" command line argument.

llvm-svn: 208782
2014-05-14 14:51:27 +00:00
Greg Clayton 3698a715ee Don't assert and crash when sections are malformed.
<rdar://problem/16833247>

llvm-svn: 208749
2014-05-14 01:12:09 +00:00
Todd Fiala e24614f74e lldb: gdb remote support always falls back to $qC when no $qProcessInfo.
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
2014-05-14 00:15:32 +00:00
Jason Molenda 060ca7596c Fix the quoting in my x packet documentation so it's
consistent with the rest of the entries.

llvm-svn: 208736
2014-05-13 22:21:34 +00:00
Jason Molenda b4892cd266 Add a new SBThread::SafeToCallFunctions API; this calls over to
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
2014-05-13 22:02:48 +00:00
Todd Fiala 9d03d8a65d Fix broken TestMultithreaded on Linux.
The clean line is failing under Ubuntu 12.04/gcc.  It cleans fine
without it on MacOSX.  It doesn't clean right on Linux but at least
now it doesn't fail the test.

llvm-svn: 208713
2014-05-13 17:20:17 +00:00
Saleem Abdulrasool f69b64d6d2 python: silence macro redefinition warnings
Python defines _XOPEN_SOURCE and _POSIX_C_SOURCE unconditionally.  On Linux,
this is problematic as glibc's features.h defines these values if _GNU_SOURCE is
defined to the value that is currently implemented.  Python defines it to the
versions that it requires, which may be different.  Undefine the macros on Linux
(technically, this should be safe to do globally) before including the python
headers.

llvm-svn: 208520
2014-05-12 06:44:01 +00:00
Jim Ingham 7b113009a9 Documented our "attach" extension packets.
llvm-svn: 208423
2014-05-09 16:17:24 +00:00
Jason Molenda 2fc43a3821 Args::StringToGenericRegister will now accept "lr" as
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
2014-05-09 04:09:48 +00:00
Greg Clayton b89b7496ca "process kill" and "process detach" were causing double prompts or prompts that would overwrite each other. Fixed now.
<rdar://problem/16547729>

llvm-svn: 208369
2014-05-08 23:04:39 +00:00
Greg Clayton 1fd43846a1 Revert bad checkin that use incorrect member field.
llvm-svn: 208339
2014-05-08 17:10:54 +00:00
Greg Clayton 153e7c7207 Set the current line to invalid when done getting multiple lines.
llvm-svn: 208338
2014-05-08 17:06:33 +00:00
Greg Clayton c3d874a584 lldb TOT is dropping the last entry for multi-line IOHandlers that use the IOHandlerDelegateMultiline.
<rdar://problem/16844164>

llvm-svn: 208336
2014-05-08 16:59:00 +00:00
Jason Molenda 8cb27bb911 Change ProcessElfCore::CreateInstance() to check if the ELF magic bytes
appear in the file before it assumes the file is ELF.  It was incorrectly
activating for Mach-O core files.
<rdar://problem/16836816> 

llvm-svn: 208265
2014-05-07 23:14:04 +00:00
Greg Clayton 3e32ad65fb Allow clients to control the exact path that is used to launch processes by adding new calls to SBLaunchInfo.
The new calls are:

SBFileSpec
SBLaunchInfo::GetExecutableFile ();

void
SBLaunchInfo::SetExecutableFile (SBFileSpec exe_file, bool add_as_first_arg);

<rdar://problem/16833939>

llvm-svn: 208245
2014-05-07 20:16:06 +00:00
Todd Fiala 9f72b3a1ce Modify debugserver to follow gdb remote $qC protocol definition.
$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
2014-05-07 19:28:21 +00:00
Ed Maste d010f9a8a5 If CMake finds a python interpreter, use it
The FreeBSD package building cluster installs e.g. 'python2.7', but no
plain 'python' to avoid version-related issues.

CMake's FindPythonInterp locates an interpreter with such a name and
provides it in the PYTHON_EXECUTABLE variable.  Use that if it's set,
falling back to the original '/usr/bin/env python' otherwise.

This is a missing part of LLDB commit r207122.
Patch by Brooks Davis in FreeBSD ports commit r353052

llvm-svn: 208204
2014-05-07 12:52:08 +00:00
Greg Clayton c62338e89d control-D on empty line to quit lldb stopped working in Release builds on MacOSX.
<rdar://problem/16822217>

llvm-svn: 208117
2014-05-06 18:54:53 +00:00
Todd Fiala f9c3c9fe44 gdbremote testing: added regex support to match packets and propagate/test against previously stored matches.
Added a test validating that $qC after an inferior launch via $A
returns a thread id that an immediately followig $? reports for the
active thread. This is currently skipped on debugserver (the thread
ids don't match) and isn't yet implemented in TOT for llgs.

llvm-svn: 208061
2014-05-06 06:15:23 +00:00
Jason Molenda 6076bf4edb Change ProcessGDBRemote::DoReadMemory to use the x packet to read
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
2014-05-06 04:34:52 +00:00
Jason Molenda bdc4f12f19 Add GetxPacketSupported to test if the 'x' packet is supported.
<rdar://problem/16032150> 

llvm-svn: 208052
2014-05-06 02:59:39 +00:00
Jason Molenda 018ff31462 Add a simple qSupported packet, fix a bug in decode_binary_data(),
add a new 'x' packet for reading data in binary format.  Document
the 'x' packet.  
<rdar://problem/16032150> 

llvm-svn: 208051
2014-05-06 02:53:43 +00:00
Todd Fiala 6764c00687 Refactored gdb remote protocol testing sequence handling.
Pushed gdbremote protocol sequence expectations into a separate
class and defer matching of llgs/debugserver output to the
sequence entry.  Pre-step to adding regex matching and
grouped content collecting.

No longer require anything before the read/send packet
portion of slurped-up log lines used for setting up
gdb remote test sequences.  Several packet logging options
produce a wide range of content before the read/send packet.

Added helpers to TestLldbGdbServer to clean up test setup
and test expectations matching.

llvm-svn: 207998
2014-05-05 20:54:01 +00:00
Jim Ingham 8646d3c164 Rename eExecution*** to eExpression*** to be consistent with the result type.
llvm-svn: 207945
2014-05-05 02:47:44 +00:00
Jim Ingham 1624a2d3c8 Make the Expression Execution result enum available to the SB API layer.
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
2014-05-05 02:26:40 +00:00
Alp Toker cf55e88a11 Track recent changes in clang internals
llvm-svn: 207913
2014-05-03 15:05:45 +00:00
Alp Toker 01d9c64055 Remove obsolete CXX11 buld instructions
There's an element of guesswork involved in the GCC updates but it seems better
than what was there before.

llvm-svn: 207912
2014-05-03 15:05:40 +00:00
Greg Clayton 745b6688b4 LLDB could segfault if it got a .a file that had extra padding bytes at the end of the file.
<rdar://problem/16732178>

llvm-svn: 207877
2014-05-02 22:25:51 +00:00
Joerg Sonnenberger a53b3593f0 Use posix_spawn on NetBSD as well.
llvm-svn: 207864
2014-05-02 19:09:40 +00:00
Joerg Sonnenberger bf2a31053b For now, use FreeBSD's host configuration for NetBSD as well.
llvm-svn: 207863
2014-05-02 19:01:25 +00:00
Joerg Sonnenberger 420708a374 Fix format string for 32bit systems.
llvm-svn: 207862
2014-05-02 19:00:27 +00:00
Joerg Sonnenberger 2cd8f5245f Use correct readline header on NetBSD.
llvm-svn: 207861
2014-05-02 18:59:49 +00:00
Joerg Sonnenberger ff9620f975 LLDB_INVALID_ADDRESS may not be too large for a uintptr_t, so cast
first.

llvm-svn: 207860
2014-05-02 18:58:51 +00:00
Joerg Sonnenberger 6764b3e82a EOF is outside the value range of char on architectures with unsigned
char like ARM. Check for EOF explicitly.

llvm-svn: 207859
2014-05-02 18:53:53 +00:00
Joerg Sonnenberger 4f51a0740a LLDB_INVALID_OFFSET can be large than a size_t on ILP32 systems, so use
SIZE_MAX here.

llvm-svn: 207855
2014-05-02 18:26:40 +00:00
Greg Clayton f29bf9a169 "DONE" is being left in multi-line results when it shouldn't for non terminal input.
<rdar://problem/16790579>

llvm-svn: 207818
2014-05-02 01:03:07 +00:00
Greg Clayton f0066ad07f Fixed CTRL+C related issues:
- 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
2014-05-02 00:45:31 +00:00
Greg Clayton 4cc3ba56bf Fixed whitespace issues.
llvm-svn: 207778
2014-05-01 18:13:08 +00:00
Greg Clayton 40286e0b6d Sometimes when launching through a shell, we can run into cases where the /bin/sh or /usr/bin/arch can crash the process due to security measures. Now we correctly report when a process exited in the process of launching so we can show the reason why it crashed instead of just showing “initial process state wasn't stopped: exited”.
llvm-svn: 207700
2014-04-30 20:29:09 +00:00