Commit Graph

15610 Commits

Author SHA1 Message Date
Luke Drummond f5bb1d6c4e Expression evaluation for overloaded C functions (redux)
This is a redux of [Ewan's patch](https://reviews.llvm.org/D17957) , refactored
to properly substitute primitive  types using a hook in the itanium demangler,
and updated after the previous patch went stale

The new `SubsPrimitiveParmItanium` function takes a symbol name and replacement
primitive type parameter as before but parses it using the FastDemangler, which
has been modified to be able to notify clients of parse events (primitive types
at this point).

Additionally, we now use a `set` of `ConstStrings` instead of a `vector` so
that we don't try and resolve the same invalid candidate multiple times.

Differential Revision: https://reviews.llvm.org/D27223
Subscribers: lldb-commits

llvm-svn: 290117
2016-12-19 17:22:44 +00:00
Sylvestre Ledru 521d7b45ba Fix the cmake declaration syntax
llvm-svn: 290045
2016-12-17 13:04:35 +00:00
Sylvestre Ledru 47b071deff Support of lldb on Kfreebsd
Summary: Patch by Pino Toscano. Reported in http://bugs.debian.org/835665

Reviewers: tfiala, emaste

Subscribers: beanz, mgorny, emaste, krytarowski, brucem, tberghammer, danalbert, srhines, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D23977

llvm-svn: 290044
2016-12-17 12:48:06 +00:00
Zachary Turner 91ad7a9b69 Fix compiler warning.
llvm-svn: 289994
2016-12-16 21:35:12 +00:00
Luke Drummond c3d0165c49 Fix broken escaping of commands in the build
A combination of broken escaping in CMake and in the python swig
generation scripts meant that the swig generation step would fail
whenever there were spaces or special characters in parameters passed to
swig.

The fix for this in CMakeLists is to use the VERBATIM option on all
COMMAND-based custom builders relying on CMake to properly escape each
argument in the generated file.

Within the python swig scripts, the fix is to call subprocess.Popen with
a list of raw argument strings rather than ones that are incorrectly
manually escaped, then passed to a shell subprocess via
subprocess.Popen(' '.join(params)). This also prevents nasty things
happening such as accidental command-injection.

This allows us to have the swig / python executables in paths containing
special chars and spaces, (or on shared storage on Win32, e.g
\\some\path or C:\Program Files\swig\swig.exe).

Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D26757

llvm-svn: 289956
2016-12-16 16:38:25 +00:00
Hafiz Abid Qadeer 95cc3456e8 Remove an unused type declaration.
llvm-svn: 289947
2016-12-16 14:44:34 +00:00
Zachary Turner 827d5d74a5 Add methods to enable using formatv syntax in LLDB.
This adds formatv-backed formatting functions in various
places in LLDB such as StreamString, logging, constructing
error messages, etc.  A couple of callsites are changed
from Printf style syntax to formatv style syntax to
illustrate its usage.  Additionally, a FileSpec formatter
is introduced so that FileSpecs can be formatted natively.

Differential Revision: https://reviews.llvm.org/D27632

llvm-svn: 289922
2016-12-16 04:27:00 +00:00
Jason Molenda 3826727453 Fix a bug when using a StructuredData darwin-log plugin
where we would insert a breakpoint into a system library
but never remove it, so the second time we ran the binary
there would be two breakpoints and the debugger would
stop there.

<rdar://problem/29654974> 

llvm-svn: 289913
2016-12-16 02:48:39 +00:00
Chris Bieneman d69b9414b3 [CMake] Refactor LLDB libraries and tools to be components
In LLVM's CMake we have a convention that components have both a build and an install target. Making LLDB follow this convention will allow LLDB to take advantage of the LLVM_DISTRIBUTION_COMPONENTS build option from LLVM.

llvm-svn: 289879
2016-12-15 22:01:17 +00:00
Chris Bieneman 1662da2832 [CMake] Ensure Python files are inside the LLDB framework bundle
When building the LLDB Framework we need to ensure that the Python files get put into the Framework before the Framework's install target can be invoked.

All files inside the Framework's Resources bundle will get copied over during the install action.

llvm-svn: 289842
2016-12-15 18:19:10 +00:00
Chris Bieneman 679d02f2a1 [CMake] Only support LLDB_BUILD_FRAMEWORK on CMake 3.7 and later
CMake's framework target generation was unable to generate POST_BUILD steps (see: https://gitlab.kitware.com/cmake/cmake/issues/16363).

It turns out working around this is really not reasonable. The more reasonable solution to me is just to not support LLDB.framework unless you are on CMake 3.7 or newer.

Since CMake 3.7.1 is released that's how I'm going to handle this.

llvm-svn: 289841
2016-12-15 18:18:47 +00:00
Hafiz Abid Qadeer f6ee79c926 Fix build for mingw.
Summary: I was building lldb using cross mingw-w64 toolchain on Linux and observed some issues. This is first patch in the series to fix that build. It mostly corrects the case of include files and adjusts some #ifdefs from _MSC_VER to _WIN32 and vice versa. I built lldb on windows with VS after applying this patch to make sure it does not break the build there.

Reviewers: zturner, labath, abidh

Subscribers: ki.stfu, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D27759

llvm-svn: 289821
2016-12-15 15:00:41 +00:00
Pavel Labath 1f2c1b6ccd Remove linux/personality.h wrapper
This code is currently unused.

Removing it should make porting of the linux plugin to NetBSD easier, and we can
always add it later if needed.

llvm-svn: 289801
2016-12-15 10:47:40 +00:00
Jim Ingham 8f7db52d9d Fix incorrectly named variables.
llvm-svn: 289746
2016-12-15 00:30:30 +00:00
Sean Callanan 237c3ed95e Adopt PrettyStackTrace in LLDB
LLDB needs some minor changes to adopt PrettyStackTrace after https://reviews.llvm.org/D27683.
We remove our own SetCrashDescription() function and use LLVM-provided RAII objects instead.
We also make sure LLDB doesn't define __crashtracer_info__ which would collide with LLVM's definition.

Differential Revision: https://reviews.llvm.org/D27735

llvm-svn: 289711
2016-12-14 21:31:31 +00:00
Jim Ingham 09558cb8a4 Test num locations >= 1 not == 1.
llvm-svn: 289695
2016-12-14 19:35:56 +00:00
Stephan Bergmann 17c7f70362 Replace APFloatBase static fltSemantics data members with getter functions
At least the plugin used by the LibreOffice build
(<https://wiki.documentfoundation.org/Development/Clang_plugins>) indirectly
uses those members (through inline functions in LLVM/Clang include files in turn
using them), but they are not exported by utils/extract_symbols.py on Windows,
and accessing data across DLL/EXE boundaries on Windows is generally
problematic.

Differential Revision: https://reviews.llvm.org/D26671

llvm-svn: 289647
2016-12-14 11:57:17 +00:00
Hafiz Abid Qadeer e00b96ecbd Remove code needed for supporting old VS versions.
Summary: This code was probably needed to support VS2013 and is not needed now. I have built it with VS and mingw. Ok to remove it?

Reviewers: zturner, abidh

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D27707

llvm-svn: 289644
2016-12-14 11:13:03 +00:00
Jason Molenda 6546b9a209 Small tweaks to the markup in StructuredDataPlugins.
llvm-svn: 289520
2016-12-13 05:59:24 +00:00
Jason Molenda 30011bf4a8 Touch-up the markup of the DarwinLog.md documentation.
llvm-svn: 289518
2016-12-13 05:54:17 +00:00
Todd Fiala 4e62292b11 Removing myself from code ownership file
I'm transitioning away from my current employer, and I do not foresee myself
spending much time on LLDB in the near future. Ideally somebody on the Google
Android team takes over the gdb-remote protocol tests, and somebody with decent
familiarity with the test suite infrastructure takes over the parallel test
runner and test event stream portions of the Python test suite.

llvm-svn: 289479
2016-12-12 22:42:00 +00:00
Pavel Labath d2396b6425 Remove some annotations from TestMultipleTargets
The test passes on linux. The i386 case is already handled by
skipIfHostIncompatibleWithRemote.

llvm-svn: 289427
2016-12-12 11:37:42 +00:00
Greg Clayton 8f61811789 Fix i386 being able to show member variables correctly by not returning empty objective C types from the runtime.
We don't parse ObjC v1 types from the runtime metadata like we do for ObjC v2, but doing so by creating empty types was ruining the i386 v1 debugging experience.

<rdar://problem/24093343>

llvm-svn: 289233
2016-12-09 17:54:59 +00:00
Greg Clayton 461ba656a5 Fix buildbots that are failing due to this test by adding all expected fails that TestMultipleDebuggers.py has.
llvm-svn: 289223
2016-12-09 16:25:13 +00:00
Greg Clayton 1c4d4d61cb Rename multiple target test so it is unique.
llvm-svn: 289222
2016-12-09 16:22:10 +00:00
Nitesh Jain 0546e845c0 [LLDB][MIPS] Fix TestWatchpointIter failure
Reviewers: jingham

Subscribers: jaydeep, bhushan, slthakur, lldb-commits

Differential Revision: https://reviews.llvm.org/D27124

llvm-svn: 289211
2016-12-09 13:54:47 +00:00
Nitesh Jain e51a967d89 [LLDB][MIPS] Fix TestMultipleHits for MIPS
Reviewers: clayborg, labath, zturner

Subscribers: jaydeep, bhushan, slthakur, lldb-commits

Differential Revision: https://reviews.llvm.org/D27085

llvm-svn: 289210
2016-12-09 13:44:15 +00:00
Nitesh Jain de5923a70a [LLDB][MIPS] Fix some test case failures due to elf_abi field of qprocessInfo packet.
Reviewers: jaydeep, bhushan, clayborg

Subscribers: slthakur, lldb-commits

Differential Revision: https://reviews.llvm.org/D26542

llvm-svn: 289209
2016-12-09 13:37:14 +00:00
Pavel Labath 73ee5c2fc4 Fix TestMultipleTargets for on x86_64 architectures
This test links against liblldb, so it can only run when the target arch is the
same arch as liblldb. We already have a decorator for that, so apply it.

While I'm in there, also mark the test as debug-info independent.

llvm-svn: 289199
2016-12-09 10:05:07 +00:00
Zachary Turner 2c84f908af Remove some more uses of Args::GetArgumentAtIndex.
llvm-svn: 289188
2016-12-09 05:46:41 +00:00
Greg Clayton 7904046c33 Calling SBDebugger::CeeateTarget being called on multiple threads was crashing LLDB.
I found the race condition in:

ScriptInterpreter *CommandInterpreter::GetScriptInterpreter(bool can_create);

More than one "ScriptInterpreter *" was being returned due to the race which caused any clients with the first one to now be pointing to freed memory and we would quickly crash.

Added a test to catch this so we don't regress.

<rdar://problem/28356584> 

llvm-svn: 289169
2016-12-09 01:21:14 +00:00
Zachary Turner 867e7d1765 Fix some occurrences of passing StringRef to Printf.
Hopefully these will all disappear in the future once we move
to formatv.

llvm-svn: 289168
2016-12-09 01:20:58 +00:00
Zachary Turner 14f6b2c035 Modernize the Args access pattern in a few more commands.
llvm-svn: 289164
2016-12-09 01:08:29 +00:00
Jason Molenda 74e8de063e Clean up the new TestInterruptThreadNames test a bit.
llvm-svn: 289155
2016-12-08 23:34:56 +00:00
Greg Clayton b5cd6e7b7e Fixed a crasher that has been borking out heap for a long time.
ThreadList had an assignment operator that didn't lock the "rhs" thread list object. This means a thread list can be mutated while it is being copied.

The copy constructor calls the assignment operator as well. So this fixes the unsafe threaded access to ThreadList which we believe is responsible for a lot of crashes.

<rdar://problem/28075793>

llvm-svn: 289100
2016-12-08 20:38:19 +00:00
Jason Molenda b3a3cd1f4e When we interrupt a process, it was possible or the thread names
to not be set by Process::WillPublicStop() so the driver won't get
access to them.  The fix is straightforward, moving the call to
WillPublicStop above the early return for the interrupt case.  (the
interrupt case does an early return because the rest of the function
is concerned with running stop hooks etc and those are not applicable
when we've interrupted the process).

Also added a test case for it.  The test case is a little complicated
because I needed to drive lldb asynchronously to give the program
a chance to get up and running before I interrupt it.  Running to
a breakpoint was not sufficient to catch this bug.

<rdar://problem/22693778> 

llvm-svn: 289026
2016-12-08 06:27:29 +00:00
Jason Molenda b2979d8464 Increase timeout for Frontboard app launch request from 9 to 20 seconds
to match other timeouts.

llvm-svn: 289023
2016-12-08 05:12:45 +00:00
Jason Molenda 49034417da Set the address size based on the target's arch instead
of using the address of the all_image_infos struct.
<rdar://problem/29547847> 

llvm-svn: 289016
2016-12-08 02:02:45 +00:00
Zachary Turner f965cc8632 Convert CommandObjectFrame to entry-based Args access.
In the process, discovered a bug related to the use of an
uninitialized-pointer, and fixed as suggested by Enrico
in an lldb-dev mailing list thread.

llvm-svn: 289015
2016-12-08 02:02:09 +00:00
Zachary Turner 4574a89051 Convert CommandObjectCommands to entry-based Args access.
llvm-svn: 289012
2016-12-08 01:31:04 +00:00
Zachary Turner 7fb5e3434b Work around a bogus warning on MSVC.
llvm-svn: 289009
2016-12-08 00:54:24 +00:00
Greg Clayton e04e5b954a Improve crashlog.py so it can handle more iOS crashlog files.
<rdar://problem/29191857>

llvm-svn: 289006
2016-12-08 00:22:45 +00:00
Greg Clayton 962364c605 Fix an unannotated fallthrough that was causing a warning.
llvm-svn: 289000
2016-12-07 23:52:27 +00:00
Greg Clayton 3ce7e99680 Fixed DoConnectRemote issues where ProcessKDP wasn't switched over to use the version that needed a StringRef as the URL, and also updated all virtual functions to say "override" to make sure this doesn't happen again.
llvm-svn: 288999
2016-12-07 23:51:49 +00:00
Pavel Labath 43d354182f Use Timeout<> in EvaluateExpressionOptions class
llvm-svn: 288797
2016-12-06 11:24:51 +00:00
Chris Bieneman 07522bb187 [CMake] Don't add gtest if it is already there
LLVM build trees export the gtest library through a special export set. If you're building against a build tree you shouldn't need to re-add gtest, but if you're building against an installed LLVM you do.

llvm-svn: 288691
2016-12-05 19:40:34 +00:00
Alexander Shaposhnikov a08ba42f1a [lldb] Update the check for Linux or FreeBSD in SymbolFileDWARF::FindFunctions
This diff
1. Adds a comment to ObjectFileELF.cpp about the current
approach to determining the OS.
2. Replaces the check in SymbolFileDWARF.cpp with a more robust one.

Test plan:
Built (on Linux) a test binary linked to a c++ shared library
which contains just an implementation of a function TestFunction,
the library (the binary itself) doesn't contain ELF notes 
and EI_OSABI is set to System V.
Checked in lldb that now "p TestFunction()" works fine 
(and doesn't work without this patch).

Differential revision: https://reviews.llvm.org/D27380

llvm-svn: 288687
2016-12-05 18:42:21 +00:00
Pavel Labath bfd6a75861 Remove superfluous android include
This file is not in the include path when building with a non-standalone
toolchain. In does not seem to be necessary anyway.

llvm-svn: 288674
2016-12-05 14:57:23 +00:00
Pavel Labath 3d9941588f Remove one more if(__ANDROID_NDK__) I missed
llvm-svn: 288673
2016-12-05 14:57:19 +00:00
Pavel Labath 7a6252158e Clean up some use of __ANDROID_NDK__ in the cmake files
Rationale:
scripts/Python/modules: android is excluded at a higher level, so no point in
  checking here
tools/lldb-mi: lldb-mi builds fine (with some cosmetic tweaks) on android, and
  there is no reason it shouldn't.
tools/lldb-server: LLDB_DISABLE_LIBEDIT/CURSES already take the platform into
  account, so there is no point in checking again.

I am reasonably confident this should not break the build on any platform, but
I'll keep an eye out on the bots.

llvm-svn: 288661
2016-12-05 11:15:36 +00:00