Commit Graph

9430 Commits

Author SHA1 Message Date
Kuba Brecka a51ea3822a Implement ASan history threads in SB API
Reviewed at
http://reviews.llvm.org/D5219
and
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140901/012809.html

llvm-svn: 217300
2014-09-06 01:33:13 +00:00
Enrico Granata edc4414094 Expose the ability to retrieve the result of a type validator via the SB API. To keep it simple, do not expose the pair, but just return a NULL string for success, and a non-NULL string for error; If we were to decide to expose the pair, we would need an SBTypeValidatorResult, which is fine, but it should come as part of exposing type validators through the SB API rather than as a one-off thing. So, KISS for now
llvm-svn: 217299
2014-09-06 01:30:04 +00:00
Kuba Brecka aaa0b81a4e Fix CMake configuration (forgot to add a file in the last commit).
llvm-svn: 217297
2014-09-06 01:22:55 +00:00
Kuba Brecka a5ea1e2b6c Expose ThreadCollection in SB API
Reviewed at
http://reviews.llvm.org/D5218
and
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140901/012828.html

llvm-svn: 217296
2014-09-06 01:21:19 +00:00
Todd Fiala cefdbdf2fe Added logging of the POSIX-DYLD rendezvous address (i.e. the info_location address)
llvm-svn: 217287
2014-09-05 22:28:40 +00:00
Todd Fiala c82f650a2b Add more logging to DynamicLoaderPOSIXDYLD, especially around rendezvous handling.
Covers more of the behavior of rendezvous breakpoint handling and other
dynamic loader aspects, all on the 'enable log lldb dyld' log channel.

llvm-svn: 217283
2014-09-05 22:01:04 +00:00
Enrico Granata 744794aa96 Start plumbing the type validator logic through to the ValueObjects; allow a ValueObject to have a validator, to update it from the FormatManager, and to retrieve (and cache) the result of the validation
llvm-svn: 217282
2014-09-05 21:46:22 +00:00
Todd Fiala 4bce548a6b Add TypeValidator.cpp to cmake build.
llvm-svn: 217280
2014-09-05 21:23:09 +00:00
Enrico Granata c582713ce6 Introduce the notion of a "type validator" formatter
Type Validators have the purpose of looking at a ValueObject, and making sure that there is nothing semantically wrong about the object's contents
For instance, if you have a class that represents a speed, the validator might trigger if the speed value is greater than the speed of light

This first patch hooks up the moving parts in the formatters subsystem, but does not link ValueObjects to TypeValidators, nor lets the SB API be exposed to validators
It also lacks the notion of Python validators

llvm-svn: 217277
2014-09-05 20:45:07 +00:00
Reid Kleckner e89756f32a Fix CMake configuration
llvm-svn: 217273
2014-09-05 20:11:22 +00:00
Kuba Brecka e4d4801c3a [lldb] Abstract a superclass for a generic thread container.
Reviewed at
http://reviews.llvm.org/D5200
and
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140901/012799.html

llvm-svn: 217269
2014-09-05 19:13:15 +00:00
Todd Fiala bc5353a83c Properly handle the DYLD attach step for GDB remotes.
Change by Stephane Sezer.

llvm-svn: 217253
2014-09-05 15:06:16 +00:00
Todd Fiala 0cc371c166 Set the process vendor in GDBRemoteCommunicationClient::GetCurrentProcessInfo.
Change by Stephane Sezer.

llvm-svn: 217252
2014-09-05 14:56:13 +00:00
Todd Fiala 0ee56ce640 Add error report when Module::GetObjectFile() fails to find a plugin to open an object file.
Change by Stephane Sezer.

llvm-svn: 217251
2014-09-05 14:48:49 +00:00
Todd Fiala ebecb38d47 Fix up lldb build for llvm r217172.
Changes reference to 4th element in version_min_command from reserved to sdk.

llvm-svn: 217185
2014-09-04 19:31:52 +00:00
Todd Fiala dbec1ff42a Fix build break on Ubuntu 12.04 with ARM64 changes.
See http://llvm.org/bugs/show_bug.cgi?id=20824 for more details.

Tested:
Ubuntu 12.04 x86_64, gcc-4.9.1-built lldb
Ubuntu 14.04 x86_64, clang-3.5-build lldb

llvm-svn: 217169
2014-09-04 16:08:20 +00:00
Todd Fiala 6ce8fef458 Use the process' ReadCStringFromMemory from DYLDRendezvous::ReadStringFromMemory.
Tested:
Ubuntu 14.04 x86_64, clang-3.5-built lldb.
MacOSX 10.9.4, Xcode6-Beta7-built lldb.

Visual packet inspection on lldb <-> llgs shows significant reduction in overly-verbose
memory read traffic on start-up when scanning shared library info.

Change by Stephane Sezer.

llvm-svn: 217153
2014-09-04 14:16:19 +00:00
Kuba Brecka beed821ffb ASan malloc/free history threads
Reviewed at http://reviews.llvm.org/D4596

llvm-svn: 217116
2014-09-04 01:03:18 +00:00
Han Ming Ong cd2d797a79 rdar://problem/18221417
Include compressed memory as part of gauge memory.

llvm-svn: 217084
2014-09-03 22:33:37 +00:00
Jason Molenda f0340c9ab5 Add a new target.process.memory-cache-line-size to change the size of
lldb's internal memory cache chunks that are read from the remote
system.  For a remote connection that is especially slow, a user may
need to reduce it; reading a 512 byte chunk of memory whenever a
4-byte region is requested may not be the right decision in these
kinds of environments.
<rdar://problem/18175117> 

llvm-svn: 217083
2014-09-03 22:30:54 +00:00
Reid Kleckner 5420953303 Really fix the LLDB build
llvm-svn: 217003
2014-09-03 00:40:36 +00:00
Reid Kleckner 634ff8ec04 Remove the JIT from LLDB's dependencies to fix the build
llvm-svn: 217002
2014-09-03 00:35:03 +00:00
Jason Molenda 5de2e7cafb RegisterContextLLDB::InitializeNonZerothFrame had a bit of code to
detct unwind loops but there was a code path through there (using
architecture default unwind plans) that didn't do the check, and
could end up with an infinite loop unwind.  Move that code into a
separate method and call it from both places where it is needed.

Also remove the use of ABI::FunctionCallsChangeCFA in that check.
I thought about it a lot and none of the architecutres that we're
supporting today can have a looping CFA.

Since the unwinder isn't using ABI::FunctionCallsChangeCFA() and
ABI::StackUsesFrames(), and the unwinder was the only reason
those methods exists, I removed them from the ABI and all its
plugins.

<rdar://problem/17364005> 

llvm-svn: 216992
2014-09-02 23:04:01 +00:00
Todd Fiala 726d6a12ad Fix MacOSX cmake build for new HostInfoMacOSX file.
Change by Stephane Sezer.

llvm-svn: 216948
2014-09-02 21:10:23 +00:00
Todd Fiala c5c4e3a35b Linux ARM64: add ProcessMonitor-related RegisterContext support.
See http://reviews.llvm.org/D5089 for more details.

Change by Paul Osmialowski.

llvm-svn: 216907
2014-09-02 14:50:01 +00:00
Matthew Gardiner e77b2948b4 Add an interface on ArchSpec to provide lldb client code
with a mechanism to query if the current target architecture
has non 8-bit bytes.

llvm-svn: 216867
2014-09-01 09:06:03 +00:00
Sean Callanan 302be679bc Fixed a build problem dueo to changes in the
way ownership of memory buffers is handled in
clang's SourceManager.

llvm-svn: 216810
2014-08-30 02:24:56 +00:00
Todd Fiala 5412524025 Fix a test broken by r216564.
llgs Linux is no longer doing the translation to some gdb fixed signal
numbers.  This change modifies the test method to take in the signo
expected for a segfault.  The debugserver test uses the fixed gdb number,
and everything else uses signal.SIGSEGV for the platform.

Sidenote: I somehow did not see this reported in multicore tests.
I will need to verify that we aren't missing test failures in that
script.  I need to verify why this wasn't more obvious with
test/dosep.py.

llvm-svn: 216770
2014-08-29 20:32:18 +00:00
Todd Fiala 352237dbb6 lldb - fix misleading "valid target indexes are" error message
See http://reviews.llvm.org/D4430 for more details.

Change by Paul Osmialowski.

llvm-svn: 216766
2014-08-29 20:14:21 +00:00
Todd Fiala 4ceced3f59 Consolidate UnixSignals setting/getting in Process.
See http://reviews.llvm.org/D5108 for details.

This change does the following:

* eliminates the Process::GetUnixSignals() virtual method and replaces with a fixed getter.
* replaces the Process UnixSignals storage with a shared pointer.
* adds a Process constructor variant that can be passed the UnixSignalsSP. When the constructor without the UnixSignalsSP is specified, the Host's default UnixSignals is used.
* adds a host-specific version of GetUnixSignals() that is used when we need the host's appropriate UnixSignals variant.
* replaces GetUnixSignals() overrides in PlatformElfCore, ProcessGDBRemote, ProcessFreeBSD and ProcessLinux with code that appropriately sets the Process::UnixSignals for the process.

This change also enables some future patches that will enable llgs to be used for local Linux debugging.

llvm-svn: 216748
2014-08-29 17:35:57 +00:00
Jim Ingham b5796cb40e Allow "breakpoint command add" to add commands to more than one breakpoint at a time.
<rdar://problem/13314462>

llvm-svn: 216747
2014-08-29 17:34:17 +00:00
Todd Fiala 34ba426968 Add arbitrary command line flags to llgs/debugserver startup for local debugging.
This patch accepts environment variables of the form:
LLDB_DEBUGSERVER_EXTRA_ARG_n

where n starts with 1, and may continue nearly indefinitely (up through std::numeric_limits<uint32_t>::max()).

The code loops around, starting with 1, until it doesn't find one of the environment variables.  For each one it does find defined, it appends the environment variable's contents to the end of the debugserver/llgs startup command line issued when the stub is started for local debugging.

I am using this to add arbitrary startup commands to the llgs command line for turning on additional logging.  For example:

export LLDB_DEBUGSERVER_EXTRA_ARG_1="-c"
export LLDB_DEBUGSERVER_EXTRA_ARG_2="log enable -f /tmp/llgs_packets.log gdb-remote packets"
export LLDB_DEBUGSERVER_EXTRA_ARG_3="-c"
export LLDB_DEBUGSERVER_EXTRA_ARG_4="log enable -f /tmp/llgs_process.log lldb process"

llvm-svn: 216745
2014-08-29 17:10:31 +00:00
Todd Fiala 33bba9f440 lldb - ELF: add ARM64 relocation jump slot handling in ELFHeader.
See http://reviews.llvm.org/D4579 for more details.

Change by Paul Osmialowski.

llvm-svn: 216739
2014-08-29 16:19:27 +00:00
Todd Fiala b71e89e9af lldb - Register Context Linux ARM64
Yet another step toward ARM64 support. With this commit, lldb-gdbserver started on ARM64 target can be accessed by lldb running on desktop PC and it can process simple commands (like 'continue'). Still ARM64 support lacks NativeRegisterContextLinux_arm64.* code which waits to be implemented.
Based on similar files for Linux x86_64 and Darwin ARM64. Due to common code extraction from Darwin related files, lldb should be tested for any unexpected regression on Darwin ARM64 machines too.

See the following for more details:
http://reviews.llvm.org/D4580
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140825/012670.html

Change by Paul Osmialowski.

llvm-svn: 216737
2014-08-29 16:01:35 +00:00
Todd Fiala 281961a821 Added setting: platform.plugin.linux.use-llgs-for-local (boolean), defaults to false
This setting is not yet hooked up to anything.  In preparation for
adding/testing llgs for local Linux debugging.

llvm-svn: 216690
2014-08-28 22:17:54 +00:00
Todd Fiala 0b903a0f69 Ensure the Host wait4 thread is able to show pid in thread name.
For hosts that cannot support long thread names, shrink the host
wait4 thread name so that it does not truncate the PID in the thread name.

Change by Shawn Best.

llvm-svn: 216686
2014-08-28 21:21:39 +00:00
Todd Fiala a9882cee50 llgs: add proper exec support for Linux.
This change:
* properly captures execs in NativeProcessLinux.
* clears out all non-main-thread thread metadata in NativeProcessLinux on exec.
* adds a DidExec() method to the NativeProcessProtocol delegate.
* clears out the auxv data cache when we exec (on Linux).

This is a small part of the llgs for local Linux debugging work going on here:
https://github.com/tfiala/lldb/tree/dev-llgs-local

I'm breaking it into small patches.

llvm-svn: 216670
2014-08-28 15:46:54 +00:00
Todd Fiala 02e7181508 lldb - towards AArch64 being recognised as platform architecture
See http://reviews.llvm.org/D4381.

Change by Paul Osmialowski.

llvm-svn: 216668
2014-08-28 14:32:43 +00:00
Jim Ingham 1bb0750b98 Make it clear in the help that "breakpoint command add" will act on the last set
breakpoint if no breakpoint id is specified.

<rdar://problem/17885160>

llvm-svn: 216637
2014-08-28 00:50:17 +00:00
Todd Fiala 76e0fc9884 Add some logging around Process attaching and inferior exec handling.
llvm-svn: 216630
2014-08-27 22:58:26 +00:00
Jim Ingham dc498e516f A quoted - is not the beginning of an option, and should not be completed as such. This was causing:
(lldb) disassemble -n '-<TAB>

to crash.

<rdar://problem/18134531>

llvm-svn: 216626
2014-08-27 22:06:58 +00:00
Jim Ingham 4eb1b271fc Make it clear that the load_addr property on SBAddress relies on lldb.target,
and so can only be used in the script interpreter.

llvm-svn: 216625
2014-08-27 22:05:14 +00:00
Zachary Turner 0b9bab48bb Fix linker error due to missing static variable instantiation.
llvm-svn: 216612
2014-08-27 20:44:26 +00:00
Zachary Turner 4e82ec9caa Create a HostProcess class.
This is a lightweight wrapper around a pid.  It is intended to be
lightweight enough to serve as a replacement anywhere we currently
store a pid.  It provides convenience methods and common process
operations.

This patch does not yet make use of HostProcess anywhere.

llvm-svn: 216607
2014-08-27 20:15:30 +00:00
Zachary Turner 58a559c07e Update LLDB to use LLVM's DynamicLibrary.
LLDB had implemented its own DynamicLibrary class for plugin
support.  LLVM has an equivalent mechanism, so this patch deletes
the duplicated code in LLDB and updates LLDB to reference the
mechanism provided by LLVM.

llvm-svn: 216606
2014-08-27 20:15:09 +00:00
Rafael Espindola 2443e706c1 Update for LLVM API change.
llvm-svn: 216603
2014-08-27 20:09:08 +00:00
Todd Fiala 737f43628a llgs: remove all Initialize() calls except for Debugger::Initialize().
See thread here:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140825/012580.html

The original change I made there was due to a segfault.  That was
caused by me directly calling PluginManager::Initialize (), with
PluginManager::Initialize() depending on HostInfo::Initialize () to
have been called already (which it wasn't).

The call to PluginManager::Initialize () was erroneous (at least at the 
current time) since that method is already called by Debugger::Initialize()'s 
implementation.

We will want to revisit initializing a smaller core of the debugger
suitable for lldb-gdbserver and lldb-platform.

llvm-svn: 216581
2014-08-27 19:56:58 +00:00
Todd Fiala 22972a7c59 NativeThreadLinux: remove translation of some Linux signals to gdb signals.
I copied this originally based on what debugserver was doing.  This appears to
be incorrect and unncessary for Linux.  The LinuxSignals on the lldb side
don't look for these and therefore they get handled incorrectly.

Leaving the hook in place since I think darwin will continue to need to
translate those signal numbers.

llvm-svn: 216564
2014-08-27 17:11:56 +00:00
Todd Fiala 1d6082ff17 lldb Missing ARM64 breakpoint opcode for ProcessPOSIX added.
See http://reviews.llvm.org/D5078.

Change by Paul Osmialowski.

llvm-svn: 216559
2014-08-27 16:32:02 +00:00
Todd Fiala e4d6922ceb lldb AArch64 should be listed as yet another 64-bit architecture in HostInfoBase.
See http://reviews.llvm.org/D5070.

Change by Paul Osmialowski.

llvm-svn: 216556
2014-08-27 16:21:41 +00:00