Commit Graph

620 Commits

Author SHA1 Message Date
Pavel Labath 7e49e3d97c [test] make expect_state_changes actually expect *only* them
The android dirty stderr problem has uncovered an issue where lldbutil.expect_state_changes was
reading events other than state change events, which resulted in general confusion. Make it more
strict to accept *only* state changes.

llvm-svn: 266327
2016-04-14 15:52:58 +00:00
Pavel Labath e6961d0306 [test] Relax stderr expectations on targets with chatty output
Summary:
On some android targets, a binary can produce additional garbage (e.g. warning messages from the
dynamic linker) on the standard error, which confuses some tests. This relaxes the stderr
expectations for targets known for their chattyness.

Reviewers: tfiala, ovyalov

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 266326
2016-04-14 15:52:53 +00:00
Ulrich Weigand 7e8de59b90 Fix test cases for big-endian systems
A number of test cases were failing on big-endian systems simply due to
byte order assumptions in the tests themselves, and no underlying bug
in LLDB.

These two test cases:
  tools/lldb-server/lldbgdbserverutils.py
  python_api/process/TestProcessAPI.py
actually check for big-endian target byte order, but contain Python errors
in the corresponding code paths.

These test cases:
  functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
  functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
  functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
  lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
  python_api/sbdata/TestSBData.py  (first change)
could be fixed to check for big-endian target byte order and update the
expected result strings accordingly.  For the two synthetic tests, I've
also updated the source to make sure the fake_a value is always nonzero
on both big- and little-endian platforms.

These test case:
  python_api/sbdata/TestSBData.py  (second change)
  functionalities/memory/cache/TestMemoryCache.py
simply accessed memory with the wrong size, which wasn't noticed on LE
but fails on BE.

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

llvm-svn: 266315
2016-04-14 14:35:02 +00:00
Ulrich Weigand 377e4213e1 Fixes for platforms that default to unsigned char
This fixes several test case failure on s390x caused by the fact that
on this platform, the default "char" type is unsigned.

- In ClangASTContext::GetBuiltinTypeForEncodingAndBitSize we should return
  an explicit *signed* char type for encoding eEncodingSint and bit size 8,
  instead of the default platform char type (which may be unsigned).
  This fix matches existing code in ClangASTContext::GetIntTypeFromBitSize,
  and fixes the TestClangASTContext.TestBuiltinTypeForEncodingAndBitSize
  unit test case.

- The test/expression_command/char/TestExprsChar.py test case is known to
  fail on platforms defaulting to unsigned char (pr23069), and just needs
  to be xfailed on s390x like on arm.

- The test/functionalities/watchpoint/watchpoint_on_vectors/main.c test
  case defines a vector of "char" and implicitly assumes to be signed.
  Use an explicit "signed char" instead.

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

llvm-svn: 266309
2016-04-14 14:30:12 +00:00
Ulrich Weigand bb00d0b6b2 Support Linux on SystemZ as platform
This patch adds support for Linux on SystemZ:
- A new ArchSpec value of eCore_s390x_generic
- A new directory Plugins/ABI/SysV-s390x providing an ABI implementation
- Register context support
- Native Linux support including watchpoint support
- ELF core file support
- Misc. support throughout the code base (e.g. breakpoint opcodes)
- Test case updates to support the platform

This should provide complete support for debugging the SystemZ platform.
Not yet supported are optional features like transaction support (zEC12)
or SIMD vector support (z13).

There is no instruction emulation, since our ABI requires that all code
provide correct DWARF CFI at all PC locations in .eh_frame to support
unwinding (i.e. -fasynchronous-unwind-tables is on by default).

The implementation follows existing platforms in a mostly straightforward
manner.  A couple of things that are different:

- We do not use PTRACE_PEEKUSER / PTRACE_POKEUSER to access single registers,
  since some registers (access register) reside at offsets in the user area
  that are multiples of 4, but the PTRACE_PEEKUSER interface only allows
  accessing aligned 8-byte blocks in the user area.  Instead, we use a s390
  specific ptrace interface PTRACE_PEEKUSR_AREA / PTRACE_POKEUSR_AREA that
  allows accessing a whole block of the user area in one go, so in effect
  allowing to treat parts of the user area as register sets.

- SystemZ hardware does not provide any means to implement read watchpoints,
  only write watchpoints.  In fact, we can only support a *single* write
  watchpoint (but this can span a range of arbitrary size).  In LLDB this
  means we support only a single watchpoint.  I've set all test cases that
  require read watchpoints (or multiple watchpoints) to expected failure
  on the platform.  [ Note that there were two test cases that install
  a read/write watchpoint even though they nowhere rely on the "read"
  property.  I've changed those to simply use plain write watchpoints. ]

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

llvm-svn: 266308
2016-04-14 14:28:34 +00:00
Pavel Labath 9fb77fcfef Fix test rerun logic
result_formatter used inspect.getfile() to get the python file name, which returned "*.pyc" if
the bytecode file was present. This resulted in files being displayed with the wrong extension,
and more critically, would confuse the rerun logic because it would try to rerun the pyc file
(which resulted in an empty rerun list as unittest refused to run those).

Fix: use inspect.getsourcefile() instead.

I am not sure why does was not an issue before. I can only assume that some system update
tricked python into producing bytecode files more aggressively.

llvm-svn: 266192
2016-04-13 12:05:48 +00:00
Oleksiy Vyalov 939b084bd7 Attempt to fix TestCPPBreakpointLocations on Linux/Android.
llvm-svn: 266164
2016-04-13 04:21:05 +00:00
Adrian McCarthy 0a385532dd Fix breakpoint_set_restart test for Windows
When run with the multiprocess test runner, the getchar() trick doesn't work, so ninja check-lldb would fail on this test, but running the test directly worked fine.

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

llvm-svn: 266145
2016-04-12 22:45:03 +00:00
Greg Clayton 08f5674bfe Fixed being able to set breakpoints on destructors when we don't fully specify the demangled name. So all of the following now work:
(lldb) b ~Foo
(lldb) b Foo::~Foo
(lldb) b Bar::Foo::~Foo

Improved out C++ breakpoint locations tests as well to cover this issue.

<rdar://problem/25577252>

llvm-svn: 266139
2016-04-12 22:02:37 +00:00
Jim Ingham ff7ac6a7b9 Breakpoint conditions were making result variables, which they should not do.
The result variables aren't useful, and if you have a breakpoint on a
common function you can generate a lot of these.  So I changed the
code that checks the condition to set ResultVariableIsInternal in the
EvaluateExpressionOptions that we pass to the execution.
Unfortunately, the check for this variable was done in the wrong place
(the static UserExpression::Evaluate) which is not how breakpoint
conditions execute expressions (UserExpression::Execute).  So I moved
the check to UserExpression::Execute (which Evaluate also calls) and made the
overridden method DoExecute.

llvm-svn: 266093
2016-04-12 17:17:35 +00:00
Jim Ingham 5e2b489049 'int' is reported as an exception on OS X not as a signal. I don't think
this test ever succeeded on OS X.

llvm-svn: 266092
2016-04-12 17:04:12 +00:00
Pavel Labath 541dff5acd Fixup TestFdLeak
this test was unintentionally XFAILed due to a change in the behavior of the expectedFailure
decorator. Fix that. Also, mark the test as debug-info independent while I'm in there.

llvm-svn: 266072
2016-04-12 13:55:54 +00:00
Pavel Labath ec26f3bdf3 Bump up timeout in TestGdbRemoteProcessInfo
the process info packet is slow, and sometimes it does not arrive on time when run on the android
emulator.

llvm-svn: 266058
2016-04-12 11:59:41 +00:00
Pavel Labath bc79e8923a Skip a test in TestNamespaceLookup on linux to avoid a crash
llvm-svn: 266054
2016-04-12 10:06:37 +00:00
Pavel Labath d6201b83ac Mark TestPrintStackTraces as flaky on android arm
llvm-svn: 265959
2016-04-11 16:50:08 +00:00
Adrian McCarthy 121571b7ce Retry deletion of temporary files to avoid race conditions on Windows.
Differential Revision: http://reviews.llvm.org/D18912

llvm-svn: 265948
2016-04-11 15:21:01 +00:00
Tamas Berghammer 86bc97b79e Fix makefile for TestMiThreadInfo after rL265858 (2nd try)
llvm-svn: 265921
2016-04-11 08:54:57 +00:00
Tamas Berghammer 4b28ee359f Fix makefile for TestMiThreadInfo after rL265858
The makefile was explicitly setting LDFLAGS what is breaking some rules
in the global makefile.

llvm-svn: 265920
2016-04-11 08:45:01 +00:00
Kuba Brecka 369bced2b1 Add a ThreadSanitizer testcase that tests multiple reported issues.
llvm-svn: 265906
2016-04-10 19:29:40 +00:00
Kuba Brecka 1aad8fb772 Provide more information in ThreadSanitizer's JSON data. Move remaining TSan logic from SBThread to InstrumentationRuntime plugin.
llvm-svn: 265905
2016-04-10 18:57:38 +00:00
Oleksiy Vyalov d8bcf3a74b Fix TestBreakpointSetRestart failure on Android.
llvm-svn: 265869
2016-04-09 03:08:02 +00:00
Enrico Granata f96fd0dd1d Remove what I believe are the last known instances of formatters that run code
llvm-svn: 265865
2016-04-08 22:49:31 +00:00
Chuck Ries da21e98932 -thread-info in lldbmi does not conform to protocol. Should end with current thread id
-thread-info in lldbmi does not conform to protocol. Should end with
current thread id as described here:
https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Thread-Commands.html#GDB_002fMI-Thread-Commands

When printing all threads, the current thread id should be printed
afterwards.

Example:
-thread-info
     ^done,threads=[
     {id="2",target-id="Thread 0xb7e14b90 (LWP 21257)",
        frame={level="0",addr="0xffffe410",func="__kernel_vsyscall",
                args=[]},state="running"},
     {id="1",target-id="Thread 0xb7e156b0 (LWP 21254)",
        frame={level="0",addr="0x0804891f",func="foo",
                args=[{name="i",value="10"}],
                file="/tmp/a.c",fullname="/tmp/a.c",line="158"},
                state="running"}],
     current-thread-id="1"
     (gdb)

Patch from jacdavis@microsoft.com

Reviewers: zturner, chuckr

Differential Revision: http://reviews.llvm.org/differential/revision/edit/18880/

llvm-svn: 265858
2016-04-08 22:17:53 +00:00
Enrico Granata f4d521836d Remove even more of the data formatters that silently run code
Fixes <rdar://problem/25629755>

llvm-svn: 265849
2016-04-08 21:24:24 +00:00
Oleksiy Vyalov bdea8dd57f Reset continue_after_async only if neither SIGINIT nor SIGSTOP received.
http://reviews.llvm.org/D18886

llvm-svn: 265843
2016-04-08 20:44:28 +00:00
Todd Fiala 464f7dfd04 fix missing import of 'time' in lldbutil.wait_for_file_on_target
This triggers in some timeout scenarios in the LLDB test suite.

Fixes:
https://bugs.swift.org/browse/SR-1193

llvm-svn: 265821
2016-04-08 18:06:11 +00:00
Kuba Brecka 28c081b97b Enabling AddressSanitizer tests, they should pass now (and this time I mean it).
llvm-svn: 265656
2016-04-07 11:01:05 +00:00
Pavel Labath e91e7bab8d Enable TestDebugBreak on x86_64 as well
Test passes there, and this would have helped me catch the snafu in the previous commit.

llvm-svn: 265650
2016-04-07 09:25:04 +00:00
Pavel Labath b1f7d4d79c Fixup TestLinuxCore on windows
test_same_pid_running couldn't delete the temporary files, while we had them open. Deleting the
target should make things work.

llvm-svn: 265529
2016-04-06 11:05:30 +00:00
Tamas Berghammer b05a37f347 Fix and xfail TestRegisterVariables after rL265498
llvm-svn: 265527
2016-04-06 10:34:29 +00:00
Pavel Labath a95e0effc0 Fixup r265398
llvm-svn: 265524
2016-04-06 08:55:31 +00:00
Todd Fiala 58c4dd7a71 make TestRegisterVariables slightly more resilient
This test sets the compiler optimization level to -O1 and
makes some assumptions about how local frame vars will be
stored (i.e. in registers).  These assumptions are not always
true.

I did a first-pass set of improvements that:
(1) no longer assumes that every one of the target locations has
    every variable in a register.  Sometimes the compiler
    is even smarter and skips the register entirely.
(2) simply expects one of the 5 or so variables it checks
    to be in a register.

This test probably passes on a whole lot more systems than it
used to now.  This is certainly true on OS X.

llvm-svn: 265498
2016-04-06 01:14:37 +00:00
Adrian McCarthy c8b1be0c71 Revert "XFail TestImport.py on Windows because Python 3 import rules don't work that way."
This reverts commit e5f0ba4fcf977ad6baaaca700d3646675cdac19b.

llvm-svn: 265476
2016-04-05 21:49:41 +00:00
Adrian McCarthy 9def2afd5c XFail TestImport.py on Windows because Python 3 import rules don't work that way.
llvm-svn: 265461
2016-04-05 20:49:09 +00:00
Stephane Sezer 0036ac4236 Fix dotest.py '-p' option for multi-process mode
Summary:
The '-p' option for dotest.py was ignored in multiprocess mode,
as the -p argument to the inferior would overwrite the -p argument
passed on the command line.

Reviewers: zturner, tfiala

Subscribers: lldb-commits, sas

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

Change by Francis Ricci <fjricci@fb.com>

llvm-svn: 265422
2016-04-05 17:34:38 +00:00
Kuba Brecka d9f724e04a Reverting r265401 ("Enabling AddressSanitizer tests, they should work now.")
llvm-svn: 265406
2016-04-05 15:22:00 +00:00
Kuba Brecka b693068cfe Enabling AddressSanitizer tests, they should work now.
llvm-svn: 265401
2016-04-05 14:14:07 +00:00
Kuba Brecka 3b275db195 Fixing AddressSanitizer tests (update expectations for current ASan, make it work on OS X 10.10 and older).
llvm-svn: 265400
2016-04-05 14:13:22 +00:00
Tamas Berghammer 19fc1d4e3c [NFC] Cleanup the code used to run shell commands from tests
Previously we had 3 different method to run shell commands on the
target and 4 copy of code waiting until a given file appears on the
target device (used for syncronization). This CL merges these methods
to 1 run_platform_command and 1 wait_for_file_on_target functions
located in some utility classes.

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

llvm-svn: 265398
2016-04-05 14:08:18 +00:00
Kuba Brecka a0beb762a4 Enabling TSan tests, they should work now.
llvm-svn: 265396
2016-04-05 13:59:45 +00:00
Kuba Brecka 0bab7bf9f4 Fix ThreadSanitizer test cases to work on OS X 10.10 and older.
llvm-svn: 265395
2016-04-05 13:57:42 +00:00
Tamas Berghammer 97b3a76234 Fix TestPlatformProcessConnect after rL265357
llvm-svn: 265392
2016-04-05 13:18:08 +00:00
Pavel Labath a933d5179e Fix a bug in linux core file handling
Summary:
There was a bug in linux core file handling, where if there was a running process with the same
process id as the id in the core file, the core file debugging would fail, as we would pull some
pieces of information (ProcessInfo structure) from the running process instead of the core file.
I fix this by routing the ProcessInfo requests through the Process class and overriding it in
ProcessElfCore to return correct data.

A (slightly convoluted) test is included.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 265391
2016-04-05 13:07:16 +00:00
Enrico Granata 7a37df3fc3 Improve the way LLDB escapes arguments before passing them to the shell
Teach LLDB that different shells have different characters they are sensitive to, and use that knowledge to do shell-aware escaping

This helps solve a class of problems on OS X where LLDB would try to launch via sh, and run into problems if the command line being passed to the inferior contained such special markers (hint: the shell would error out and we'd fail to launch)
This makes those launch scenarios work transparently via shell expansion

Slightly improve the error message when this kind of failure occurs to at least suggest that the user try going through 'process launch' directly

Fixes rdar://problem/22749408

llvm-svn: 265357
2016-04-04 22:46:38 +00:00
Todd Fiala d955f89914 disabled TSAN tests until the author can help track down CI failures
These tests run fine locally for me but are failing on the Green Dragon
OS X CI.

llvm-svn: 265342
2016-04-04 19:58:24 +00:00
Pavel Labath 67f641dd33 Fix flakyness in TestWatchpointMultipleThreads
This addresses the same problem as r264846 (the test not expecting the situation when two thread
hit the watchpoint simultaneously), but for a different test.

llvm-svn: 265294
2016-04-04 14:18:21 +00:00
Todd Fiala a3d15f3a5e skip and xfail two std::list-related libcxx tests that fail on OS X with TOT libcxx
Enrico has a bug on him to make this work across older libcxx list
and newer libcxx list simultaneously.  Needed in preparation of
getting the OS X public CI to run the TSAN tests.

tracked by:
rdar://25499635

llvm-svn: 265188
2016-04-01 21:36:58 +00:00
Enrico Granata aa05cf9980 Remove more of the code-running ObjC data formatter support
llvm-svn: 265181
2016-04-01 20:33:22 +00:00
Todd Fiala 3249911439 mark TestCallWithTimeout.py XFAIL on macosx.
This test is failing on the CI but not locally for me.  Needs
investigation.

tracked by:
https://llvm.org/bugs/show_bug.cgi?id=27182

llvm-svn: 265175
2016-04-01 18:42:45 +00:00
Todd Fiala 8ac4fd7b21 Guard xunit result test class and test method name access to prevent testbot breakage
http://llvm.org/bugs/show_bug.cgi?id=27179

llvm-svn: 265165
2016-04-01 17:59:51 +00:00
Pavel Labath f0537825a2 Fix clean rule for a makefile
The test was failing on windows because the clean rule (which is executed even if the test is
skipped) returned an error there.

llvm-svn: 265140
2016-04-01 12:59:37 +00:00
Pavel Labath 3f081c8210 Don't vary debug info for lldb-server tests
Summary:
Debug info is used only by the client and lldb-server tests do not even have the client component
running, as they communicate with the server directly. Therefore, running the tests for each
debug info type is unnecessarry.

This adds general ability to mark a test class as not dependent on debug info, and marks all
lldb-server tests as such.

Reviewers: tberghammer, tfiala

Subscribers: lldb-commits

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

llvm-svn: 265017
2016-03-31 14:22:52 +00:00
Enrico Granata 45d0e238d5 Add --help and --long-help options to 'command alias' such that one can now specify a help string for an alias as they are defining it
llvm-svn: 264980
2016-03-31 01:10:54 +00:00
Enrico Granata b64d3d61e3 Enhance the 'type X list' commands such that they actually alert the user if no formatters matching the constraints could be found
llvm-svn: 264957
2016-03-30 22:45:13 +00:00
Sean Callanan 7326b69de4 Fixed a problem where a dSYM wasn't properly found because it had the wrong name
<rdar://problem/25447765>

llvm-svn: 264914
2016-03-30 20:17:41 +00:00
Pavel Labath ec62c0559f Fix flakyness in TestWatchpointMultipleThreads
Summary:
the inferior in the test deliberately does not lock a mutex when accessing the watched variable.
The reason for that is unclear as, based on the logs, the original intention of the test was to
check whether watchpoints get propagated to newly created threads, which should work fine even
with a mutex. Furthermore, in the unlikely event (which I have still observed happening from time
to time) that two threads do manage the execute the "critical section" simultaneously, the test
will fail, as it is expecting the watchpoint "hit count" to be 1, but in this case it will be 2.

Given this, I have simply chose to lock the mutex always, so that we have more predictible
behavior. Watchpoints being hit simultaneously is still (and correctly!) tested by
TestConcurrentEvents.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 264846
2016-03-30 08:43:54 +00:00
Greg Clayton 3de2a90574 Fixed the failing test TestCommandScriptImmediateOutput on MacOSX. Turns out that there are few things to watch out for when writing pexpect tests:
1 - If you plan on looking for the "(lldb) " prompt as a regular expression, look for "\(lldb\) " so you don't just find "lldb".
2 - Make sure to not use colors (specify --no-use-colors as an option to lldb when launching it) as our editline will print:

"(lldb) <color junk>(lldb) "

where "<color junk>" is a work around that is used to allow us to colorize our prompts. The bad thing is this will make pexepct code like this not execute as you would expect:

prompt = "\(lldb\) "
self.child.sendline("breakpoint set ...", prompt)
self.child.sendline("breakpoint clear ...", prompt)

The problem is the first "sendline" will create two lldb prompts and will match both the first and second prompts and you output will get off. So be sure to disable colors if you need to.

Fixed a case where "TestCommandScriptImmediateOutput.py" would fail if you have spaces in your directory names. I modified custom_command.py to use shlex to parse arguments and I quoted the file path we sent down to the custom_command.write_file function.

llvm-svn: 264810
2016-03-30 00:02:13 +00:00
Jim Ingham e5ee6f04ab Figure out what the fixed expression is, and print it. Added another target setting to
quietly apply fixits for those who really trust clang's fixits.

Also, moved the retry into ClangUserExpression::Evaluate, where I can make a whole new ClangUserExpression 
to do the work.  Reusing any of the parts of a UserExpression in situ isn't supported at present.

<rdar://problem/25351938>

llvm-svn: 264793
2016-03-29 22:00:08 +00:00
Sean Callanan 863fab69a2 Expose top-level Clang expressions via the command line and the API.
Top-level Clang expressions are expressions that act as new translation units,
and define their own symbols.  They do not have function wrappers like regular
expressions do, and declarations are persistent regardless of use of the dollar
sign in identifiers.  Names defined by these are given priority over all other
symbol lookups.

This patch adds a new expression option, '-p' or '--top-level,' which controls
whether the expression is treated this way.  It also adds a flag controlling 
this to SBExpressionOptions so that this API is usable externally.  It also adds
a test that validates that this works.  (The test requires a fix to the Clang
AST importer which I will be committing shortly.)

<rdar://problem/22864976>

llvm-svn: 264662
2016-03-28 21:20:05 +00:00
Enrico Granata 3c110dd6b4 Fix an issue with nested aliases where the help system wouldn't correctly track the fact that an alias is an alias to a dash-dash alias
(and I hope I typed the word 'alias' enough times in this commit message :-)

llvm-svn: 264468
2016-03-25 21:59:06 +00:00
Jim Ingham a1e541bf9f Use Clang's FixItHints to correct expressions with "trivial" mistakes (e.g. "." for "->".)
This feature is controlled by an expression command option, a target property and the
SBExpressionOptions setting.  FixIt's are only applied to UserExpressions, not UtilityFunctions,
those you have to get right when you make them.

This is just a first stage.  At present the fixits are applied silently.  The next step
is to tell the user about the applied fixit.

<rdar://problem/25351938>

llvm-svn: 264379
2016-03-25 01:57:14 +00:00
Stephane Sezer c5273d929f Make File option flags consistent for Python API
Summary:
Fixes SBCommandReturnObject::SetImmediateOutputFile() and
SBCommandReturnObject::SetImmediateOutputFile() for files opened
with "a" or "a+" by resolving inconsistencies between File and
our Python parsing of file objects.

Reviewers: granata.enrico, Eugene.Zelenko, jingham, clayborg

Subscribers: lldb-commits, sas

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

Change by Francis Ricci <fjricci@fb.com>

llvm-svn: 264351
2016-03-24 22:22:20 +00:00
Enrico Granata 3cf9ff12c5 Make 'type lookup' print an error message instead of complete radio silence when it can't find a type matching user input
It would be fun to make it provide suggestions (e.g. 'can't find NString, did you mean NSString instead?'), but this worries me a little bit on the account of just how thorough of a type system scan it would have to do

llvm-svn: 264343
2016-03-24 21:32:39 +00:00
Kuba Brecka 6a83143650 Add ThreadSanitizer debugging support.
This patch adds ThreadSanitizer support into LLDB:
- Adding a new InstrumentationRuntime plugin, ThreadSanitizerRuntime, in the same way ASan is implemented.
- A breakpoint stops in `__tsan_on_report`, then we extract all sorts of information by evaluating an expression. We then populate this into StopReasonExtendedInfo.
- SBThread gets a new API, SBThread::GetStopReasonExtendedBacktraces(), which returns TSan’s backtraces in the form of regular SBThreads. Non-TSan stop reasons return an empty collection.
- Added some test cases.

Reviewed by Greg Clayton.

llvm-svn: 264162
2016-03-23 15:36:22 +00:00
Enrico Granata d033e1cef5 Change 'apropos' such that it doesn't look into the "long help/syntax" strings for commands
This solves issues such as 'apropos foo' returning valid matches just because syntax examples happen to use 'foo' as a placeholder token

Fixes rdar://9043025

llvm-svn: 264123
2016-03-23 01:21:55 +00:00
Enrico Granata 660764a060 Fix a bug caused by my alias refactoring where, if an alias was defined in terms of another alias, trying to run the nested command would actually cause a crash in the command interpreter
llvm-svn: 264096
2016-03-22 21:07:54 +00:00
Zachary Turner 190fadcdb2 Unicode support on Win32.
Win32 API calls that are Unicode aware require wide character
strings, but LLDB uses UTF8 everywhere.  This patch does conversions
wherever necessary when passing strings into and out of Win32 API
calls.

Patch by Cameron
Differential Revision: http://reviews.llvm.org/D17107
Reviewed By: zturner, amccarth

llvm-svn: 264074
2016-03-22 17:58:09 +00:00
Sean Callanan 579e70c9b0 Add a DiagnosticManager replace error streams in the expression parser.
We want to do a better job presenting errors that occur when evaluating
expressions. Key to this effort is getting away from a model where all
errors are spat out onto a stream where the client has to take or leave
all of them.

To this end, this patch adds a new class, DiagnosticManager, which
contains errors produced by the compiler or by LLDB as an expression
is created. The DiagnosticManager can dump itself to a log as well as
to a string. Clients will (in the future) be able to filter out the
errors they're interested in by ID or present subsets of these errors
to the user.

This patch is not intended to change the *users* of errors - only to
thread DiagnosticManagers to all the places where streams are used. I
also attempt to standardize our use of errors a bit, removing trailing
newlines and making clients omit 'error:', 'warning:' etc. and instead
pass the Severity flag.

The patch is testsuite-neutral, with modifications to one part of the
MI tests because it relied on "error: error:" being erroneously
printed. This patch fixes the MI variable handling and the testcase.

<rdar://problem/22864976>

llvm-svn: 263859
2016-03-19 00:03:59 +00:00
Pavel Labath d3fe3aa57f Switch from unittest2.expectedFailure to our own decorator on TestSTL
the main reason is that our decorator contains extra fluff to "expect" crashes (which seem to
happen occasionaly on the android buildbot).

llvm-svn: 263633
2016-03-16 10:39:33 +00:00
Pavel Labath beb4676118 Mark an LLGS test as flaky
cause: Async output arrival over pty
llvm-svn: 263631
2016-03-16 09:58:34 +00:00
Pavel Labath 78fc483980 [test] Persist packets between expect_gdbremote_sequence invocations
Summary:
Some tests (Hc_then_Csignal_signals_correct_thread, at least) were sending a "continue" packet in
one expect_gdbremote_sequence invocation, and "expecting" the stop-reply in another call. This
posed a problem, because the were packets were not persisted between the two invocations, and if
the stub was exceptionally fast to respond, the packet would be received in the first invocation
(where it would be ignored) and then the second invocation would fail because it could not find
the packet.

Since doing matching in two invocations seems like a reasonable use of the packet pump, instead
of fixing the test, I make sure the packet_pump supports this usage by making the list of
captured packets persistent.

Reviewers: tfiala

Subscribers: lldb-commits

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

llvm-svn: 263629
2016-03-16 09:44:49 +00:00
Pavel Labath 39aab4d606 Fix thread/process ID reading from linux core files
Summary:
This also adds a basic smoke test for linux core file reading. I'm checking in the core files as
well, so that the tests can run on all platforms. With some tricks I was able to produce
reasonably-sized core files (~40K).

This fixes the first part of pr26322.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 263628
2016-03-16 09:19:57 +00:00
Enrico Granata ab2b0cb992 On some platforms, the compiler is allowed to assume that BOOL == bool. On others, BOOL == signed char.
This can cause differences in which bit patterns end up meaning YES or NO. In general, however, 0 == NO and 1 == YES.

To keep it simple, LLDB will now show "YES" and "NO" only for 1 and 0 respectively, and format other values as the plain numeric value instead.

Fixes rdar://24809994

llvm-svn: 263604
2016-03-15 23:38:04 +00:00
Enrico Granata 35f94bb72c Make it so that the data formatter for NSError can see through a variable of type NSError**. Fixes rdar://25060684
llvm-svn: 263603
2016-03-15 23:20:10 +00:00
Ewan Crawford fae4363265 Add regression test for expressions calling functions taking anonymous struct typedef arguments
This CL adds a regression test for the bug listed at https://llvm.org/bugs/show_bug.cgi?id=26790
Functionality was implemented in commit r263544

Author: Luke Drummond <luke.drummond@codeplay.com>
Differential Revision: http://reviews.llvm.org/D17777

llvm-svn: 263547
2016-03-15 13:02:11 +00:00
Enrico Granata cdbac99551 Add some test coverage for the changes in alias help
llvm-svn: 263520
2016-03-15 01:43:00 +00:00
Ed Maste 5af4d20372 Enable expectedFailure for all Clang versions in TestRegisterVariables
In r262970 this was changed from xfail Clang < 3.5 to > 3.5, but it
still fails on FreeBSD 10's system Clang 3.4.1 so assume it fails on
all versions.

llvm.org/pr26937

llvm-svn: 263467
2016-03-14 18:59:44 +00:00
Pavel Labath 56673749d2 [test] Correctly retry connections on android targets
Summary:
Normally, when the remote stub is not ready, we will get ECONNREFUSED during the connect()
attempt. However, due to the way how ADB forwarding works, on android targets the connect() will
always be successful, but the connection will be immediately dropped if ADB could not connect on
the remote side. This commit tries to detect this situation, and report it as "connection
refused" so that the upper test layers attempt the connection again.

Reviewers: tfiala, tberghammer

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 263439
2016-03-14 15:33:25 +00:00
Pavel Labath 392408cfc8 Extend XFlaky in TestProcessIO to linux as well
The test sometimes fails on local linux as well. The cause is the same.

llvm-svn: 263421
2016-03-14 11:19:39 +00:00
Jim Ingham e78ca659d6 Remove the skip if Darwin since I fixed the crash.
llvm-svn: 263283
2016-03-11 19:15:03 +00:00
Marianne Mailhot-Sarrasin 7a4eed280a Fixed MemoryCache L1 cache flush
Use the same method to find the cache line as in Read().

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

llvm-svn: 263233
2016-03-11 13:50:10 +00:00
Todd Fiala 91b4bd4b12 skip newly segfaulting test on OS X public CI
llvm-svn: 263205
2016-03-11 08:12:36 +00:00
Marianne Mailhot-Sarrasin 82a827de3b Fixed ValueObject::GetExpressionPath() for paths including anonymous struct/union
When the parent of an expression is anonymous, skip adding '.' or '->' before the expression name.

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

llvm-svn: 263166
2016-03-10 22:10:59 +00:00
Adrian McCarthy 396e02a6e3 Eliminate the TestStarted-XXX and TestFinished-XXX files from check-lldb runs.
Nobody seems to know what purpose these files serve, yet they were accumulating by the thousands in the test traces directory.  I'm proposing we delete them.

Creating these files accounted for about 2.5% of the time to run ninja check-lldb on my machine, which isn't a lot, but it's something.

llvm-svn: 263122
2016-03-10 15:41:11 +00:00
Siva Chandra aaae5f87af [DWARFASTParserClang] Start with member offset of 0 for members of union types.
Summary:
GCC does not emit DW_AT_data_member_location for members of a union.
Starting with a 0 value for member locations helps is reading union types
in such cases.

Reviewers: clayborg

Subscribers: ldrumm, lldb-commits

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

llvm-svn: 263085
2016-03-10 01:15:17 +00:00
Siva Chandra b8d6db258e [TestRegisterVariables] Adjust compiler range in expected failure decorator.
Subscribers: lldb-commits

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

llvm-svn: 262970
2016-03-09 00:02:00 +00:00
Sean Callanan bbde9083ad Made self.expect() errors a little more readable in the testsuite.
self.expect() had two problems:

- If there was a substrs argument, then it overwrote the variable containing
  the command to run with the last substr.  That meant nonsense command text in
  testsuite errors.

- The actual output is not printed, which makes fixing testsuite failures a bit
  annoying (you end up having to use the -tv arguments to dotest).

This fixes both of these issues.  We could do even better, pretty-printing the
criteria for "correct" output, but this at least makes dealing with errors a bit
better.

llvm-svn: 262950
2016-03-08 18:58:48 +00:00
Adrian Prantl 6aeba89e89 Support floating point values in 128-bit SSE vector registers
The System-V x86_64 ABI requires floating point values to be passed
in 128-but SSE vector registers (xmm0, ...). When printing such a
variable this currently yields an <invalid load address>.

This patch makes LLDB's DWARF expression evaluator accept 128-bit
registers as scalars. It also relaxes the check that the size of the
result of the DWARF expression be equal to the size of the variable to a
greater-than. DWARF defers to the ABI how smaller values are being placed
in a larger register.

Implementation note: I found the code in Value::SetContext() that changes
the m_value_type after the fact to be questionable. I added a sanity check
that the Value's memory buffer has indeed been written to (this is
necessary, because we may have a scalar value in a vector register), but
really I feel like this is the wrong place to be setting it.

Reviewed by Greg Clayton.

http://reviews.llvm.org/D17897
rdar://problem/24944340

llvm-svn: 262947
2016-03-08 18:35:09 +00:00
Jim Ingham 583bbb1dd4 Change over the broadcaster/listener process to hold shared or weak pointers
to each other.  This should remove some infrequent teardown crashes when the
listener is not the debugger's listener.

Processes now need to take a ListenerSP, not a Listener&.

This required changing over the Process plugin class constructors to take a ListenerSP, instead
of a Listener&.   Other than that there should be no functional change.
 
<rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39

llvm-svn: 262863
2016-03-07 21:50:25 +00:00
Mohit K. Bhakkad 8f47909a8e [LLDB][MIPS] Fix TestDisassembleBreakpoint
Patch by Nitesh Jain

Reviewers: clayborg, jaydeep.
Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D17597

llvm-svn: 262819
2016-03-07 09:12:49 +00:00
Pavel Labath 21d12f5aa3 Add a log statement
llvm-svn: 262715
2016-03-04 12:43:05 +00:00
Pavel Labath 19f937ae92 Resumbit "Fetch remote log files from LLGS tests"
The problem with the original patch (and my first attempt to fix) was that the value debug
monitor flags could persist from one test to another. Resetting the value in the setUp() function
fixes the problem.

llvm-svn: 262713
2016-03-04 11:27:00 +00:00
Tamas Berghammer b0b1ea36e7 Add reverse file remapping for breakpoint set
LLDB can remap a source file to a new directory based on the
"target.sorce-map" to handle the usecase when the source code moved
between the compliation and the debugging. Previously the remapping
was only used to display the content of the file. This CL fixes the
scenario when a breakpoint is set based on the new an absolute path
with adding an inverse remapping step before looking up the breakpoint
location.

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

llvm-svn: 262711
2016-03-04 11:26:44 +00:00
Pavel Labath c6ba6ae209 Revert "Fetch remote log files from LLGS tests"
Even after the last fixup, there still seems to be one failure left. Revert until I figure out
what is going on.

llvm-svn: 262622
2016-03-03 15:19:14 +00:00
Pavel Labath 13ce8cd6bc Fix OSX breakage caused by r262597
llvm-svn: 262602
2016-03-03 10:39:24 +00:00
Pavel Labath 6be1f9dc3b Fetch remote log files from LLGS tests
Summary:
this enables download of remote log files for llgs and debugserver tests (previously we were just
passing the host file name which obviously did not work). Note this also changes the debugserver
logging to work only when logging has been requested on the command line, whereas previously it
would log unconditionally. I can change it back if anyone is relying on this, but I thought I'd
make this consistent.

Reviewers: tfiala

Subscribers: lldb-commits

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

llvm-svn: 262597
2016-03-03 09:02:52 +00:00
Pavel Labath 0ddfde44ce Slightly improve logging in LLGS tests
we're sometimes getting an exception here, and I want to see why...

llvm-svn: 262333
2016-03-01 14:04:41 +00:00
Enrico Granata 46d4aa211f When 'help' cannot find a command, produce additional help text that also points the user to the apropos and type lookup commands
This is useful in cases such as, e.g.

(lldb) help NSString
(the user meant type lookup)

or

(lldb) help kill
(the user is looking for process kill)

Fixes rdar://24868537

llvm-svn: 262271
2016-02-29 23:22:53 +00:00
Adrian McCarthy 536183275d Fix TestInlines.py on Windows
The inlining semantics for C and C++ are different, which affects the test's expectation of the number of times the function should appear in the binary.  In the case of this test, C semantics means there should be three instances of inner_inline, while C++ semantics means there should be only two.

On Windows, clang uses C++ inline semantics even for C code, and there doesn't seem to be a combination of compiler flags to avoid this.

So, for consistency, I've recast the test to use C++ everywhere.  Since the test resided under lang/c, it seemed appropriate to move it to lang/cpp.

This does not address the other XFAIL for this test on Linux/gcc.  See https://llvm.org/bugs/show_bug.cgi?id=26710

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

llvm-svn: 262255
2016-02-29 21:13:29 +00:00
Pavel Labath 6a291dee2b Revert a part of "Add/Improve complex, vector, aggregate types handling for SysV ARM (hard/soft) ABI."
This partially reverts commit r262218.

The commit added additional checks to a test case. The test case is too big so it's not feasible
to XFAIL it completely. Suggest to implement the checks as a separate test case, which can then
be XFAILed more surgically.

llvm-svn: 262223
2016-02-29 14:26:45 +00:00
Omair Javaid ef77ace9ae Add/Improve complex, vector, aggregate types handling for SysV ARM (hard/soft) ABI.
For details see:

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

llvm-svn: 262218
2016-02-29 13:39:20 +00:00
Sagar Thakur ba04ed4128 [LLDB][MIPS] Fix TestInferiorAssert.py for MIPS
Patch by Nitesh Jain.

Summary: The debug version of libc.so is require for backtracing which may not be available on all platforms.

Reviewers: ovyalov, clayborg
Subscribers: zturner, lldb-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Differential: http://reviews.llvm.org/D17131
llvm-svn: 262011
2016-02-26 13:30:34 +00:00
Oleksiy Vyalov e4ff8ec649 Make TestPlatformProcessConnect to support abstract/domain sockets.
llvm-svn: 261974
2016-02-26 04:01:58 +00:00
Jim Ingham 970bb9e0ec Add the "block" keyword to "thread step-in -e", and an alias that uses it: "sif <target function>" - i.e. step-into-function
to allow you to step through a complex calling sequence into a particular function that may span multiple lines.  Also some
test cases for this and the --step-target feature.

llvm-svn: 261953
2016-02-26 01:37:30 +00:00
Adrian McCarthy 17dd4fe27b XFail TestInlines.py on Windows with clang.
Test expects the breakpoint to resolve to three locations, but clang on windows yields only 2.

llvm.org/pr26710

llvm-svn: 261810
2016-02-25 00:24:07 +00:00
Adrian McCarthy 0a750820a3 Get register context for the 32-bit process in a WoW64 process minidump
32-bit processes on 64-bit Windows run in a layer called WoW64 (Windows-on-Windows64). If you capture a mini dump of such a process from a 32-bit debugger, you end up with a register context for the 64-bit WoW64 process rather than the 32-bit one you probably care about.

This detects WoW64 by looking to see if there's a module named wow64.dll loaded. For such processes, it then looks in the 64-bit Thread Environment Block (TEB) to locate a copy of the 32-bit CONTEXT record that the plugin needs for the register context.

Added some rudimentary tests.  I'd like to improve these later once we figure out how to get the exception information from these mini dumps.

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

llvm-svn: 261808
2016-02-25 00:23:27 +00:00
Zachary Turner cbb1bf983b xfail case sensitivity test on Linux.
There are two tests in this file.  One which only runs on Windows
and tests that you can set a breakpoint with mismatched case.  And
another that only runs on non-Windows and tests that you cannot set
a breakpoint with mismatched case.  This latter test is failing on
non Windows platforms for some reason.  It could be that the test
is just written incorrectly, as I think the actual functionality
actually works correctly on non-Windows platforms.

llvm-svn: 261800
2016-02-24 22:41:04 +00:00
Zachary Turner 47c03462f5 Some fixes for case insensitive paths on Windows.
Paths on Windows are not case-sensitive.  Because of this, if a file
is called main.cpp, you should be able to set a breakpoint on it
by using the name Main.cpp.  In an ideal world, you could just
tell people to match the case, but in practice this can be a real
problem as it requires you to know whether the person who compiled
the program ran "clang++ main.cpp" or "clang++ Main.cpp", both of
which would work, regardless of what the file was actually called.

This fixes http://llvm.org/pr22667

Patch by Petr Hons

Differential Revision: http://reviews.llvm.org/D17492
Reviewed by: zturner

llvm-svn: 261771
2016-02-24 21:26:47 +00:00
Tamas Berghammer a97aaa9a4b XFAIL TestInlines for Linux with gcc
llvm-svn: 261630
2016-02-23 11:35:38 +00:00
Sean Callanan e47387fc12 Actually commit the test for r261598.
llvm-svn: 261599
2016-02-23 00:52:34 +00:00
Pavel Labath f92d8db836 Mark TestMiBreak.test_lldbmi_break_insert_function_pending as flaky on linux
Test has become flaky again. Attempts to investigate the triggering commit have failed, so I
suspect it was flaky all along..

llvm-svn: 261519
2016-02-22 09:51:32 +00:00
Ed Maste 28cbb8616e Remove expectedFailureFreeBSD decorator
All invocations are updated to use the generic expectedFailureAll.

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

llvm-svn: 261355
2016-02-19 19:25:03 +00:00
Ed Maste 06977c799c Remove XFAIL from test passing on FreeBSD
There is a report in the PR from several months ago that it failed
intermittently, but it is passing consistently for me on FreeBSD 10
and 11.  We can re-add a decorator if further testing shows it is
still flakey.

llvm.org/pr17214

llvm-svn: 261340
2016-02-19 17:35:01 +00:00
Ed Maste 7a2e8b3691 Remove XFAIL from test passing on FreeBSD
This is passing for me consistently on FreeBSD 10 and FreeBSD 11.

llvm.org/pr15989

llvm-svn: 261339
2016-02-19 17:31:05 +00:00
Ed Maste 622ab96c85 Remove XFAIL from test passing on FreeBSD
Both Linux and FreeBSD had a comment "This needs to be root-caused."
It looks like the failure has been fixed on both, and the Linux XFAIL
decorator was removed in r233716 (Mar 2015).

llvm-svn: 261333
2016-02-19 16:58:08 +00:00
Pavel Labath 1274474c64 Enable TestUnicodeLiterals
Test should work everywhere except windows now.

llvm-svn: 261314
2016-02-19 10:36:38 +00:00
Pavel Labath b3b8fd3b00 Mark TestLldbGdbServer.test_software_breakpoint_set_and_remove_work_llgs as flaky on linux
The problem is the asynchronous arrival of inferior stdio (pr25652).

llvm-svn: 261313
2016-02-19 10:36:31 +00:00
Jim Ingham 7b71c0ba6c Make sure code that is in the middle of figuring out the correct architecture
on attach uses the architecture it has figured out, rather than the Target's
architecture, which may not have been updated to the correct value yet.

<rdar://problem/24632895>

llvm-svn: 261279
2016-02-18 23:58:45 +00:00
Ed Maste 88980d051a Remove expectedFlakeyFreeBSD decorator for prompt setting
The race condition/use after free involved in setting long prompts
appears to be fixed now (although I do not know which commit fixed it).

llvm.org/pr22611

llvm-svn: 261266
2016-02-18 21:38:24 +00:00
Zachary Turner 5d3b3c7de2 Add target and host platform enumerations so we're not using strings.
Differential Revision: http://reviews.llvm.org/D17088

llvm-svn: 261241
2016-02-18 18:50:02 +00:00
Pavel Labath 91b1e19152 Bump up timeout in TestChangeProcessGroup
The test fails very rarely. I suspect this is simply because the inferior does not have enough
time to create the file under heavy load.

llvm-svn: 260951
2016-02-16 09:58:50 +00:00
Pavel Labath 35f26f613a Mark TestLldbGdbServer.test_written_M_content_reads_back_correctly as flaky on linux
I believe the root cause is the asynchronous arrival of inferior stdio (pr25652).

llvm-svn: 260950
2016-02-16 09:58:47 +00:00
Siva Chandra 94d1855e08 [TestLibCxxAtomic] Skip for GCC.
Summary: This is the form on other libc++ tests.

Reviewers: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 260793
2016-02-13 02:11:11 +00:00
Siva Chandra 9fb970e422 [TestLibCxxAtomic] Fix Makefile so that the test builds on Linux.
Reviewers: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 260770
2016-02-13 00:09:42 +00:00
Enrico Granata 75995b5e86 Data formatter support for libc++ std::atomic<T>
On libc++ std::atomic is a fairly simple data type (layout wise, at least), wrapping actual contents in a member variable named "__a_"

All the formatters are doing is "peel away" this intermediate layer and exposing user data as direct children or values of the std::atomic root variable

Fixes rdar://24329405

llvm-svn: 260752
2016-02-12 22:18:24 +00:00
Siva Chandra 29d9bea93f Adjust for Python-3.
Summary:
This does not yet give us a clean testsuite run but it does help with:
1. Actually building on linux
2. Run the testsuite with over 70% tests passing on linux.

Reviewers: tfiala, labath, zturner

Subscribers: lldb-commits

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

llvm-svn: 260721
2016-02-12 20:30:47 +00:00
Sean Callanan abece15858 Renamed TestRdar12991846 to the more descriptive TestUnicodeLiterals.
Test cases should not be named after PR or Radar numbers.  It's fine to
annotate them with these numbers in comments, however.

llvm-svn: 260699
2016-02-12 18:42:00 +00:00
Enrico Granata 2543d29048 The data formatters for NSArray, NSDictionary and (only partially) NSSet contain logic to inspect the objects without running code.
However, they also contain fallback logic that - in cases where LLDB can't recognize the specific subclass - actually does run code in order to inspect those objects.

The argument for this logic was that these data types are critical enough that the risk of getting it wrong is outweighed by the advantage of always providing accurate child information.

Practical experience however shows that "po" - a code running data-inspection command - is quite frequently used, and not considered burdensome by users.
As such, this makes the code-running fallback in the data formatters a risk that carries very little actual reward. Also, unlike the time this code was originally written, we now have accurate class information for Objective-C, and thus we are less likely to improperly identify classes.

This commit removes support for the code-running fallback, and aligns the data formatters for NSArray, NSDictionary and NSSet to the general no-code-running behavior of other data formatters.

While it is possible for us to add support for some subclasses that are now no longer covered by static inspection alone, this is beyond the scope of this commit.

llvm-svn: 260664
2016-02-12 07:50:15 +00:00
Jim Ingham 0ea010aecb When calling TypeSystemMap::Clear, objects being destroyed in the process of
clearing the map ended up calling back into the TypeSystemMap to do lookups.  
Not a good idea, and in this case it would cause a deadlock.

You would only see this when replacing the target contents after an exec, and only if you 
had stopped before the exec, evaluated an expression, then continued
on to the point where you did the exec.  

Fixed this by making sure the TypeSystemMap::Clear tears down the TypeSystems in the map before clearing the map.
I also add an expression before exec to the TestExec.py so that we'll catch this
issue if it crops up again in the future.

<rdar://problem/24554920>

llvm-svn: 260624
2016-02-12 00:03:19 +00:00
Ed Maste e3ddf4c25d XFAIL TestCommandScriptImmediateOutput on FreeBSD also
llvm-svn: 260589
2016-02-11 21:15:49 +00:00
Zachary Turner fa61bb5be9 Fix copy/paste error in TestCModules.
llvm-svn: 260440
2016-02-10 21:47:36 +00:00
Zachary Turner b3cce5d33a Remove skipUnlessListedRemote.
This was supposed to have been removed but made it back in
accidentally.

llvm-svn: 260423
2016-02-10 19:53:45 +00:00
Zachary Turner 362e06d7ba Remove expectedFailureLinux decorator.
llvm-svn: 260422
2016-02-10 19:53:36 +00:00
Mohit K. Bhakkad e92e3606dd [LLDB][MIPS] Generalise MIPS arch names
Patch by Nitesh Jain

Reviewers: clayborg, jaydeep.
Subscribers: zturner, bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D16840

llvm-svn: 260362
2016-02-10 06:58:13 +00:00
Enrico Granata 14086ed75d Change lldb.value.__int__() so that it takes into account the signedness of the value being cast to return a Python number with the proper value
The explicit APIs on SBValue obviously remain if one wants to be explicit in intent, or override this guess, but since __int__() has to pick one, an educated guess is definitely better than than always going to signed regardless

Fixes rdar://24556976

llvm-svn: 260349
2016-02-10 02:12:42 +00:00
Ed Maste 9d67c1e352 Remove FreeBSD failure decorator from TestCppIncompleteTypes
CFLAGS is now being set correctly to pass -flimit-debug-info or
-fno-limit-debug-info on FreeBSD.  I'm not sure which change is
responsible for the fix, though.

llvm.org/pr25626

llvm-svn: 260330
2016-02-10 00:03:52 +00:00
Zachary Turner 81d0804d96 Fix incorrect usage of `str` in _match_decorator_property.
llvm-svn: 260292
2016-02-09 21:36:38 +00:00
Zachary Turner 9625c6fc9f Remove skipIf<compiler> decorators.
These were supposed to have been removed in a previous patch,
but I missed them.

llvm-svn: 260291
2016-02-09 21:36:32 +00:00
Zachary Turner 2b1a416cb5 Remove decorators related to debug info types.
All existing usages were ported over to the common decorators.

llvm-svn: 260290
2016-02-09 21:36:23 +00:00
Zachary Turner 8158a2037a Delete all the xfail / skip decorators for specific compilers.
Ported everything over to using expectedFailureAll.

llvm-svn: 260289
2016-02-09 21:36:15 +00:00
Zachary Turner 0c3e003697 Remove expected failure and skip decorators for host os.
All decorator invocations are updated to use the generic
expectedFailureAll and skipIf decorators.

llvm-svn: 260288
2016-02-09 21:36:02 +00:00
Tamas Berghammer bf8f8073dc Fix a typo in an xfail decorator in TestExprsChar
llvm-svn: 260216
2016-02-09 10:10:42 +00:00
Siva Chandra 4a33ab7b2c [TestExprsChar] Fix a typo is failure archs list
Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 260192
2016-02-09 02:18:50 +00:00
Zachary Turner 05021bb2ed Remove skip and xfail decorators for target architecture.
This removes the following decorators:

* skipIfI386
* expectedFailureI386
* expectedFailurex86_64
* skipIfArch
* skipUnlessArch
* skipUnlessI386

And other related decorators.  All code using those decorators
is updated to use expectedFailureAll and skipIf

llvm-svn: 260178
2016-02-09 00:36:34 +00:00
Zachary Turner 7fade35ec2 Remove skipIfHostPlatform and skipUnlessHostPlatform decorators.
llvm-svn: 260177
2016-02-09 00:36:27 +00:00
Zachary Turner 779df76c56 Remove the skipUnlessArch decorator.
Convert everything over to using skipIf.

llvm-svn: 260176
2016-02-09 00:36:22 +00:00
Zachary Turner 2e887acea8 A number of improvements to decorator conditionals.
* Change the `not_in` function to be called `no_match`.  This makes
  it clear that keyword arguments can be more than just lists.
* Change the name of `_check_list_or_lambda` to
  `_match_decorator_property`.  Again clarifying that decorator params
  are not always lists.
* Always use a regex match when matching strings.  This allows automatic
  support for regex matching on all decorator properties.  Also support
  compiled regex values.
* Fix a bug in the compiler check used by _decorateTest.  The two
  arguments were reversed, the condition was always wrong.
* Change one test that uses skipUnlessArch to use skipIf, to
  demonstrate that skipIf can now handle more scenarios.

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

llvm-svn: 260135
2016-02-08 19:35:18 +00:00
Zachary Turner 4a289a93f7 Remove expectedFailureWindows decorator.
expectedFailureWindows is equivalent to using the general
expectedFailureAll decorator with oslist="windows".  Additionally,
by moving towards these common decorators we can solve the issue
of having to support decorators that can be called with or without
arguments.  Once all decorators are always called with arguments,
and this is enforced by design (because you can't specify the condition
you're decorating for without passing an argument) the implementation
of the decorators can become much simpler

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

llvm-svn: 260134
2016-02-08 19:34:59 +00:00
Eugene Leviant ed203da558 Show real error message in -data-evaluate-expression
llvm-svn: 260082
2016-02-08 10:04:51 +00:00
Pavel Labath 22a2a7fec1 Revert "Enable test_lldbmi_settings_set_target_run_args_before on linux"
Test is still flaky.

llvm-svn: 260081
2016-02-08 09:58:27 +00:00