Commit Graph

11918 Commits

Author SHA1 Message Date
Chaoren Lin 594896fc8a Xfail pexpect tests for Windows hosts.
llvm-svn: 242457
2015-07-16 22:24:16 +00:00
Greg Clayton b887da1db3 Make sure we calculate resolver symbol addresses correctly for ARM. The trie entries have bit 0 set for Thumb functions and we need to remove that so we can correctly determine which symbols are resolvers.
<rdar://problem/21396553>

llvm-svn: 242435
2015-07-16 19:50:57 +00:00
Pavel Labath 8c0970febd Fix compiler warning in ThreadPlanStepRange
llvm-svn: 242403
2015-07-16 14:21:49 +00:00
Pavel Labath 4a4bb12e0d Add jThreadsInfo support to lldb-server
Summary:
This commit adds initial support for the jThreadsInfo packet to lldb-server. The current
implementation does not expedite inferior memory.  I have also added a description of the new
packet to our protocol documentation (mostly taken from Greg's earlier commit message).

Reviewers: clayborg, ovyalov, tberghammer

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11187

llvm-svn: 242402
2015-07-16 14:14:35 +00:00
Tamas Berghammer a0cd89a445 Revert "Default to linking lldb-server statically for Android."
With static linking lldb-server crashes in platform mode when
tries to listen on localhost:5432 on the android build bot.

This reverts commit 3ea861707dec8423746679ff496e4fd03255d4cf.

llvm-svn: 242401
2015-07-16 14:13:01 +00:00
Pavel Labath 07695bd3ae Fix compiler warning in ArchSpec
llvm-svn: 242397
2015-07-16 13:11:34 +00:00
Tamas Berghammer 287531894a Add missing include for android-arm build
llvm-svn: 242396
2015-07-16 12:35:04 +00:00
Tamas Berghammer 628365435d Improve XFAIL for test_lldb_process_load_and_unload_commands
llvm-svn: 242392
2015-07-16 10:00:06 +00:00
Pavel Labath 5abe726911 Revert "[NativeProcessLinux] Integrate MainLoop"
This seems to be causing major slowdows on the android buildbot. Reverting while I investigate.

llvm-svn: 242391
2015-07-16 08:45:03 +00:00
Jaydeep Patil 501a781998 [LLDB][MIPS] Detect MIPS application specific extensions like micromips
SUMMARY:
    The patch detects MIPS application specific extensions (ASE) like micromips by reading 
    ELF header.e_flags and SHT_MIPS_ABIFLAGS section. MIPS triple does not contain ASE 
    information like micromips, mips16, DSP, MSA etc. These can be read from header.e_flags 
    or SHT_MIPS_ABIFLAGS section.
    
    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, lldb-commits
    Differential Revision: http://reviews.llvm.org/D11133

llvm-svn: 242381
2015-07-16 03:51:55 +00:00
Jason Molenda d25d72fb79 Only include the stack memory for the caller stack
frame, don't go any further, in RNBRemote::SendStopReplyPacketForThread.

These are the memory pre-fetches in the T05 packet and are
included in every private stop that lldb does.  lldb needs, at most,
the caller stack frame so we're sending more data than needed by
including additional stack memory prefetches in this reply packet.

Once we've stopped for a public stop, we're going to do a jThreadsInfo
which will include the stack memory prefetches for all threads, 
including the one which had the stop reason.

llvm-svn: 242380
2015-07-16 03:42:40 +00:00
Jason Molenda 86a86cf725 Build ValueObjectConstResultCast.cpp.
llvm-svn: 242379
2015-07-16 03:38:17 +00:00
Siva Chandra f8877efc8b Add a class ValueObjectConstResultCast.
Summary:
Other changes around the main change include:

1. Add a method Cast to ValueObjectConstResult, ValueObjectConstResultImpl
and ValueObjectConstResultChild.

2. Add an argument |live_address| of type lldb::addr_t to the constructor
of ValueObjectConstResultChild. This is passed on to the backing
ValueObjectConstResultImpl object constructor so that the address of the
child value can be calculated properly.

Reviewers: granata.enrico, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11203

llvm-svn: 242374
2015-07-16 01:47:12 +00:00
Greg Clayton a5801ade5a Added the ability to get JSON thread stop info with thread ID and stop info only in the normal stop reply packets using the new "jthreads" key value pair.
This allows stepping operations that don't ever do a public stop to get all the info they need without having to send a jThreadsInfo packet since those tend to be large.

This patch will be followed by a patch that will detect when we do a public stop, and when that happens we will send a jThreadsInfo packet at that time to get all expedited registers and memory.

llvm-svn: 242352
2015-07-15 22:59:03 +00:00
Keno Fischer ac351b7943 [Makefiles] One more library rename to align with CMake
This one I accidentally missed last time because I confused it with
the lldbUtility library. After this, all makefile libraries should
have the same names as their CMake counterparts.

llvm-svn: 242344
2015-07-15 22:39:44 +00:00
Chaoren Lin 00d4fe43c6 Remove shell-specific code from TestLoadUnload Makefile.
Reviewers: clayborg, sivachandra

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11202

llvm-svn: 242332
2015-07-15 21:18:26 +00:00
Chaoren Lin e271658ec1 Use accept instead of accept4 for Android.
Summary:
The accept4 syscall is missing on older ARM Android kernels, and the accept()
call is implemented with the accept4 syscall, so we'll need to call the accept
syscall directly.

Reviewers: vharron, tberghammer, labath

Subscribers: ovyalov, chaoren, labath, tberghammer, aemerson, lldb-commits

Differential Revision: http://reviews.llvm.org/D10887

llvm-svn: 242319
2015-07-15 19:22:12 +00:00
Chaoren Lin f7ee0870ae Default to linking lldb-server statically for Android.
Reviewers: vharron, tberghammer

Subscribers: chaoren, labath, tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D10858

llvm-svn: 242318
2015-07-15 19:22:09 +00:00
Dawn Perchik a3ff7032c8 Fix -data-info-line when source includes column number.
This fixes an off-by-one bug in CMICmdCmdDataInfoLine::Acknowledge.  Given:
    LineEntry: \[0x0000000100000f37-0x0000000100000f45\): /path/to/file:123:1
-data-info-line would report the line as 12, omitting the last digit.

Reviewed by: ki.stfu, abidh
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11209

llvm-svn: 242306
2015-07-15 17:25:01 +00:00
Pavel Labath 827965c33c [NativeProcessLinux] Integrate MainLoop
Summary:
This commit integrates MainLoop into NativeProcessLinux. By registering a SIGCHLD handler with
the llgs main loop, we can get rid of the special monitor thread in NPL, which saves as a lot of
thread ping-pong when responding to client requests (e.g. qThreadInfo processing time has been
reduced by about 40%). It also makes the code simpler, IMHO.

Reviewers: ovyalov, clayborg, tberghammer, chaoren

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11150

llvm-svn: 242305
2015-07-15 17:20:01 +00:00
Jim Ingham 4920a4ef56 Fix another little nit with detach and keep stopped, you have to check
both for packet success and that the response is OK.

llvm-svn: 242262
2015-07-15 00:59:25 +00:00
Jason Molenda 2a66738f5c Correct length of packet that GDBRemoteCommunicationClient::Detach
should send when detaching and leaving the remote process/system
halted.  Previously only the 'D' initial char was sent, which
resumed the process like a normal detach.

llvm-svn: 242256
2015-07-15 00:16:09 +00:00
Jason Molenda 25c34d9464 Small fix to ThreadPlanStepRange::DumpRanges to logging
output when stepping through multiple ranges.

llvm-svn: 242243
2015-07-14 23:17:29 +00:00
Dawn Perchik 4154ad467b Cleanup; remove trailing spaces.
llvm-svn: 242214
2015-07-14 22:12:43 +00:00
Keno Fischer 2069de9813 [Makefiles] Align library names with CMake build
Summary: This aligns the library names used by the Makefile build to be the same as those create by the CMake build to make switching between the two easier. The only major difficulty was lldbHost which was one library in the CMake system and several in the Makefile system. Most of the other changes are trivial renames.

Reviewers: labath

Subscribers: emaste, tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D11154

llvm-svn: 242196
2015-07-14 20:25:19 +00:00
Jason Molenda fea7765219 Add comment explaning sanity check on packet size in the packet decompression method.
llvm-svn: 242184
2015-07-14 19:19:07 +00:00
Oleksiy Vyalov a3f245fff0 Use target.exec-search-paths setting when resolving executable path for remote target.
http://reviews.llvm.org/D11163

llvm-svn: 242183
2015-07-14 18:59:32 +00:00
Oleksiy Vyalov df62ed3f8b Fix temp port file path generation in lldb-platform.
http://reviews.llvm.org/D11152

llvm-svn: 242182
2015-07-14 18:54:52 +00:00
Ewan Crawford cf388ccfbc Fix LLDB Xcode build broken in r242137
llvm-svn: 242143
2015-07-14 13:29:03 +00:00
Ewan Crawford 90ff791141 Expression evaluation, a new ThreadPlanCallFunctionUsingABI for executing a function call on target via register manipulation
For Hexagon we want to be able to call functions during debugging, however currently lldb only supports this when there is JIT support. 
Although emulation using IR interpretation is an alternative, it is currently limited in that it can't make function calls.

In this patch we have extended the IR interpreter so that it can execute a function call on the target using register manipulation. 
To do this we need to handle the Call IR instruction, passing arguments to a new thread plan and collecting any return values to pass back into the IR interpreter. 

The new thread plan is needed to call an alternative ABI interface of "ABI::PerpareTrivialCall()", allowing more detailed information about arguments and return values.

Reviewers: jingham, spyffe

Subscribers: emaste, lldb-commits, ted, ADodds, deepak2427

Differential Revision: http://reviews.llvm.org/D9404

llvm-svn: 242137
2015-07-14 10:56:58 +00:00
Kate Stone ea671fbdff Fixed line wrapping for the "long help" content in LLDB commands. Content is now dynamically wrapped for the column width of the current terminal. Lines that begin with whitespace will be indented identically on subsequent lines to maintain formatting.
Existing commands supplying this type of help content have been reworked to take advantage of the changes.  In addition to formatting changes, content was changes for accuracy and clarity purposes.
    
<rdar://problem/21269977>

llvm-svn: 242122
2015-07-14 05:48:36 +00:00
Jason Molenda 21c34ac419 Fix off-by-one error in the packet decompression routine
that would not pass through empty ("unsupported packet") replies
correctly.

llvm-svn: 242119
2015-07-14 04:51:05 +00:00
Dawn Perchik aa80814c69 Fix debugserver build breakage on Mavericks after lldb commit svn 240728
vm_kernel_page_size appears to not be defined on OSX Mavericks, so the
build fails.  This patch fixes the build by calculating the pagesize if
_VM_PAGE_SIZE_H_ is not defined.

llvm-svn: 242114
2015-07-14 03:50:10 +00:00
Chaoren Lin e515a5a672 Fix FreeBSD build.
llvm-svn: 242113
2015-07-14 03:18:23 +00:00
Chaoren Lin 98d0a4b39a Refactor Unix signals.
Summary:
- Consolidate Unix signals selection in UnixSignals.
- Make Unix signals available from platform.
- Add jSignalsInfo packet to retrieve Unix signals from remote platform.
- Get a copy of the platform signal for each remote process.
- Update SB API for signals.
- Update signal utility in test suite.

Reviewers: ovyalov, clayborg

Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D11094

llvm-svn: 242101
2015-07-14 01:09:28 +00:00
Adrian McCarthy 6c40c5e031 Fix Windows build break related to MainLoop.
llvm-svn: 242079
2015-07-13 22:35:44 +00:00
Greg Clayton 3ca8f429b1 Don't crash if we are unable to get the member type.
<rdar://problem/21624447>

llvm-svn: 242076
2015-07-13 22:08:16 +00:00
Dawn Perchik 6145ad2d36 [lldb-mi] Add const qualifier to vMITextLine in InterpretCommandThisDriver.
llvm-svn: 242057
2015-07-13 20:16:13 +00:00
Pavel Labath b6fddcd735 Avoid dependency on uuid.h in MacOSXDYLD
Summary:
r241964 has added a dependency on uuid.h, which (on linux at least) necessitates instalation of a
new package. Since the only thing we need from that file is uuid_t (and this is already defined
in UuidCompatibility.h), we can avoid this dependency by making this include __APPLE__ specific.
If in future, we need more from this library, we can revisit this decision.

Reviewers: jasonmolenda

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11135

llvm-svn: 242022
2015-07-13 12:27:28 +00:00
Tamas Berghammer 5f0bc1a859 Remove hack about the size of long doubles from DataExtractor
The size of a long double was hardcoded in DataExtractor for x86 and
x86_64 architectures. This CL removes the hard coded values and use the
actual size based on the floating point semantics specified.

Differential revision: http://reviews.llvm.org/D8417

llvm-svn: 242019
2015-07-13 10:50:55 +00:00
Pavel Labath 77dc9569c6 Introduce a MainLoop class and switch llgs to use it
Summary:
This is the first part of our effort to make llgs single threaded. Currently, llgs consists of
about three threads and the synchronisation between them is a major source of latency when
debugging linux and android applications.

In order to be able to go single threaded, we must have the ability to listen for events from
multiple sources (primarily, client commands coming over the network and debug events from the
inferior) and perform necessary actions. For this reason I introduce the concept of a MainLoop.
A main loop has the ability to register callback's which will be invoked upon receipt of certain
events. MainLoopPosix has the ability to listen for file descriptors and signals.

For the moment, I have merely made the GDBRemoteCommunicationServerLLGS class use MainLoop
instead of waiting on the network socket directly, but the other threads still remain. In the
followup patches I indend to migrate NativeProcessLinux to this class and remove the remaining
threads.

Reviewers: ovyalov, clayborg, amccarth, zturner, emaste

Subscribers: tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D11066

llvm-svn: 242018
2015-07-13 10:44:55 +00:00
Tamas Berghammer c9627aeae6 Skip oatdata and oatexec symbols in system@framework@boot.oat
On Android the oatdata and the oatexec symbols in
system@framework@boot.oat covers the full .text section what causes
issues with displaying unusable symbol name to the user and very slow
unwinding speed because the instruction emulation based unwind plans
try to emulate all instructions in these symbols. Don't add these
symbols to the symbol list as they have no use for the debugger and
they are causing a lot of trouble.

Differential revision: http://reviews.llvm.org/D11065

llvm-svn: 242017
2015-07-13 09:54:41 +00:00
Sagar Thakur 6bee961a2e [LLDB][MIPS] Add mips cores in cores_match () in ArchSpec
This patch:
        - Allows mips32 cores to match with any mips32/mips64 cores.
        - Allows mips32r2 cores to match with core only up-to mips32r2/mips64r2.
        - Allows mips32r3 cores to match with core only up-to mips32r3/mips64r3.
        - Allows mips32r5 cores to match with core only up-to mips32r3/mips64r5.
        - Allows mips32r6 core to match with only mips32r6/mips64r6 or mips32/mips64.

Reviewers: emaste, jaydeep, clayborg
Subscribers: mohit.bhakkad, nitesh.jain, bhushan, lldb-commits
Differential Revision: http://reviews.llvm.org/D10921

llvm-svn: 242016
2015-07-13 09:52:06 +00:00
Jason Molenda 20ee21bde6 Add a another packet to the gdb-remote protocol,
jGetLoadedDynamicLibrariesInfos.  This packet is similar to
qXfer:libraries:read except that lldb supplies the number of solibs
that should be reported about, and the start address for the list
of them.  At the initial process launch we'll read the full list
of solibs linked by the process -- at this point we could be using
qXfer:libraries:read -- but on subsequence solib-loaded notifications,
we'll be fetching a smaller number of solibs, often only one or two.

A typical Mac/iOS GUI app may have a couple hundred different 
solibs loaded  - doing all of the loads via memory reads takes 
a couple of megabytes of traffic between lldb and debugserver.
Having debugserver summarize the load addresses of all the solibs
and sending it in JSON requires a couple of hundred kilobytes
of traffic.  It's a significant performance improvement when 
communicating over a slower channel.

This patch leaves all of the logic for loading the libraries
in DynamicLoaderMacOSXDYLD -- it only call over ot ProcesGDBRemote
to get the JSON result.

If the jGetLoadedDynamicLibrariesInfos packet is not implemented,
the normal technique of using memory read packets to get all of
the details from the target will be used.

<rdar://problem/21007465>

llvm-svn: 241964
2015-07-10 23:15:22 +00:00
Greg Clayton bf91f712b3 Don't try to make a pseudo terminal if we are launching in a separate terminal, it causes a deadlock when debugging because we create a PTY and yet it isn't hooked up to anything on the slave side.
llvm-svn: 241919
2015-07-10 18:04:46 +00:00
Sean Callanan 9ff456c8a2 Fixed a problem where variables in modules were not appropriately discovered by
the expression parser.

<rdar://problem/21395220>

llvm-svn: 241917
2015-07-10 17:34:23 +00:00
Greg Clayton fdbff2afed Don't let a test fail because of a teardown command returning an error. Use a function that doesn't check the return value.
llvm-svn: 241879
2015-07-10 00:30:22 +00:00
Chaoren Lin 1bd3c9abd8 Fix 32-bit Linux watchpoint failures.
Summary:
32-bit signed return value from ptrace got sign extended when being converted to
64-bit unsigned.

Also, replaced tabs with spaces in the source.

Reviewers: labath, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11047

llvm-svn: 241837
2015-07-09 18:35:16 +00:00
Keno Fischer 964a5c59f8 Unbreak Makefile build
llvm-svn: 241820
2015-07-09 17:09:09 +00:00
Pavel Labath d5b310f2a3 Avoid going through Platform when creating a NativeProcessProtocol instance
Summary:
This commit avoids the Platform instance when spawning or attaching to a process in lldb-server.
Instead, I have the server call a (static) method of NativeProcessProtocol directly. The reason
for this is that I believe that NativeProcessProtocol should be decoupled from the Platform
(after all, it always knows which platform it is running on, unlike the rest of lldb).
Additionally, the kind of platform actions a NativeProcessProtocol instance is likely to differ
greatly from the platform actions of the lldb client, so I think the separation makes sense.

After this, the only dependency NativeProcessLinux has on PlatformLinux is the ResolveExecutable
method, which needs additional refactoring.

This is a resubmit of r241672, after it was reverted due to build failueres on non-linux
platforms.

Reviewers: ovyalov, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D10996

llvm-svn: 241796
2015-07-09 11:51:11 +00:00