Commit Graph

891 Commits

Author SHA1 Message Date
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
Jim Ingham 306b62b4ae Switch SBWatchpoint::SetEnabled over to using Process::{Enable,Disable}Watchpoint.
We don't have a good story for what happens to watchpoints when you don't
have a process, or if your process exits.  Clearing that up will instruct 
how to fix this for real.

Also added a test to make sure disable->enable works as well.
This resolves llvm.org/pr30789.

llvm-svn: 285742
2016-11-01 20:37:02 +00:00
Todd Fiala 4190199568 change ProcessAttach test to no-debug-info
Fixes:
https://bugs.swift.org/browse/SR-3103

llvm-svn: 285726
2016-11-01 18:50:34 +00:00
Dimitar Vlahovski 5a19c0cc50 Minidump plugin: Fix flaky test
Summary:
One of the tests was flaky, because similarly to
https://reviews.llvm.org/D18697 (rL265391) - if there is a process running
which is with the same PID as in the core file, the minidump
core file debugging will fail, because we get some information from the
running process.
The fix is routing the ProcessInfo requests through the Process class
and overriding it in ProcessMinidump to return correct data.

Reviewers: labath

Subscribers: lldb-commits, beanz

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

llvm-svn: 285698
2016-11-01 15:48:24 +00:00
Chris Bieneman 5d51a76994 [Test-Suite] Speculative fix for darwin bots
When building with Xcode it looks like some of the logic in my test changes went haywire. This should fix it.

llvm-svn: 285646
2016-10-31 22:06:52 +00:00
Dimitar Vlahovski 7b18dd4f77 Minidump plugin: Adding ProcessMinidump, ThreadMinidump and register the plugin in SystemInitializerFull
Summary:
This plugin resembles the already existing Windows-only Minidump plugin.
The WinMinidumpPlugin uses the Windows API for parsing Minidumps
while this plugin is cross-platform because it includes a Minidump
parser (which is already commited)

It is able to produce a backtrace, to read the general puprose regiters,
inspect local variables, show image list, do memory reads, etc.

For now the only arches that this supports are x86_32 and x86_64.
This is because I have only written register contexts for those.
Others will come in next CLs.

I copied the WinMinidump tests and adapted them a little bit for them to
work with the new plugin (and they pass)
I will add more tests, aiming for better code coverage.

There is still functionality to be added, see TODOs in code.

Reviewers: labath, zturner

Subscribers: beanz, mgorny, modocache, lldb-commits, amccarth

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

llvm-svn: 285587
2016-10-31 15:35:18 +00:00
Chris Bieneman f8ac2da114 [Test Suite] Pull generateSource into lldbtest
Summary:
Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework.

This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 285542
2016-10-31 04:48:19 +00:00
Chris Bieneman bd6d69987c [Test Suite] Properly respect --framework option
Summary:
dotest.py has a framework option that is not respected. This patch makes the framework path properly configurable via the --framework option.

This patch also adds a function to the lldbtest.Base class named "hasDarwinFramework" which allows us to not rely on the host platform to determine if a framework is present. If running on Darwin, and not building a framework, this will follow the *nix code paths which are appropriate for Darwin.

Reviewers: tfiala

Subscribers: lldb-commits, mgorny

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

llvm-svn: 285541
2016-10-31 04:48:10 +00:00
Chris Bieneman 614dc150ec Revert "[Test Suite] Pull generateSource into lldbtest"
This reverts commit r285357.

I committed this patch accidentally out of order. Will recommit when the change this depends on is landed.

llvm-svn: 285361
2016-10-27 23:18:52 +00:00
Chris Bieneman f817bae161 [Test Suite] Pull generateSource into lldbtest
Summary:
Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework.

This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 285357
2016-10-27 22:52:32 +00:00
Enrico Granata c046497bf0 Add support for "type lookup" to find C and C++ types
This is an important first step in closing the functionality gap between "type lookup" and "images lookup -t"

rdar://28971388

llvm-svn: 285332
2016-10-27 18:44:45 +00:00
Enrico Granata 73418dfe61 Fix an issue where frame variable -s <varname> would not show the scope even though the user asked for it
Part of rdar://28434047

llvm-svn: 285226
2016-10-26 19:17:49 +00:00
Pavel Labath 42eb6908e0 Don't set a software stepping breakpoint at 0 on arm or mips.
Summary:
Check whether the setting the breakpoint failed during instruction emulation. If
it did, the next pc is likely in unmapped memory, and the inferior will crash
anyway after the next instruction. Do not return an error in this case, but just
continue stepping.
Reenabled the crash during step test for android/linux.

Reviewers: labath

Subscribers: aemerson, rengolin, tberghammer, danalbert, srhines, lldb-commits

Differential Revision: https://reviews.llvm.org/D25926
Author: Jason Majors <jmajors@google.com>

llvm-svn: 285187
2016-10-26 11:13:56 +00:00
Jim Ingham f2673d6480 SBWatchpoint::Disable doesn't actually work. Add a test that shows this.
Next to fix it!

llvm-svn: 285153
2016-10-26 01:09:21 +00:00