Commit Graph

6763 Commits

Author SHA1 Message Date
Chaoren Lin 32c7265a12 Fix bug where an additional O packet is sent after inferior exits.
Summary:
ConnectionFileDescriptor::Read was returning eConnectionStatusError instead of 0
on m_shutting_down, which caused the caller to think that some number of bytes
were read.

Reviewers: jingham, vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 234341
2015-04-07 18:45:03 +00:00
Oleksiy Vyalov 1c1d76b379 Delete port forwarding if ConnectRemote fails.
http://reviews.llvm.org/D8826

llvm-svn: 234332
2015-04-07 17:23:15 +00:00
Sean Callanan 157f1af743 Fixed a problem where the second @import statement
in a session would be silently ignored by the compiler
because the compiler looked at its SourceLocation and
decided it had already handled it.

Also updated the relevant test case.

<rdar://problem/20315447>

llvm-svn: 234330
2015-04-07 17:02:02 +00:00
Tamas Berghammer 83544cf660 Ignore mapping symbols on aarch64
ELF symbol tables on aarch64 may contains some mapping symbols. They
provide information about the underlying data but interfere with symbol
look-up of lldb. They are already ignored on arm32. With this CL they
will be ignored on aarch64 also.

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

llvm-svn: 234307
2015-04-07 10:43:50 +00:00
Sean Callanan a85f0e82dc Fixed a crash because we weren't generating
type-safe relocations against @reloc_placeholder.

<rdar://problem/20438754>

llvm-svn: 234260
2015-04-06 23:51:08 +00:00
Ted Woodward e7e8e3cd89 Fix check for options in "command alias"
Summary:
"command alias" can add invalid options to the command. "command alias start process launch -s" will add an extra argument, "<no-argument>" to the alias, so it runs "process launch -s <no-argument>", which launches the process with args that include "<no-argument>".

This patch changes the text compare of the variable value with "<OptionParser::eNoArgument>" to a compare of variable value_type with OptionParser::eNoArgument. It also moves the previous test inside the if, so it won't add a trailing space if there is no argument.

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 234244
2015-04-06 21:55:14 +00:00
Enrico Granata 30f3b220d6 Fix an issue where LLDB could crash when trying to figure out the return value layout for an invalid type
llvm-svn: 234239
2015-04-06 21:39:56 +00:00
Enrico Granata dc3c3ee852 If memory read does not find a NULL terminator, still print whatever it gathered instead of just NOP'ing out
However, remark that this is an incomplete chunk of data by still emitting the "no NULL found" warning

rdar://20330073

llvm-svn: 234194
2015-04-06 18:41:17 +00:00
Greg Clayton b23c24c2a8 We have an issue where if you use a C function right now that has no prototype, it isn't marked as extern "C" and the name to lookup is some C++ mangled form of the name.
This used to be the case for "printf" before a function prototype was added to the builtin expression prefix file. This fix makes sure that if we get a mangled name that we don't find in the current target, that we only fall back to looking up function by basename if the function isn't contained in a namespace or class (no decl context).

llvm-svn: 234178
2015-04-06 17:14:02 +00:00
Zachary Turner 6f21907a89 Fix printing of function names during unwind logging.
llvm-svn: 234172
2015-04-06 16:23:30 +00:00
Ed Maste 4b1063c76c Fix FreeBSD crash after r233837
The FreeBSD debug register access is a little usual, but in any case
different from Linux. As it stands it's not possible to share an
implementation of DR_OFFSET, so revert that part of r233837 and provide
a separate FreeBSD and Linux implementation.

We'll still want a better fix, but this should restore basic
functionality (and the buildbot).

llvm-svn: 234048
2015-04-03 20:49:08 +00:00
Sean Callanan 8505434011 Added a testcase that covers loading a module and
verifying that the types from that module don't
override types from DWARF.  Also added a target setting
to LLDB so we can tell Clang where to look for these
local modules.

<rdar://problem/18805055>

llvm-svn: 234016
2015-04-03 15:39:47 +00:00
Benjamin Kramer 012e719574 Add missing semicolon in the windows plugin.
llvm-svn: 234007
2015-04-03 11:05:12 +00:00
Benjamin Kramer 3f69fa6f56 Sprinkle some #include <mutex> in files that use std::call_once.
llvm-svn: 234005
2015-04-03 10:55:00 +00:00
Bruce Mitchener 488c89ed77 Fix typo, fix build.
This typo was introduced as part of http://reviews.llvm.org/D8760

llvm-svn: 234003
2015-04-03 09:13:18 +00:00
Colin Riley 9e14f61f51 Adding the RenderScript language type.
Differential Revision: http://reviews.llvm.org/D8803

llvm-svn: 234002
2015-04-03 09:03:15 +00:00
Davide Italiano c8d69828ee [Plugin/Process] Use std::call_once() to initialize.
This replaces the home-grown initialization mechanism used before.

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

llvm-svn: 233999
2015-04-03 04:24:32 +00:00
Zachary Turner 48b475cbaa Fix warnings generated by clang-cl.
There were a couple of real bugs here regarding error checking and
signed/unsigned comparisons, but mostly these were just noise.

There was one class of bugs fixed here which is particularly
annoying, dealing with MSVC's non-standard behavior regarding
the underlying type of enums.  See the comment in
lldb-enumerations.h for details.  In short, from now on please use
FLAGS_ENUM and FLAGS_ANONYMOUS_ENUM when defining enums which
contain values larger than can fit into a signed integer.

llvm-svn: 233943
2015-04-02 20:57:38 +00:00
Zachary Turner d4e1b8685e Fix error resulting from llvm r233938.
llvm-svn: 233942
2015-04-02 20:37:10 +00:00
Greg Clayton ff0cf4f56d Don't return a reference to a temp variable.
llvm-svn: 233940
2015-04-02 20:17:08 +00:00
Greg Clayton c00ca313fd Fix a crasher that could happen when you run LLDB and evaluate an expression where the objective C runtime registers a helper function, and also have an Objective C or C++ exception breakpoint. When shutting down the process in Process::Finalize() we clear a STL collection class and that causes objects to be destroyed that could re-enter Process and cause it to try to iterate over that same collection class that is being destroyed.
Guard against this by setting a new "m_finalizing" flag that lets us know we are in the process of finalizing.

<rdar://problem/20369152>

llvm-svn: 233935
2015-04-02 18:44:58 +00:00
Jason Molenda dfb02a9e0d Handle LC_ENCRYPTION_64 in addition to LC_ENCRYPTION load commands in
Mach-O files.
<rdar://problem/20113673> 

llvm-svn: 233893
2015-04-02 05:19:33 +00:00
Jason Molenda c48ef341e1 Add a tiny bit of hardening to the eh_frame and compact unwind parsing.
When we're seeing offsets that exceed the size of our section, don't 
try to use that unwind info.
<rdar://problem/20113673> 

llvm-svn: 233886
2015-04-02 04:35:32 +00:00
Sean Callanan bc0217396e Fixed a bug where we didn't return a value from a
lambda in SymbolFileDWARFDebugMap.

<rdar://problem/20261196>

llvm-svn: 233858
2015-04-01 22:12:57 +00:00
Sean Callanan 0dc848c72f Fixed the way SymbolFileDWARFDebugMap iterates across object
files.  Before we'd give up if we found a .o that doesn't have
DWARF associated with it; now we iterate through them all.
Also made this iteration a higher-order function so that people
don't have to remember to do this right.

<rdar://problem/20261196>

llvm-svn: 233838
2015-04-01 20:43:23 +00:00
Chaoren Lin 4ced470a31 Fix issue where GPR and FPR registers have overlapping byte offsets.
Summary:
The implementation of GDBRemoteRegisterContext relies on byte offsets to cache
register values. GPR, FPR, etc. should start on different offsets. This is
correctly done in debugserver (in DNBArchImplX86_64.cpp), but not on Linux or
FreeBSD (in RegisterInfos_x86_64.h).

Test Plan: `register read st0` no longer overwrites `rbp` on Linux with LLGS.

Reviewers: sivachandra, jingham, emaste, ovyalov, clayborg

Reviewed By: clayborg

Subscribers: emaste, lldb-commits

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

llvm-svn: 233837
2015-04-01 20:40:34 +00:00
Davide Italiano 029838496f Remove dead code in ProcessPOSIX.
Differential Revision:	http://reviews.llvm.org/D8761

llvm-svn: 233831
2015-04-01 18:56:14 +00:00
Tamas Berghammer 3c0d005732 Correctly detect sign-ness of wchar_t
The underlying type of wchar_t is not defined by the standard. This CL
add logic to correctly use the type specified for the current target
based on TargetInfo.

llvm-svn: 233795
2015-04-01 09:48:02 +00:00
Oleksiy Vyalov f9da94832f Fix ForwardPortWithAdb - update device_id variable if Android device has been found.
llvm-svn: 233780
2015-04-01 02:30:17 +00:00
Chaoren Lin 0ddb72263f Implement Handle_QEnvironmentHexEncoded.
Reviewers: clayborg, ovyalov, chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

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

llvm-svn: 233768
2015-03-31 22:37:59 +00:00
Zachary Turner aa7f12be7f Fix build error due to new plugin namespaces.
llvm-svn: 233762
2015-03-31 21:38:21 +00:00
Zachary Turner e6e2bb3842 Rework LLDB system initialization.
In an effort to reduce binary size for components not wishing to
link against all of LLDB, as well as a parallel effort to reduce
link dependencies on Python, this patch splits out the notion of
LLDB initialization into "full" and "common" initialization.

All code related to initializing the full LLDB suite lives directly
in API now.  Previously it was only referenced from API, but because
it was defined in lldbCore, it would get implicitly linked against
by everything including lldb-server, causing a considerable
increase in binary size.

By moving this to the API layer, it also creates a better layering
for the ongoing effort to make the embedded interpreter replacable
with one from a different language (or even be completely removeable).

One semantic change necessary to get this all working was to remove
the notion of a shared debugger refcount.  The debugger is either
initialized or uninitialized now, and calling Initialize() multiple
times will simply have no effect, while the first Terminate() will
now shut it down no matter how many times Initialize() was called.
This behaves nicely with all of our supported usage patterns though,
and allows us to fix a number of nasty hacks from before.

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

llvm-svn: 233758
2015-03-31 21:03:22 +00:00
Greg Clayton 902716728c Make sure that "add-dsym" can't crash us when using it.
I am fixing this by:
1 - make sure we aren't trying to set the symbol file for a module to the same thing it already has and leaving it alone if it is the same
2 - keep all old symbol files around in the module in case there are any outstanding type references

<rdar://problem/18029116>

llvm-svn: 233757
2015-03-31 21:01:48 +00:00
Greg Clayton 581186ce39 Fix DynamicLoaderMacOSXDYLD to deal with new shared cache changes.
<rdar://problem/20357466>

llvm-svn: 233714
2015-03-31 17:02:36 +00:00
Mohit K. Bhakkad 09ba1a323e [LLDB][MIPS] Read/Write register for MIPS64
Patch by Sagar Thakur

Reviewers: clayborg, tberghammer.

Subscribers: jaydeep, bhushan, mohit.bhakkad, llvm-commits.

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

llvm-svn: 233685
2015-03-31 12:01:27 +00:00
Tamas Berghammer dccbfaf917 Fix type detection for 'char' variables
A char can have signed and unsigned encoding but previously lldb always
assumed it is signed. This CL adds a logic to detect the encoding of
'char' types based on the default encoding on the target architecture.
It fixes variable printing and expression evaluation on architectures
where 'char' is signed by default.

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

llvm-svn: 233682
2015-03-31 10:21:50 +00:00
Tamas Berghammer 47b11c61ca Fix Windows build after r233679
llvm-svn: 233680
2015-03-31 10:11:04 +00:00
Tamas Berghammer db264a6d09 Move several plugin to its own namespace
Affected paths:
* Plugins/Platform/Android/*
* Plugins/Platform/Linux/*
* Plugins/Platform/gdb-server/*
* Plugins/Process/Linux/*
* Plugins/Process/gdb-remote/*

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

llvm-svn: 233679
2015-03-31 09:52:22 +00:00
Chaoren Lin 2d6105cc68 Fix call to llvm::Target::createMCInstPrinter.
llvm-svn: 233655
2015-03-31 00:59:13 +00:00
Vince Harron 33aea9001a Increate backlog of lldb-platform's listener socket
lldb-platform's listener socket only had a backlog of one connection.
That means that if more than one client connected simultaneously, the
connection would be refused. The test suite can be run remotely with
dozens of threads connecting simultaneously. Raised this limit to 100
to effectively eliminate lost connections.

Test Plan:
run tests against a remote target

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

llvm-svn: 233652
2015-03-31 00:27:10 +00:00
Adrian McCarthy e704c4ffd9 Work around lack of %zd printf format specifier in MSVC libs.
llvm-svn: 233569
2015-03-30 17:46:36 +00:00
Sylvestre Ledru ebda55986a Bug 23051 - Fix build failure on Freebsd with gcc 4.9.
Patch by Craig Rodrigues

llvm-svn: 233478
2015-03-28 10:13:47 +00:00
Akira Hatanaka afbac28bb3 Fix call to MCInstPrinter::printInst to pass MCSubtargetInfo.
The interface of this function was changed in r233411.

llvm-svn: 233429
2015-03-27 21:45:58 +00:00
David Blaikie dab893cb99 Fix -Wsign-compare warning
llvm-svn: 233408
2015-03-27 20:19:14 +00:00
Ed Maste a59d4db4f7 Move debug register output into __amd64__ (FreeBSD)
This debug register diagnostic is really only applicable to amd64 at
present.

llvm-svn: 233403
2015-03-27 20:11:37 +00:00
Tamas Berghammer 492519c884 Specify LLDB_REGNUM_GENERIC_ARG* registers for arm64
llvm-svn: 233369
2015-03-27 10:29:25 +00:00
Siva Chandra 462722d135 [DWARF] Generate qualified names of functions if linkage names are missing.
Summary:
This is similar to the change introduced for variable DIEs in r233098. If the
linkage names of functions are missing in the DWARF, then their fully qualified
names (similar to the name that would be got by demangling their linkage name)
is generated using the decl context.

This change fixes TestNamespace when the test case is compiled with GCC, hence
it is enabled for GCC. The test and the test case are also enhanced to cover
variadic functions.

Test Plan: dotest.py -C <clang|gcc> -p TestNamespace

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 233336
2015-03-27 00:10:04 +00:00
Zachary Turner e6d213a84a Fix a race condition in Target::Launch
When no hijack listener is set up, the global event listener will
try to pull events off the queue, racing with the event thread.
By always forcing a hijack listener, even when one was not given,
we guarantee that the listener always gets all events.

This was causing problems in synchronous mode with the process
stop event sometimes never being picked up and causing the debugger
to hang while processing a .lldbinit file.

Reviewed by: Jim Ingham
Differential Revision: http://reviews.llvm.org/D8562

llvm-svn: 233315
2015-03-26 20:41:14 +00:00
Stephane Sezer ca05ae2bff Add an assertion for frame[0] being valid in CommandObjectThread.cpp.
Summary:
This should always be true but sometimes is not, during platform bring
up. As recommended by Jim Ingham, an assertion should be enough here to
help.
This addresses post commit comments in http://reviews.llvm.org/D8554.

Test Plan: Run unit tests.

Reviewers: jasonmolenda, emaste, jingham, clayborg

Subscribers: lldb-commits

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

llvm-svn: 233298
2015-03-26 17:47:34 +00:00
Zachary Turner aa4dabfd85 Add a --all command option to "target delete".
llvm-svn: 233283
2015-03-26 16:43:13 +00:00