Commit Graph

15728 Commits

Author SHA1 Message Date
Jason Molenda 4f27ffb138 weak-link debugserver against the LoggingSupport framework;
systems without this framework will not get a link error.

<rdar://problem/30158797> 

llvm-svn: 292880
2017-01-24 04:16:03 +00:00
Pavel Labath 1d5855b107 Replace getcwd with the llvm equivalent
Summary:
getcwd() is not available (well.. um.. deprecated?) on windows, and the way
PosixApi.h is providing it causes strange compile errors when it's included in
the wrong order. The best way to avoid that is to just not use chdir.

This replaces all uses of getcwd in generic code. There are still a couple of
more uses, but these are in platform-specific code.

chdir() is causing a similar problem, but for that there is no llvm equivalent
for that (yet).

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 292795
2017-01-23 15:56:45 +00:00
Jason Molenda 777fcecf8f Add a catch-all line for detecting dyld in the inferior process
shlibs so we don't miss dyld.
<rdar://problem/30128580> 

llvm-svn: 292696
2017-01-21 01:17:36 +00:00
Pavel Labath e0a5b575a6 Prevent client from querying each thread's PC at each stop.
Summary:
The server was no longer sending the thread PCs the way the client
expected them.
I changed the server to send them back as a threadstop info field,
similar to the Apple version of the server.
I also changed the client to look for them there, before querying the
server.
I added a test to ensure the server doesn't stop sending them.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D28880
Author: Jason Majors

llvm-svn: 292611
2017-01-20 14:17:16 +00:00
Hafiz Abid Qadeer b1554311d3 Fix more unused variable warnings when asserts are disabled.
llvm-svn: 292598
2017-01-20 10:24:03 +00:00
Hafiz Abid Qadeer 4687db0e09 Provide a substitute to load command of gdb.
For bare-metal targets, lldb was missing a command like 'load' in gdb
which can be used to create executable image on the target. This was
discussed in
http://lists.llvm.org/pipermail/lldb-dev/2016-December/011752.html

This commits adds an option to "target module load" command to provide
that functionality. It does not set the PC to entry address which will
be done separately.

Reviewed in https://reviews.llvm.org/D28804

llvm-svn: 292499
2017-01-19 17:32:50 +00:00
Pavel Labath a6321a8e95 Refactor logging in NativeProcessLinux
Use the LLDB_LOG macro instead of the more verbose if(log) ... syntax.

I have also consolidated the log channels (everything now goes to the posix
channel, instead of a mixture of posix and lldb), and cleaned up some of the
more convoluted log statements.

llvm-svn: 292489
2017-01-19 15:26:04 +00:00
Hafiz Abid Qadeer 05008cac15 Avoid unused variable warning when assert is disabled.
llvm-svn: 292488
2017-01-19 15:11:01 +00:00
Jason Molenda 848c7be02a Fix a problem with the new dyld interface code -- when a new process
starts up, we need to clear the target's image list and only add
the binaries into the target that are actually present in this
process run.

<rdar://problem/29857613> 

llvm-svn: 292454
2017-01-19 00:20:29 +00:00
Pavel Labath c69d0a203b Fix new Log unit test
the test was flaky because I specified the format string for the process id
incorrectly. This should fix it.

llvm-svn: 292414
2017-01-18 17:31:55 +00:00
Pavel Labath a92d6230da Fix windows build for previous commit
We get an error about a redefinition of getcwd(). This seems to fix it.

llvm-svn: 292364
2017-01-18 12:29:51 +00:00
Pavel Labath 107d9bbd6c Add a more succinct logging syntax
This adds the LLDB_LOG macro, which enables one to write more succinct log
statements.
if (log)
  log->Printf("log something: %d", var);
becomes
LLDB_LOG(log, "log something: {0}, var);

The macro still internally does the "if(log)" dance, so the arguments are only
evaluated if logging is enabled, meaning it has the same overhead as the
previous syntax.

Additionally, the log statements will be automatically prefixed with the file
and function generating the log (if the corresponding new argument to the "log
enable" command is enabled), so one does not need to manually specify this in
the log statement.

It also uses the new llvm formatv syntax, which means we don't have to worry
about PRIx64 macros and similar, and we can log complex object (llvm::StringRef,
lldb_private::Error, ...) more easily.

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

llvm-svn: 292360
2017-01-18 11:00:26 +00:00
Pavel Labath e5cfc67113 [cmake] Make lldb build with the android ndk toolchain file
Summary:
The NDK cmake toolchain file defines CMAKE_SYSTEM_NAME=Android, so switch the
build to use that. I have also updated the in-tree toolchain file to do that
(instead of defining __ANDROID_NDK__), so it can still be used to build.
After migrating the last bits of non-toolchainy bits out of the in-tree
toolchain, I intend to delete it.

Reviewers: tberghammer, danalbert

Subscribers: srhines, mgorny, lldb-commits

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

llvm-svn: 292212
2017-01-17 11:55:00 +00:00
Pavel Labath 238169db60 Fix windows unit tests
The unit test I added in the previous commit discovered a bug in
PrependPathComponent on windows -- it was calling SetFile with the host native
path syntax, whereas it should be explicitly specifying the path syntax (as
AppendPathComponent does). This fixes it.

llvm-svn: 292106
2017-01-16 12:15:42 +00:00
Pavel Labath 59d725cabf FileSpec: Fix PrependPathComponent("/")
Summary:
PrependPathComponent was unconditionally inserting path separators between the
path components. This is not correct if the prepended path is "/", which caused
problems down the line. Fix the function to use the same algorithm as
AppendPathComponent and add a test. This fixes one part of llvm.org/pr31611.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 292100
2017-01-16 10:07:02 +00:00
Omair Javaid 56e70dd8cf Fix TestRegisterVariables for linux arm/arm64 gcc ver > 5
We are going to turn off buffer overflow introduced by gcc by turning off
FORTIFY_SOURCE.

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

llvm-svn: 291949
2017-01-13 19:28:42 +00:00
Pavel Labath 0cfd7dc9ea Remove a couple of Stream flags
Summary:
I came across this while trying to understand what Log::Debug does. It turns out
it does not do anything, as there is no instance of someone setting a debug flag
on a stream. The same is true for the Verbose and AddPrefix flags. Removing
these will enable some cleanups in the Logging class, and it brings us closer
towards the long term goal of standardizing on llvm stream classes.

I have removed these flags and all code the code which tested for their
presence -- there wasn't much of it, mostly in SymbolFileDWARF, which is
probably going away at some point anyway.

The eBinary flag still has some users, so I am letting it life for the time
being.

Reviewers: clayborg, zturner

Subscribers: aprantl, beanz, lldb-commits

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

llvm-svn: 291895
2017-01-13 10:41:59 +00:00
Omair Javaid eaed600a21 Fix log typo in ABISysV_arm64.cpp
This commit fixes a typo in ABISysV_arm64.cpp.
Log was reporting a call to ABISysV_x86_64::PrepareTrivialCall.

llvm-svn: 291889
2017-01-13 09:06:58 +00:00
Chris Bieneman 095f633b74 [CMake] Fix finding LLDBWrapPython.cpp in Framework build
The framework build was constructing the path to LLDBWrapPython incorrectly. It is apparently always in the scripts directory.

llvm-svn: 291788
2017-01-12 18:45:59 +00:00
Pavel Labath eff6e83f23 Fix gcc build for r291756
I have accidentally added extra llvm:: namespace qualification.

llvm-svn: 291763
2017-01-12 11:36:56 +00:00
Pavel Labath 3284684dd1 Add format_provider for the Error class
Summary:
The formatter supports the same options as the string-like classes, i.e. the
ability to truncate the displayed string. I don't anticipate it would be much
used, but it seems consistent.

Reviewers: zturner, clayborg

Subscribers: mgorny, lldb-commits

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

llvm-svn: 291759
2017-01-12 11:13:24 +00:00
Pavel Labath 4294de3aa0 Fix build for clang r291753
llvm-svn: 291756
2017-01-12 10:44:16 +00:00
Richard Smith 2245293541 Update to match clang r291737.
llvm-svn: 291738
2017-01-12 02:37:54 +00:00
Pavel Labath 00b3f3c11b XFAIL TestRegisterVariables on gcc-4.8-x86_64
I have previously enabled this test for this configuration. However, it turns
out it only passes for gcc-4.9.

llvm-svn: 291563
2017-01-10 14:39:26 +00:00
Tamas Berghammer 556b1611cd Improve Type::GetTypeScopeAndBasenameHelper and add unit tests
Previously it failed to handle nested types inside templated classes
making it impossible to look up these types using the fully qualified
name.

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

llvm-svn: 291559
2017-01-10 11:13:59 +00:00
Pavel Labath e92b965bbf [cmake] Fix LLVM_LINK_LLVM_DYLIB build, again
The llvm_config hack for lldb-server is only necessary for !DYLIB builds, as
otherwise we would get unresolved symbols from lldb libraries which do not track
their dependencies correctly (all of them). In a DYLIB build, the so will
already be added to the link dependencies and we can use that to resolve all
missing symbols.

The proper fix for this would be to have each lldb library track its
dependencies correctly.

llvm-svn: 291555
2017-01-10 09:40:38 +00:00
Nitesh Jain f440244d67 [LLDB][MIPS] Fix TestLldbGdbServer failure for MIPS
Reviewers: labath, clayborg

Subscribers: jaydeep, bhushan, lldb-commits, slthakur

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

llvm-svn: 291554
2017-01-10 09:33:43 +00:00
Nitesh Jain 2ee6762b55 [LLDB][MIPS] Revert TestLldbGdbServer failure for MIPS
llvm-svn: 291553
2017-01-10 09:18:56 +00:00
Nitesh Jain f468b5d32f [LLDB][MIPS] Fix TestLldbGdbServer failure for MIPS
Reviewers: labath, clayborg

Subscribers: jaydeep, bhushan, lldb-commits, slthakur

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

llvm-svn: 291549
2017-01-10 08:20:01 +00:00
Kuba Mracek 89c3170d61 Stop limiting the number of TSan backtrace size to 8
We currently limit the length of TSan returned backtraces to 8, which is not necessary (and a bug, most likely). Let's remove this.

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

llvm-svn: 291522
2017-01-10 01:14:52 +00:00
Michal Gorny eb200b2ccf [cmake] Obtain LLVM_CMAKE_PATH from llvm-config
Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from
llvm-config instead of reconstructing it locally.

llvm-svn: 291500
2017-01-09 23:12:37 +00:00
Tamas Berghammer 1c62e0356d Fix dereferencing of pointers to empty classes
llvm-svn: 291350
2017-01-07 16:39:07 +00:00
Tamas Berghammer 7850602f0a Remove an incorrect byte size calculation in DWARFASTParserClang
llvm-svn: 291349
2017-01-07 16:39:02 +00:00
Zachary Turner 5a4167fbd3 Install lldb Python module on Windows.
Patch by Vadim Chugunov
Differential Revision: https://reviews.llvm.org/D27476

llvm-svn: 291291
2017-01-06 22:05:35 +00:00
David Blaikie 8fda2b3c91 Reapply "Fixes for Clang API changes to use std::shared_ptr"
Aleksey Shlyapnikov found the memory leak I introduced, recommitted the
Clang change with a fix for this.

This reapplies r291200 reverted in r291250

llvm-svn: 291271
2017-01-06 19:49:05 +00:00
David Blaikie 64fb405836 Revert "Fixes for Clang API changes to use std::shared_ptr"
The original Clang change caused a memory leak detected by asan.
Reverting while I investigate.

This reverts commit r291200.

llvm-svn: 291250
2017-01-06 17:47:15 +00:00
Pavel Labath c523c38fcc Another windows build fix
llvm-svn: 291234
2017-01-06 13:07:09 +00:00
Pavel Labath bda6fb7389 Attempt to fix windows build for r291198
llvm-svn: 291233
2017-01-06 12:41:15 +00:00
Pavel Labath 684c2c9394 Fix clang build for r291198
Older clangs (<=3.6) complain about a redefinition when we try to specialize a
templace function declared with = delete. Instead, I just don't define the
function body, which will trigger a linker error  if someone tries to use an
unknown function.

llvm-svn: 291226
2017-01-06 10:20:32 +00:00
Pavel Labath a284b76d9e Revert "XFAIL an lldb-mi test"
The clang bug is fixed now. This reverts commit r291100.

llvm-svn: 291225
2017-01-06 10:20:29 +00:00
Pavel Labath 927ec4b5ac Consolidate file handle usage in Editline.cpp
Summary:
To implement wide character reading, editline was mixing FILE*-based access with
a Connection-based one (plus it did some selects on the raw FD), which is very
fragile. Here, I replace it with one which uses only a Connection-based reads.
The code is somewhat longer as I had to read characters one by one to detect the
end of the multibyte sequence.

I've verified that international characters still work in lldb command line on
OSX.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 291220
2017-01-06 09:27:38 +00:00
David Blaikie a77ec68e50 Revert part of cleanup to fix a build break
Wasn't sure I could include ErrorHandling.h here, and evidently I wasn't
building this part (must've made the change using sed after getting
tired of fixing each compilation error individually).

llvm-svn: 291204
2017-01-06 01:42:56 +00:00
David Blaikie e9c678cfca Fixes for Clang API changes to use std::shared_ptr
llvm-svn: 291200
2017-01-06 00:38:12 +00:00
David Blaikie 73902cc0ac Fix -Wunused-function warning by preprocessor conditionalizing the function the same way as the caller
llvm-svn: 291199
2017-01-06 00:38:10 +00:00
David Blaikie a322f36cfd Make lldb -Werror clean for -Wstring-conversion
Also found/fixed one bug identified by this warning in
RenderScriptx86ABIFixups.cpp where a string literal was being used in an
effort to provide a name for an instruction/register, but was instead
being passed as the bool 'isVolatile' parameter.

llvm-svn: 291198
2017-01-06 00:38:06 +00:00
Hafiz Abid Qadeer 66c007d507 Skip a test on darwin.
My earlier commit today seem to cause a failure on a darwin buildbot.
I am skipping the test while I investigate the failure.

llvm-svn: 291118
2017-01-05 15:09:07 +00:00
Hafiz Abid Qadeer 5e9bfc671b [lldb-mi] Fix implementation for a few mi commands
Summary:
Some of the mi commands implemented in lldb-mi are incomplete/not confirming to the spec.
- `gdb-show` and `gdb-set` doesn't support getting/setting `disassembly-flavor`
- `environment-cd` should also change the working directory for inferior
- debugger CLI output should be printed as console-stream-output record, rather than being dumped directly
to stdout
- `target-select` should provide inner error message in mi response

Related bug report:
- https://llvm.org/bugs/show_bug.cgi?id=28026
- https://llvm.org/bugs/show_bug.cgi?id=28718
- https://llvm.org/bugs/show_bug.cgi?id=30265

Reviewers: ki.stfu, abidh

Subscribers: abidh, ki.stfu, lldb-commits

Tags: #lldb

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

llvm-svn: 291104
2017-01-05 13:23:47 +00:00
Pavel Labath 763f1c453b Fix jModulesInfo handling for cross-path syntax debugging
We were sending paths with the host path separator, which meant the remote
target did not understand our packets correctly.

llvm-svn: 291103
2017-01-05 13:18:46 +00:00
Pavel Labath f31c9d27a4 Silence some -Wstring-conversion warnings
lldbassert(!"foo") -> lldbassert(0 && "foo")

In one case, this actually detected a logic error in the assertion (missing !).

llvm-svn: 291102
2017-01-05 13:18:42 +00:00
Pavel Labath b982b6db51 XFAIL an lldb-mi test
the test fails due to a bug in ToT clang

llvm-svn: 291100
2017-01-05 12:03:49 +00:00
Luke Drummond 47d6416189 Add a debuginfo version check for RenderScript modules
Added an extra field parser to the `RSModuleDescriptor` class enabling us to
check whether the versions of LLVM used to generated the debug symbols match
across the RenderScript compiler frontend (llvm-rs-cc) and backend (bcc); if
they do not, we warn the user that the debugging experience may be suboptimal
as LLVM IR debug information has no compatibility guarantees.

llvm-svn: 290957
2017-01-04 12:11:04 +00:00
Chris Bieneman 5f0793b36c [CMake] Fix install rules for tools included in the framework
The logic for install rules was wrong for tools included in the framework if the framework build is disabled.

llvm-svn: 290934
2017-01-04 03:36:35 +00:00
Jason Molenda 0da64d8503 Remove SymbolFilePDBTests.cpp from the list of tests to include in the
lldb-gtest binary that xcode builds for -scheme lldb-gtest; these tests
won't run on macosx systems.  Fixes testsuite failures we started
seeing after 290819.

<rdar://problem/29853778> 

llvm-svn: 290917
2017-01-04 00:01:25 +00:00
Tamas Berghammer a6f5795ae2 Improve the performance of jModulesInfo in lldb-server
Previously it parsed /proc/<pid>/maps for every module separately
resulting in a very slow response time. This CL add some caching and
optimizes the implementation to improve the code from O(n*m) to O(n+m)
where n is the number of modules requested and m is the number of
files mapped into memory.

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

llvm-svn: 290895
2017-01-03 16:29:43 +00:00
Pavel Labath 0ecce2300a Fix-up TestLinuxCore for r290874
r290874 enabled the s390x test, which caused the rest of the tests to start
misbehaving. This is because this test switches the selected platform and the
change persists.

This fixes it by explicitly resetting the platform in a similar way to the gcore
tests do. Potentially we should consider re-setting the platform globally
between each test run to better protect tests from each other.

llvm-svn: 290890
2017-01-03 13:18:12 +00:00
Howard Hellyer 9434690ab7 Simplify reading of Linux notes to correctly handle endianess.
Summary:
This patch changes and simplifies the way notes are read from Linux Elf cores.
The current implementation copies the bytes from the notes directly over the lldb structure for 64 bit cores and reads field by field for 32 bit cores. Reading the bytes directly only works if the endianess of the core dump and the platform that lldb are running on matches. The case statements for s390x and x86_64 would would only work on big endian systems and little endian systems respectively. That meant that x86_64 generally worked but s390x didn't unless you were on s390x or another big endian platform.
This patch just reads field by field on all platform and updates the field by field version to allow for those fields which are word size instead of fixed size. It should also slightly simplify adding support for a new Linux platform.

This patch also re-enables the s390x test case in TestLinuxCore.py on all non-s390x platforms as it now passes.

Reviewers: uweigand, clayborg

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

llvm-svn: 290874
2017-01-03 11:03:14 +00:00
Omair Javaid 999266abc7 XFail TestNoreturnUnwind for arm targets
TestNoreturnUnwind fails on arm/aarch32 linux targets.

Bug is already described for x86_64 android targets in llvm.org/pr31192.

llvm-svn: 290821
2017-01-02 18:40:20 +00:00
Michal Gorny 95e2629216 [unittests] Split DWARF tests out of PDB, fix standalone build
Split the PDB tests into DWARF test and actual PDB tests, the latter
requiring DIA SDK. Use the new LLVMConfig.cmake LLVM_ENABLE_DIA_SDK
symbol to enable the PDB tests rather than relying on
llvm/Config/config.h private include file that is not available when
building standalone.

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

llvm-svn: 290819
2017-01-02 18:20:33 +00:00
Greg Clayton 8369b28da0 Fix the variable view in the "gui" curses mode so that variables whose children change will update correctly. Previously the variable view would update the children once and not change. If you were stepping through code where the dynamic type of a variable would change the value and its children, or a synthetic type (like say for a std::vector<int>), the variable view wouldn't update. Now it caches the children and uses the process stop ID to tell when the children need to be updated.
llvm-svn: 290688
2016-12-28 21:22:37 +00:00
Greg Clayton 02f74b0861 Quiet a warning where we weren't checking if this was the same and rhs.
llvm-svn: 290687
2016-12-28 21:19:42 +00:00
Luke Drummond 63dea59104 Fix a couple of incorrect format string warnings
This patch fixes use of incorrect `%zi` to format a plain `int`, and using
`%llu` to format a `uint64_t`. The fix is to use the new typesafe
`llvm::Formatv` based API.

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

llvm-svn: 290359
2016-12-22 19:15:07 +00:00
Sean Callanan 756cb33b6a specify -DNDEBUG for BNI builds of all targets in the Xcode build
llvm-svn: 290282
2016-12-21 23:21:11 +00:00
Chris Bieneman e9ce09b89f [CMake] Support distribution install for LLDB.framework
This patch adds the last bit of support to get LLVM_DISTRIBUTION_COMPONENTS working with libLLDB when built as a framework.

This patch adds dummy install targets for binaries built into the framework's Resources directory, and makes the framework's install target depend on all the binaries that get installed with the framework.

llvm-svn: 290273
2016-12-21 21:23:27 +00:00
Jim Ingham df1e4b697e Ignore SIGPIPE in the mini-driver used by these tests.
We're seeing some very occasional failures in these tests where the
mini-driver dies with a SIGPIPE.  We don't use SIGPIPE for anything, and
the main lldb driver program already ignores SIGPIPE, so ignoring it in
the mini-driver is a good way to remove these spurious failures.

<rdar://problem/29740488>

llvm-svn: 290216
2016-12-21 00:12:54 +00:00
Boris Ulasevich 9cc1e19603 Rollback my commit r290168 to fix linux tests failure. I'll be back!
llvm-svn: 290197
2016-12-20 20:00:58 +00:00
Chris Bieneman 11da40b775 [CMake] [PR31433] Fix LLDB tool installation
This resolves PR 31433.

llvm-svn: 290180
2016-12-20 16:28:18 +00:00
Boris Ulasevich 881989cb69 Bug 30863 - Step doesn't stop with coditional breakpoint on the next line
Fixed by additional completed plans detection, and applying them on breakpoint condition fail.
Thread::GetStopInfo reworked. New test added.
Review https://reviews.llvm.org/D26497
Many thanks to Jim

llvm-svn: 290168
2016-12-20 08:09:50 +00:00
Jason Molenda 97c96cb4ed Change the timeout in CallBoardSystemServiceOpenApplication to
30 seconds to match the old springboard timeout; the launcher
should time out before that and we will hopefully get back
an informative error message instead of timing out ourselves.

llvm-svn: 290163
2016-12-20 04:54:04 +00:00
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