Commit Graph

9416 Commits

Author SHA1 Message Date
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
Todd Fiala 8b55cce84c lldb Missing break statement added.
See http://reviews.llvm.org/D5069.

Change by Paul Osmialowski.

llvm-svn: 216554
2014-08-27 16:12:35 +00:00
Todd Fiala 4207968d33 Add Linux support for get thread area on ARM64 using ProcessMonitor debugging.
See http://reviews.llvm.org/D5073.

Change by Paul Osmialowski.

llvm-svn: 216553
2014-08-27 16:05:26 +00:00
Matthew Gardiner 5f67579f69 Add support for kalimba architecture variants 3, 4 and 5.
Add entries to core_definitions and elf_arch_entries for
those variants. Select the subtype for the variant by parsing
the e_flags field of the elf header.

llvm-svn: 216541
2014-08-27 12:09:39 +00:00
Enrico Granata 4419d539cf Add __NSCFDictionary to the list of NSDictionary-like types for which we know to generate synthetic children
llvm-svn: 216513
2014-08-27 01:10:27 +00:00
Jason Molenda 33a3017a7d Clean up after the multithreaded test case finishes.
Patch by Sean Callanan.
<rdar://problem/18140875> 

llvm-svn: 216504
2014-08-26 23:31:00 +00:00
Enrico Granata 689cdb1894 There seems to be no sane reason for a test case to enable logging every time it runs.. probably leftover from when I was debugging it
llvm-svn: 216502
2014-08-26 23:27:51 +00:00
Jason Molenda f37b7c79a3 Don't have ProcessMachCore::CanDebug use the Target's arch when
creating the ModuleSpec to load the core file - we won't have a fat
core file and we can end up with cpu subtype mismatches if the core
file header isn't written out completely accurately.  We need to
be a little loose in this particular case.
<rdar://problem/17843388>

llvm-svn: 216498
2014-08-26 22:39:03 +00:00
Enrico Granata 59953f0dbe It was pointed out to me that an offset of 0 makes sense for ObjC, but not always for C++, and this API claims to be general enough that it should not drop C++ usability on the floor for no good reason. Fix it with an explicit offset argument
llvm-svn: 216487
2014-08-26 21:35:30 +00:00
Bruce Mitchener ca7b0aaa36 [dwarf] Add new language enumerations.
This updates the DWARF language identifiers to include recent additions to
the DWARF 5 specification (draft).

llvm-svn: 216486
2014-08-26 21:22:49 +00:00
Enrico Granata 32556cda18 Add an API on ValueObject to generate a 'synthetic child' of base class type. Note that in this commit, the term synthetic child is not meant to refer to data formatters, but to the programmatically-generated children stored inside a ValueObject itself
llvm-svn: 216483
2014-08-26 20:54:04 +00:00
Todd Fiala 6c9053ef20 Added a couple more gdb-remote tests to ensure qProcessInfo on darwin is not defining triple.
And likewise for qProcessInfo on Linux, but ensures cputype/cpusubtype is not defined.  The
Apple case is the more important one, since we take a slightly different path to initialize
ProcessGDBRemote-related remote host/process info if triple is present.

Related to http://llvm.org/bugs/show_bug.cgi?id=20755.

llvm-svn: 216473
2014-08-26 18:40:56 +00:00
Todd Fiala c540dd0daf Fix llgs to send triple for non-Apple platforms and lldb to interpret correctly.
This change addresses this bug:
http://llvm.org/bugs/show_bug.cgi?id=20755

This change:
* Modifies llgs to send triple instead of cputype and cpusubtype when not on Apple platforms in qProcessInfo.
* Modifies lldb's GDBRemoteCommunicationClient to handle the triple returned from qProcessInfo if given.
  When given, it will prefer to use triple over cputype and cpusubtype.
* Adds gdb-remote protocol tests to verify that cputype and cpusubtype are specified on darwin, and that triple is specified on Linux.

llvm-svn: 216470
2014-08-26 18:21:02 +00:00
Todd Fiala f76a891299 Refactored existing gdb-remote qProcessInfo tests into separate python file.
I'm about to add some more qProcessInfo tests so I wanted to first pull them out
of the monolithic TestLldbGdbServer test case class.

Related to http://llvm.org/bugs/show_bug.cgi?id=20755

llvm-svn: 216465
2014-08-26 17:19:10 +00:00
Matthew Gardiner e81df3bbc9 Remove the hostname part from compilation directories, if supplied by
DWARF2/3 compliant producers.

llvm-svn: 216440
2014-08-26 06:57:23 +00:00