Commit Graph

904 Commits

Author SHA1 Message Date
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
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
Jim Ingham 09558cb8a4 Test num locations >= 1 not == 1.
llvm-svn: 289695
2016-12-14 19:35:56 +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 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
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
Jason Molenda 74e8de063e Clean up the new TestInterruptThreadNames test a bit.
llvm-svn: 289155
2016-12-08 23:34:56 +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
Kuba Mracek 9757a934a2 Update test expectations after AddressSanitizer text descriptions changed in r288535.
llvm-svn: 288542
2016-12-02 22:11:26 +00:00
Sean Callanan cd1eb72bab Handle UTF-16 and UTF-32 constant CFStrings
We have a longstanding issue where the expression parser does not handle wide CFStrings (e.g., @"凸凹") correctly, producing the useless error message

Internal error [IRForTarget]: An Objective-C constant string's string initializer is not an array
error: warning: expression result unused
error: The expression could not be prepared to run in the target

This is just a side effect of the fact that we don't handle wide string constants when converting these to CFStringCreateWithBytes. That function takes the string's encoding as an argument, so I made it work and added a testcase.

https://reviews.llvm.org/D27291
<rdar://problem/13190557>

llvm-svn: 288386
2016-12-01 17:46:51 +00:00
Paul Robinson ba6a9a06fd PR31214: Make a test tolerate "line 0" when stepping by instruction.
Differential Revision: http://reviews.llvm.org/D27282

llvm-svn: 288282
2016-11-30 22:47:25 +00:00
Pavel Labath 1776986d75 XFAIL: TestNoreturnUnwind on android x86_64
llvm-svn: 288032
2016-11-28 14:06:56 +00:00
Pavel Labath 79724fc0ae skip android in @skipIfHostIncompatibleWithRemote
The current implementation of the decorator does not skip if the android target
arch is the same as host arch (as in both cases the platform comes out as linux).
Nonetheless android x86_64 binaries are not compatible with linux ones.

Technically this should be "skip if target is android and host is *not* android",
but currently nobody runs lldb test suite on an android host, so we don't even
have a way of specifying that the host is android.

llvm-svn: 288027
2016-11-28 12:15:19 +00:00
Pavel Labath 0143bdb871 Fix TestMiExec.test_lldbmi_exec_next_instruction
The line numbers come out slightly differently when the test is run with gcc-4.9
as a compiler. The test probably should not depend on that, but that is a
different story.

llvm-svn: 287893
2016-11-24 15:54:15 +00:00
Pavel Labath 5e7c591ac9 Enable MiExecTestCase-test_lldbmi_exec_next_instruction
Test passes consistently, at least on linux.

llvm-svn: 287887
2016-11-24 15:16:07 +00:00
Pavel Labath d399b10e01 Enable TestMultithreaded-sb_api_listener_event_process_state on linux/gcc
Passing consistently now.

llvm-svn: 287885
2016-11-24 15:10:15 +00:00
Pavel Labath 3dcc8f90a0 Enable TestBitfields on linux with clang
The test has been passing for a while now.

llvm-svn: 287884
2016-11-24 15:03:31 +00:00
Pavel Labath 15a5a21a08 Enable TestRegisterVariables for some configurations
It consistently passes for linux-clang-i386, and linux-gcc-x86_64.

llvm-svn: 287883
2016-11-24 14:54:53 +00:00
Pavel Labath 858f3756c6 Enable WatchpointPythonCommandTestCase-test_continue_in_watchpoint_command
This test passes consistently on linux, so I am removing the overall XFAIL. If it
fails on your configuration, please put a targeted xfail instead (i'll add them
my self if I get any breakage emails).

llvm-svn: 287881
2016-11-24 14:41:36 +00:00
Howard Hellyer f20b0a744f Patch for lldb bug 26322 “core load hangs”
Correct 0 byte core files uploaded by arc.

llvm-svn: 287861
2016-11-24 09:54:09 +00:00
Howard Hellyer 1a2ac9bda5 Patch for lldb bug 26322 “core load hangs”
Summary:
This patch changes the way ProcessElfCore.cpp handles signal information.
The patch changes ProcessElfCore.cpp to use the signal from si_signo in SIGINFO notes in preference to the value of cursig in PRSTATUS notes. The value from SIGINFO seems to be more thread specific. The value from PRSTATUS is usually the same for all threads even if only one thread received a signal.
If it cannot find any SIGINFO blocks it reverts to the old behaviour and uses the value from cursig in PRSTATUS. If after that no thread appears to have been stopped it forces the status of the first thread to be SIGSTOP to prevent lldb hanging waiting for any thread from the core file to change state.

The order is:
- If one or more threads have a non-zero si_signo in SIGINFO that will be used.
- If no threads had a SIGINFO block with a non-zero si_signo set all threads signals to the value in cursig in their PRSTATUS notes.
- If no thread has a signal set to a non-zero value set the signal for only the first thread to SIGSTOP.


This resolves two issues. The first was identified in bug 26322, the second became apparent while investigating this problem and looking at the signal values reported for each thread via “thread list”.

Firstly lldb is able to load core dumps generated by gcore where each thread has a SIGINFO note containing a signal number but cursig in the PRSTATUS block for each thread is 0.

Secondly if a SIGINFO note was found the “thread list” command will no longer show the same signal number for all threads. At the moment if a process crashes, for example with SIGILL, all threads will show “stop reason = signal SIGILL”. With this patch only the thread that executed the illegal instruction shows that stop reason. The other threads show “stop reason = signal 0”.

Reviewers: jingham, clayborg

Subscribers: sas, labath, lldb-commits

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

llvm-svn: 287858
2016-11-24 08:56:37 +00:00
Dimitar Vlahovski a228c46c2a ELF core: Adding parsing of the floating-point and SSE registers on x86 32/64 bit elf core files
Summary:
The floating-point and SSE registers could be present in the elf-core
file in the note NT_FPREGSET for 64 bit ones, and in the note
NT_PRXFPREG for 32 bit ones.

The entire note is a binary blob matching the layout of the x87 save
area that gets generated by the FXSAVE instruction (see Intel developers
manual for more information).

This CL mainly modifies the RegisterRead function in
RegisterContextPOSIXCore_x86_64 for it to return the correct data both
for GPR and FPR/SSE registers, and return false (meaning "this register
is not available") for other registers.

I added a test to TestElfCore.py that tests reading FPR/SSE registers
both from a 32 and 64 bit elf-core file and I have inluded the source
which I used to generate the core files.

I tried to also add support for the AVX registers, because this info could
also be present in the elf-core file (note NT_X86_XSTATE - that is the result of
the newer XSAVE instruction). Parsing the contents from the file is
easy. The problem is that the ymm registers are split into two halves
and they are in different places in the note. For making this work one
would either make a "hacky" approach, because there won't be
any other way with the current state of the register contexts - they
assume that "this register is of size N and at offset M" and
don't have the notion of discontinuos registers.

Reviewers: labath

Subscribers: emaste, lldb-commits

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

llvm-svn: 287506
2016-11-20 21:24:49 +00:00
Jim Ingham 9ac82603d5 Fix "thread step until" handling of multiple line inputs.
Also document that it handles same, and add some tests.

llvm-svn: 287386
2016-11-18 22:06:10 +00:00
Zachary Turner c156427ded Don't allow direct access to StreamString's internal buffer.
This is a large API change that removes the two functions from
StreamString that return a std::string& and a const std::string&,
and instead provide one function which returns a StringRef.

Direct access to the underlying buffer violates the concept of
a "stream" which is intended to provide forward only access,
and makes porting to llvm::raw_ostream more difficult in the
future.

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

llvm-svn: 287152
2016-11-16 21:15:24 +00:00
Adrian McCarthy 18270a843a Fix TestMiniDumpNew.py test for Python 2/3 issue
On Windows, where we use Python 3 for testing, we have to be more explicit about converting between binary and string representations.  I believe this should still work for Python 2, but I don't have a convenient way to try it out.

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

llvm-svn: 286909
2016-11-14 23:53:45 +00:00
Chris Bieneman bd3d0263f8 One more cleanup to lldb version printing
With this patch LLDB_VERSION_STRING replaces "lldb version x.x.x" if it is set. This allows builds to not display the open source version numbers if the people making the distribution overrides the LLDB_VERSION_STRING.

Since LLDB_VERSION_STRING is always overridden on Darwin, this means the first line of lldb -version on Darwin is:

lldb-360.99.0 (<repo path> revision <revision>)

llvm-svn: 286899
2016-11-14 22:43:08 +00:00
Zachary Turner c351fb1607 Disable sanitizer tests on Windows.
llvm-svn: 286722
2016-11-12 16:56:13 +00:00
Tamas Berghammer 9db74e7f1c Fix TestHelp on linux after version number syntax change
llvm-svn: 286581
2016-11-11 11:39:23 +00:00
Omair Javaid 759dc5f5cc Mark xfail TestNamespaceDefinitions for arm/aarch64 targets
Fails with all versions of arm/aarch64 gcc available on ubuntu 16.04/14.04.

Passes with Linaro GCC version >= 4.8 but fails with >= 5.0. But There are other regressions when we use Linaro GCC.

llvm-svn: 286574
2016-11-11 10:00:53 +00:00
Chris Bieneman 58ddb8d041 [Test-Suite] Fix all the sanitizer tests to be based on compiler capabilities
Summary: This patch reworks all the @skip... lines for sanitizer libraries to be based on whether or not the compiler actually works, rather than whether or not the compiler-rt sources are present in some magically derived directory.

Reviewers: lldb-commits

Subscribers: kubabrecka, tfiala

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

llvm-svn: 286490
2016-11-10 19:16:17 +00:00
Adrian McCarthy fa8c99fda9 Un-XFail test on Windows. Has been in "unexpected success" mode for a while.
llvm-svn: 286476
2016-11-10 17:21:22 +00:00
Tamas Berghammer 1875087ce6 Fix expectation in TestStaticVariables.py after rL286302
The debug info emitted by clang for static variables improved by
rL286302 and it exposed an incorrect test expactation because now LLDB
able to displays more data 9thanks to better debug info) then before.

llvm-svn: 286360
2016-11-09 11:52:12 +00:00
Pavel Labath 833e3d109b Display the pointer value in the libstdc++ unique_ptr summary
Summary:
r284830 added a summary provider for unique_ptr in libstdc++, whose value printed
the value of the pointee. This is a bit unintuitive as it becomes unobvious that
the value actually is a pointer, and we lose the way to actually obtain the
pointer value.

Change that to print the pointer value instead. The pointee value can still be
obtained through the synthetic children.

Reviewers: tberghammer, granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 286355
2016-11-09 10:42:29 +00:00
Pavel Labath 222fd13e3f Disable windows-only minidump plugin
Summary:
This commit disables the windows-only minidump plugin and enables the new
cross-platform plugin for windows minidump files. Test decorators are adjusted to
reflect that: windows minidump tests can now run  on all platforms. The exception
is the tests that create minidump files, as that functionality is not available
yet.  I've checked that this works on windows and linux.

Reviewers: amccarth, zturner

Subscribers: dvlahovski, lldb-commits

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

llvm-svn: 286352
2016-11-09 10:16:11 +00:00
Jim Ingham 6a9767c7e6 Clean up the stop printing header lines.
I added a "thread-stop-format" to distinguish between the form
that is just the thread info (since the stop printing immediately prints
the frame info) and one with more frame 0 info - which is useful for
"thread list" and the like.

I also added a frame.no-debug boolean to the format entities so you can
print frame information differently between frames with source info and those
without.

This closes https://reviews.llvm.org/D26383.
<rdar://problem/28273697>

llvm-svn: 286288
2016-11-08 20:36:40 +00:00
Chris Bieneman b6f833793d [Test Suite] Properly quote python string
Oops!

llvm-svn: 286258
2016-11-08 18:14:42 +00:00
Chris Bieneman 4b8dbcb74c [Test Suite] Attempt to fix issue zturner reported to me
Not sure why this didn't explode more massively, but this should fix the issue with the non-framework tests.

llvm-svn: 286254
2016-11-08 17:53:18 +00:00
Pavel Labath 1071ac1935 Make space for FreeBSD core file tests
This renames the functionalities/postmortem/linux-core to elf-core and puts the
"linux" part into the individual names of the core files. Since the tests for
linux and freebsd core files are going to be very similar, having them close
together means they can reuse most of the plumbing.

llvm-svn: 286101
2016-11-07 09:58:58 +00:00
Ed Maste b30841ae95 make-core.sh: add FreeBSD support
Differential Revision:	https://reviews.llvm.org/D26315

llvm-svn: 286035
2016-11-05 14:45:13 +00:00
Jim Ingham 225621596b Don't access the process in expressions w/o checking that
the process exists.

I also added some tests that crash before this fix, and work correctly after.

<rdar://problem/29083321>

llvm-svn: 285974
2016-11-03 23:42:09 +00:00
Enrico Granata 7700de8c30 Add support to the ObjC type scavenger for finding types via debug info
llvm-svn: 285941
2016-11-03 17:25:27 +00:00
Ravitheja Addepally 0f80cc84f0 Test for YMMRegisters.
Summary:
This patch contains test for reading YMM Registers. The test basically
contains an inferior that loads the ymm registers with a bit pattern
and the python test executes register read to check if the bit pattern
is correctly written in the registers. This test is repeated twice for
each register with a different pattern for better sanity.

Reviewers: tberghammer, zturner, clayborg

Subscribers: tberghammer, danalbert, srhines

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

llvm-svn: 285885
2016-11-03 08:35:55 +00:00
Jim Ingham c76c3f2f91 Fix SBWatchpoint::SetEnabled to send an event.
We really shouldn't be sending events for SB API's, dunno when we started
doing that.  We don't do it for other things.  But first restore the status quo.

llvm-svn: 285781
2016-11-02 01:06:42 +00:00
Jim Ingham 8a99f120bc Xfail this while I figure out why the event isn't getting sent.
llvm-svn: 285761
2016-11-01 22:53:54 +00:00