Commit Graph

12244 Commits

Author SHA1 Message Date
Pavel Labath
db2f8a3cfd Add the correct decorator to TestCreateDuringInstructionStep
apparently, just placing the file under linux/ does not make the test linux specific. :)

llvm-svn: 245848
2015-08-24 15:49:12 +00:00
Pavel Labath
d3aaa18e5d Fix TestCreateDuringInstructionStep on i386
llvm-svn: 245842
2015-08-24 14:24:20 +00:00
Pavel Labath
0f4b17d12c Simplify NativeThreadLinux includes
there is no need to include architecture-specific register contexts when the generic one will
suffice.

llvm-svn: 245839
2015-08-24 13:25:54 +00:00
Pavel Labath
84f43f36f3 Make TestCreateDuringInstructionStep linux-specific
Summary:
There were a number of issues about the way I have designed this test originally:
- it relied on single-stepping through large parts of code, which was slow and unreliable
- the threading libraries interfered with the exact thing we wanted to test

For this reason, I have rewritted the test using low-level linux api, which allows the test to be
much more focused. The functionality for other platforms will need to be tested separately.

Reviewers: tberghammer

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 245838
2015-08-24 13:23:48 +00:00
Tamas Berghammer
e5197af450 Fix teardown cleanup in TestRecursiveTypes
llvm-svn: 245836
2015-08-24 10:31:36 +00:00
Tamas Berghammer
42ecef3b15 Add absolute load address support for the DynamicLoader plugins
The POSIX linker generally reports the load bias for the loaded
libraries but in some case it is useful to handle a library based on
absolute load address. Example usecases:
* Windows linker uses absolute addresses
* Library list came from different source (e.g. /proc/<pid>/maps)

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

llvm-svn: 245834
2015-08-24 10:21:55 +00:00
Pavel Labath
b9cc0c7593 [NativeProcessLinux] Pass around threads by reference
Summary:
Most NPL private functions took (shared) pointers to threads as arguments. This meant that the
callee could not be sure if the pointer was valid and so most functions were peppered with
null-checks. Now, I move the check closer to the source, and pass around the threads as
references (which are then assumed to be valid).

Reviewers: tberghammer

Subscribers: lldb-commits

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

llvm-svn: 245831
2015-08-24 09:22:04 +00:00
Keno Fischer
6e77677f7b Also initialize ScriptInterpreterNone if Python is disabled
Summary: We get an assertion otherwise because the None Interpreter cannot be found

Reviewers: zturner

Subscribers: zturner, lldb-commits

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

llvm-svn: 245808
2015-08-23 09:05:29 +00:00
Zachary Turner
21708cf970 Revert "Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD."
This reverts commit 7749a10ddbe22767d0e055753c674fcde7f28d39.

This commit introduces about 15-20 new test failures with windows local
targets.

llvm-svn: 245765
2015-08-21 23:57:25 +00:00
Zachary Turner
2156787b96 XFAIL pthreads test on Windows.
This test needs to be ported to c++ threads.

llvm-svn: 245751
2015-08-21 22:11:50 +00:00
Zachary Turner
b20bafaec8 Fix TestPaths on Windows.
llvm-svn: 245750
2015-08-21 22:11:40 +00:00
Zachary Turner
7c9e1c0bef XFAIL the last Windows test that calls a function in the target.
llvm-svn: 245749
2015-08-21 22:11:31 +00:00
Zachary Turner
6df0cbc040 Skip TestCreateAfterAttach on Windows.
As with every other platform, this test occasionally hangs on
Windows.

llvm-svn: 245748
2015-08-21 22:11:21 +00:00
Zachary Turner
28ee0cd30e XFAIL Tests that require C++ exceptions on Windows.
clang-cl does not yet support C++ exceptions, so these tests will
not even compile.

Re-enabling these tests is tracked by llvm.org/pr24538

llvm-svn: 245747
2015-08-21 22:11:09 +00:00
Stephane Sezer
705ffc1794 Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD.
Summary:
This commit implements basic DidAttach and DidLaunch for the windows
DynamicLoader plugin which allow us to load shared libraries from the
inferior.

At the moment, I'm unsure how we're going to gather the load address of
the main module over gdb protocol so I always use an offset of 0, which
works well for processes we create ourselves (no randomization). I will
address this point later on.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 245725
2015-08-21 19:28:34 +00:00
Stephane Sezer
2618e91240 Implement handling of library: keys in thread stop replies.
Summary:
When a windows remote stops because of a DLL load/unload, the debug server
sends a stop reply packet that contains a `library` key with any value (usually
just `library:1`). This indicates to the debugger that a library has been
loaded or unloaded and that the list of libraries should be refreshed (usually
with `qXfer:libraries:read`).

This change just triggers a call to `LoadModules()` which in turns will send a
remote library read command when a stop reply that requests it is received.

Reviewers: clayborg, zturner, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 245708
2015-08-21 16:51:56 +00:00
Tamas Berghammer
f9787b40f7 Fix BuildAddressRangeTable function when no debug arranges present
llvm-svn: 245696
2015-08-21 12:14:50 +00:00
Tamas Berghammer
9a293accbe Fix type of dw_form_t in dwarf.h
llvm-svn: 245695
2015-08-21 12:14:47 +00:00
Pavel Labath
b3b1f467ce Increase timeout in TestExpressionInSyscall
test times out on the windows->android buildbot (probably due to android emulator being slow)

llvm-svn: 245691
2015-08-21 10:52:02 +00:00
Tamas Berghammer
f5d3e66bf5 Fix assertion failure caused by r245546
Change the way EmulateInstruction::eContextPopRegisterOffStack handled
in UnwindAssemblyInstEmulation::WriteRegister to accomodate for
additional cases when eContextPopRegisterOffStack (pop PC/FLAGS).

llvm-svn: 245690
2015-08-21 10:49:09 +00:00
Pavel Labath
57f4f1737f Add repro test case for bug #24530
llvm-svn: 245687
2015-08-21 10:38:31 +00:00
Pavel Labath
f90777826a [NativeProcessLinux] Reduce the number of casts
Summary:
NPL used to be peppered with casts of the NativeThreadProtocol objects into NativeThreadLinux. I
move these closer to the source where we obtain these objects. This way, the rest of the code can
assume we are working with the correct type of objects.

Reviewers: ovyalov, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 245681
2015-08-21 09:13:53 +00:00
Jason Molenda
6d9fe8c156 The llvm Triple for an armv6m now comes back as llvm::Triple::thumb.
This was breaking disassembly for arm machines that we force to be
thumb mode all the time because we were only checking for llvm::Triple::arm.
i.e.

armv6m (ARM Cortex-M0)
armv7m (ARM Cortex-M3)
armv7em (ARM Cortex-M4)

<rdar://problem/22334522>

llvm-svn: 245645
2015-08-21 00:13:37 +00:00
Oleksiy Vyalov
549718563d Make UriParser to support [$HOSTNAME] notation.
http://reviews.llvm.org/D12025

llvm-svn: 245639
2015-08-20 23:09:34 +00:00
Stephane Sezer
8fa7afe683 Run clang-format on DynamicLoaderWindowsDYLD.
Summary:
This uses the .clang-format at the root of the LLDB repo and is just a
mechanical change that precedes more work in this file.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 245634
2015-08-20 22:30:20 +00:00
Zachary Turner
075c6ee843 Change TestBSDArchives to expectedFailureWindows.
llvm-svn: 245631
2015-08-20 22:25:45 +00:00
Zachary Turner
1844284403 [Windows] XFAIL tests that require calling a function in target.
This has known issues on Windows.  Fixing this is tracked by
http://llvm.org/pr21765

llvm-svn: 245630
2015-08-20 22:09:35 +00:00
Zachary Turner
02ca878711 XFAIL breakpoint tests on Windows
llvm.org/pr24528 tracks fixing this test.

llvm-svn: 245629
2015-08-20 22:09:08 +00:00
Zachary Turner
9509c356db XFAIL TestBSDArchives.py on Windows
llvm.org/pr24527 tracks this bug.  Makefile.rules does not know
how to build static libraries on Windows.

llvm-svn: 245628
2015-08-20 22:08:57 +00:00
Zachary Turner
6313884914 XFAIL TestAnonymous.test_expr_null_with_dwarf on Windows.
This bug is tracked in llvm.org/pr21550, and also reproduces on
FreeBSD apparently.

llvm-svn: 245627
2015-08-20 22:08:48 +00:00
Zachary Turner
8b14fd9070 [ProcessWindows] Fix rare crash on shutdown.
There might be an underlying race condition here that should be
figured out, but this at least prevents the crash for the time
being and doesn't appear to have any adverse effects.

llvm-svn: 245626
2015-08-20 22:08:38 +00:00
Stephane Sezer
c6845a0ddd Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.
Summary:
This is useful when dealing with Windows remote that use only the
qXfer:libraries command which returns absolute base addresses, as
opposed to qXfer:libraries-svr4 which returns relative offsets for
module bases.

Reviewers: clayborg, zturner, ADodds

Subscribers: lldb-commits

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

llvm-svn: 245625
2015-08-20 22:07:48 +00:00
Chaoren Lin
ee3c206021 Inline fake snprintf to avoid linkage issues on Windows.
Summary:
dllexport doesn't work if linking against a static library with its own
copy of snprintf.

Reviewers: zturner

Subscribers: zturner, lldb-commits

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

llvm-svn: 245610
2015-08-20 20:53:15 +00:00
Stephane Sezer
03fc3f7657 Fix some format strings in ProcessGDBRemote.cpp.
Summary: Size specifier should come after `%` not before.

Reviewers: clayborg, ADodds

Subscribers: lldb-commits

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

llvm-svn: 245608
2015-08-20 20:43:29 +00:00
Pavel Labath
c6a144b0aa Increase timeout in TestCallWithTimeout to reduce flakyness
The test was flaky on the android buildbot, because the 10ms test completed before we got a
chance to interrupt it. I increase the duration to 50ms to hopefully get more consistent results.

llvm-svn: 245555
2015-08-20 12:12:09 +00:00
Pavel Labath
090152bd1f Skip TestCreateDuringInstructionStep on android aarch64
we are unable to step through _M_start_thread due to atomic instruction sequences.

llvm-svn: 245552
2015-08-20 11:37:19 +00:00
Sagar Thakur
8536fd1b64 [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue
Eliminated ENABLE_128_BIT_SUPPORT and union ValueData from Scalar.cpp and use llvm::APInt and llvm::APFloat for all integer and floating point types. Also used Scalar in RegisterValue.cpp

Reviewers: tberghammer, ovyalov, clayborg, labath
Subscribers: lldb-commits, nitesh.jain, jaydeep 
Differential: http://reviews.llvm.org/D12100
llvm-svn: 245547
2015-08-20 09:12:46 +00:00
Tamas Berghammer
99c40e673a Improve instruction emulation based stack unwinding
On ARM there is no difference petween a pop and a load instruction so
a register can be loaded multiple times during the function. Add check
to threat the load as a restore only if it do the restore from the
same location where the register was saved.

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

llvm-svn: 245546
2015-08-20 09:09:01 +00:00
Pavel Labath
0e1d729b75 [NativeProcessLinux] Fix a bug in instruction-stepping over thread creation
Summary:
There was a bug in NativeProcessLinux, where doing an instruction-level single-step over the
thread-creation syscall resulted in loss of control over the inferior. This happened because
after the inferior entered the thread-creation maintenance stop, we unconditionally performed a
PTRACE_CONT, even though the original intention was to do a PTRACE_SINGLESTEP. This is fixed by
storing the original state of the thread before the stop (stepping or running) and then
performing the appropriate action when resuming.

I also get rid of the callback in the ThreadContext structure, which stored the lambda used to
resume the thread, but which was not used consistently.

A test verifying the correctness of the new behavior is included.

Reviewers: ovyalov, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 245545
2015-08-20 09:06:12 +00:00
Jason Molenda
91e468c0ce If the filename specified by plugin.process.gdb-remote.target-definition-file,
doesn't exist, see if it needs tilde expansion before we ignore it completely.

llvm-svn: 245537
2015-08-20 04:29:46 +00:00
Jason Molenda
5543abb036 When the target definition is unparseable, print an error message
to the user.  e.g. specified via the
plugin.process.gdb-remote.target-definition-file 
setting.  Currently we silently ignore the target definition if
there is a parse error.

llvm-svn: 245536
2015-08-20 03:05:09 +00:00
Chaoren Lin
99f25befee XTIMEOUT TestIntegerTypesExpr for Darwin.
llvm-svn: 245532
2015-08-20 01:26:57 +00:00
Paul Herman
6e0fe6fbf5 Fix tests to work on remote targets.
llvm-svn: 245515
2015-08-19 22:44:48 +00:00
Paul Herman
641e1987d6 Fix evaluation of global operators in C++
llvm-svn: 245508
2015-08-19 21:44:56 +00:00
Paul Herman
493bb398e7 Improve tests regarding imported namespaces and chained calls in C++
llvm-svn: 245505
2015-08-19 21:23:01 +00:00
Adrian McCarthy
61ede1519c Read exception records from Windows mini dump
Differential Revision: http://reviews.llvm.org/D12126

llvm-svn: 245495
2015-08-19 20:43:22 +00:00
Dawn Perchik
a431f152df [lldb-mi] Add (gdb) prompt after =breakpoint-modified and =breakpoint-created.
Reviewed by: abidh, ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12113

llvm-svn: 245488
2015-08-19 20:04:03 +00:00
Chaoren Lin
b0138025ec XTIMEOUT TestChangeProcessGroup for Linux.
llvm-svn: 245477
2015-08-19 18:39:25 +00:00
Chaoren Lin
febef1b017 XTIMEOUT TestEvents and TestThreadStates for Windows to Android.
llvm-svn: 245464
2015-08-19 17:22:12 +00:00
Chaoren Lin
d904371271 XTIMEOUT TestExitDuringStep for Darwin.
llvm-svn: 245460
2015-08-19 17:13:02 +00:00