Commit Graph

14596 Commits

Author SHA1 Message Date
Sagar Thakur 477eb42f85 [LLDB][MIPS] Setting appropriate ArchSpec::m_flags based on ABI
Patch by Nitesh Jain.

Summary: The ArchSpec::m_flags will be set based on ELF flag ABI.

Reviewers: ovyalov, clayborg
Subscribers: lldb-commits, mohit.bhakkad, sagar, jaydeep, bhushan
Differential: D18858
llvm-svn: 269181
2016-05-11 13:08:29 +00:00
Ravitheja Addepally b2ba5a5467 Rewriting TestMultithreaded.py to solve flakyness on Linux
Summary:
test_listener_event_process_state checks for Threads
and Frames in the multithreaded_queue. The listener_func has
more computational load, which may be latter executed than the
pop leading to the failure. This patch tries to only check for
frames in listener_func as presence of frames also confirms 
prescence of threads and avoids the second push into the 
multithreaded_queue.

Reviewers: lldb-commits, clayborg, labath

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

llvm-svn: 269168
2016-05-11 09:54:41 +00:00
Omair Javaid e94459fa6c Corrected aarch64 register no in TestBreakpointConditions.py
Test uses x1 in breakpoint expression while objdump shows that x1 is never used in the code and may have random values.
Using x0 make sure that we are using a registe that will have a positive value and breakpoint expression will evaluate true atleast once.

llvm-svn: 269164
2016-05-11 09:29:14 +00:00
Enrico Granata c3b0a5b099 In some cases, type lookup has to deal with situations where it cannot reconstruct a compile unit or a function, but it still has a valid symbol - and it can use that in order to figure out the preferential language for lookups
This is not the right thing for all clients (notably the expression parser), so put it in type lookup specific code

Fixes rdar://problem/22422313

llvm-svn: 269095
2016-05-10 18:16:33 +00:00
Pavel Labath 7189b0fdb2 Fix logging in Listener.cpp
Clear() log message was claiming it was the destructor, which had me very confused when looking
at the log messages. Fix the message, and add a log message to the real destructor.

Also noticed that the destructor was needlessly locking the broadcaster mutex (as Clear was
locking it again anyway), so remove that as well.

llvm-svn: 269058
2016-05-10 13:46:25 +00:00
Pavel Labath d86bc2af27 Fix SymbolFilePDBTests.cpp
llvm-svn: 269057
2016-05-10 13:46:22 +00:00
Pavel Labath ebc7135f8e Fix race in TestExitDuringStep and unify pseudo_barrier handling
Summary:
TestExitDuringStep was very rarely hanging on the buildbots. I can't be sure, but I believe this
was because of the fact that it declared its pseudo_barrier variable as "volatile int", which is
not sufficient to guarantee corectness (also, all other tests used atomic variables for this, and
they were passing reliably AFAIK). Besides switching to an atomic variable in this test as well,
I have also took this opportunity to unify all the copies of the pseudo_barrier code to a single
place to reduce the chance of this happening again.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 269025
2016-05-10 07:54:25 +00:00
Jim Ingham 958faec74f Add a testcase for "BreakpointSetBySourceRegex"
This tests both that we set the breakpoint on the right line, and that restricting by file
and/or the function, we get the right breakpoints.

llvm-svn: 269004
2016-05-10 01:52:44 +00:00
Sean Callanan e402e56492 Added a testcase that verifies that multiline expressions work.
llvm-svn: 268971
2016-05-09 21:14:18 +00:00
Sean Callanan f52c40c57f Fixed multiline expressions, and removed some dead code.
IOHandlerLinesUpdated() does nothing, and IOHandlerIsInputComplete should be
implemented but isn't.  This means that multiline expressions don't work.  This
patch fixes that.  Test case to follow in the next commit.

llvm-svn: 268970
2016-05-09 21:13:27 +00:00
Pavel Labath b5935bfd7d Mark TestPrintStackTraces as flaky on linux
PR27687

llvm-svn: 268934
2016-05-09 16:59:29 +00:00
Pavel Labath 1dfd5b1694 Enable NamespaceLookupTestCase.test_scope_lookup_before_using_with_run_command on linux
test appears to be passing now.

llvm-svn: 268923
2016-05-09 14:43:22 +00:00
Pavel Labath b8d8c62b34 Fix assertion in SymbolFilePDB
llvm::Error requires all errors to be handled. Simply checking the whether there was an error is
not enough, you have to actuall call handle(All)Errors, in case there was an error.

llvm-svn: 268906
2016-05-09 11:07:43 +00:00
Jim Ingham 7fa7dc36fe Take the API lock in SBThread::IsValid & SBFrame::IsValid.
The IsValid calls can try to reconstruct the thread & frame, which can 
take various internal locks.  This can cause A/B locking issues with
the Target lock, so these calls need to that the Target lock.

llvm-svn: 268828
2016-05-07 00:54:56 +00:00
Jim Ingham 8bbfdcd181 Remove some lldbassert's from the packet checking code.
Greg says he doesn't need these asserts anymore and since they cause occasional test suite
crashes, out they go.

llvm-svn: 268827
2016-05-07 00:52:18 +00:00
Jim Ingham 9b8eb155d8 Fix the way the ShouldStopHere checker handles the general case of "stepping through line 0 code".
That's good 'cause it means all the different kinds of source line stepping won't leave user in the middle of
compiler implementation code or code inlined from odd places, etc.  But it turns out that the compiler
also marks functions it MIGHT inline as all being of line 0.  That would mean we single step through this code
instead of just stepping out.  That is both inefficient, and more error prone 'cause these little nuggets tend
to be bits of hand-written assembly and the like and are hard to step through.

This change just checks and if the entire function is marked with line 0, we step out rather than step through.

<rdar://problem/25966460>

llvm-svn: 268823
2016-05-06 23:44:10 +00:00
Zachary Turner 50c58c0d01 Fix LLDB after removal of PDB_ErrorCode
llvm-svn: 268802
2016-05-06 21:35:47 +00:00
Saleem Abdulrasool d97dd11f2f debugserver; fix -Wunused-local-typedef, -Wunused-variable warnings
Remove the typedef and local structure which was unused.  Fixes last of the new
clang warnings in the debugserver build.  NFC.

llvm-svn: 268759
2016-05-06 17:33:13 +00:00
Saleem Abdulrasool 247731d4d3 debugserver: fix a couple of -Wmissing-field-initializers warnings
Explicitly provide an initializer for the std::vector in the constructed type.
Addresses -Wmissing-field-initializers warnings from clang.  NFC.

llvm-svn: 268758
2016-05-06 17:33:09 +00:00
Saleem Abdulrasool 4533f7b6e8 debugserver: fix some -Wpessimizing-move warnings
Remove the unnecessary use of std::move to permit the compiler to perform NVRO
instead.  Fixes more warnings from clang.  NFC.

llvm-svn: 268757
2016-05-06 17:33:04 +00:00
Saleem Abdulrasool 2bb818880b debugserver: fix a few -Wcovered-swift-default warnings
Remove a couple of `default` cases from switches which are covered.  This is
beneficial since it would allow the compiler to indicate when a new enum value
is added and the switch is not updated.  Fixes some warnings from clang.  NFC.

llvm-svn: 268756
2016-05-06 17:33:01 +00:00
Saleem Abdulrasool bd7ecf4b02 debugserver: fix some -Wformat-pedantic warnings
Perform explicit casts for the log message to address some `-Wformat-pedantic`
warnings from clang.  NFC.

llvm-svn: 268755
2016-05-06 17:32:58 +00:00
Eugene Zelenko 774b8da47f Fix standalone build on RHEL6.
Differential revision: http://reviews.llvm.org/D19991

llvm-svn: 268750
2016-05-06 17:03:09 +00:00
Enrico Granata 5f57b6ee0f Revert r268591
"Allow LanguageRuntimes to return an error if they fail in the course of dynamic type discovery

This is not meant to report that a value doesn't have a dynamic type - it is only meant as a mechanism to propagate actual type discovery issues (e.g. malformed type metadata for languages that have such a notion)

This information is used by ValueObjectDynamic to set its own m_error, which is a fairly sharp and heavyweight tool to begin with

For the time being, this is an architectural improvement but a practical no-op as no existing runtimes are actually setting errors"

I need to think about what I want to do in this space more carefully - this attempt might be too heavy of a hammer for the nail I am trying to fix, and I don't want to leave it in while I ponder

llvm-svn: 268686
2016-05-05 21:10:28 +00:00
Todd Fiala 57a4e5b3d0 Fix TestEvents.py on OS X
This change addresses a hang/segfault in TestEvents.py. The threads that
run the listener loops now do an SBListener.Clear() before they wrap up
their work. This prevents the test from trying to clean up the
SBListener too late.

There is a separate issue here which is that we should prevent this
clean-up time lock-up, but that is out of scope for this particular
change. I'd like to get these tests back and running the normal flow
rather than skipping them.

This addresses:
llvm.org/pr25924 (at least, the OS X side, although I suspect this will
also address Linux)

http://reviews.llvm.org/D19983
reviewed by: Jim Ingham

llvm-svn: 268653
2016-05-05 17:48:14 +00:00
Todd Fiala bcab6484eb fix argument usage for '-#' command line option
This was broken in the grand configuration change.  Now
using -# works again.

llvm-svn: 268638
2016-05-05 16:01:15 +00:00
Tamas Berghammer 21c3fdeda8 Guard AddCXXSynthetic with LLDB_DISABLE_PYTHON
The function only avaibleble when python is enabled. Guard the new call
in the Java plugin with LLDB_DISABLE_PYTHON until we can change
AddCXXSynthetic to be available in all case to get the build bots green
again.

llvm-svn: 268626
2016-05-05 12:46:45 +00:00
Pavel Labath 0360c0f63d Bump up timeout in AdbClient
now that the timeout actually means something, we see that sometimes adb is just really slow in
replying to the DONE packet during file push. Give it more time to complete.

llvm-svn: 268623
2016-05-05 11:25:57 +00:00
Tamas Berghammer 2ff833060c Add support for displaying Java array types on Andorid
Differential revision: http://reviews.llvm.org/D19540

llvm-svn: 268622
2016-05-05 11:18:21 +00:00
Pavel Labath bb06ffaff3 Downgrade skip to xfail in TestBitfields on linux
the test should no longer crash, but we need to investigate why ToT clang still generates debug
info we don't understand.

llvm-svn: 268619
2016-05-05 09:03:22 +00:00
Pavel Labath c14e8ced85 Fix EOF handling in AdbClient (take 2)
Summary:
AdbClient would spin in a loop in ReadAllBytes in case the remote end was closed before reading
the requested number of bytes. Make sure we return an error in this case instead.

Reviewers: ovyalov

Subscribers: tberghammer, danalbert, lldb-commits

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

llvm-svn: 268617
2016-05-05 08:42:17 +00:00
Pavel Labath c4f309a6bd Fix syntax errors in TestEnumTypes
llvm-svn: 268616
2016-05-05 08:33:56 +00:00
Pavel Labath b9436bd493 Fix DW_AT_specification handling in DWO files
Summary:
We were trying to get a DWARFDIE from a CompileUnit belonging to a DWO file. However, this
function does not understand the die encoding used by the DWO files. Instead use GetDIE on the
SymbolFileDWARF, which is overriden in DWO to do the right thing.

Reviewers: clayborg, tberghammer

Subscribers: lldb-commits, ovyalov

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

llvm-svn: 268615
2016-05-05 08:21:44 +00:00
Enrico Granata 5ee5408625 Allow LanguageRuntimes to return an error if they fail in the course of dynamic type discovery
This is not meant to report that a value doesn't have a dynamic type - it is only meant as a mechanism to propagate actual type discovery issues (e.g. malformed type metadata for languages that have such a notion)

This information is used by ValueObjectDynamic to set its own m_error, which is a fairly sharp and heavyweight tool to begin with

For the time being, this is an architectural improvement but a practical no-op as no existing runtimes are actually setting errors

llvm-svn: 268591
2016-05-05 01:47:44 +00:00
Enrico Granata b86dc66e75 Make the functions that fetch data from the ObjC runtime choose whether or not to log depending on whether the types log is enabled
This can prove helpful in debugging issues with that retrieval even if LLDB wasn't compiled with the magic macros defined

llvm-svn: 268587
2016-05-05 01:15:57 +00:00
Adrian McCarthy 68695b643d XFail TestEnumTypes.py on Windows
Differential Revision: http://reviews.llvm.org/D19943

llvm-svn: 268574
2016-05-04 23:33:19 +00:00
Adrian McCarthy 3f99810787 XFail TestLambdas.py on Windows after fixing some of the problems
1. Fixed semicolon placement in the lambda in the test itself.

2. Fixed lldbinline tests in general so that we don't attempt tests on platforms that don't use the given type of debug info. (For example, no DWO tests on Windows.) This fixes one of the two failures on Windows. (TestLambdas.py was the only inline test that wasn't XFailed or skipped on Windows.)

3. Set the error string in IRInterpreter::CanInterpret so that the caller doesn't print (null) instead of an explanation. I don't entirely understand the error, so feel free to suggest a better wording.

4. XFailed the test on Windows. The interpreter won't evaluate the lambda because the module has multiple function bodies. I don't exactly understand why that's a problem for the interpreter nor why the problem arises only on Windows.

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

llvm-svn: 268573
2016-05-04 23:32:35 +00:00
Greg Clayton 2da2982abe Unblock the windows buildbot.
llvm-svn: 268566
2016-05-04 22:41:32 +00:00
Greg Clayton 4329fe4271 Don't let two threads call Debugger::Clear simultaneously.
We don't want a mutex in debugger as it will cause A/B locking issues with the lldb_private::Target's mutex, but we do need to stop two threads from doing Debugger::Clear at the same time. We have seen issues with this with the C++ global destructor chain where the global debugger list is being destroyed and the Debugger::~Debugger() is calling it while another thread was in the middle of running that function.

<rdar://problem/26098913>

llvm-svn: 268563
2016-05-04 22:26:42 +00:00
Greg Clayton 92a20a299f Fixed a missing break and fixed spacing.
llvm-svn: 268562
2016-05-04 22:14:55 +00:00
Sean Callanan f636fc2e66 Intentionally leak the ASTSourceMap instead of destroying it when LLDB quits.
<rdar://problem/25959792>

llvm-svn: 268559
2016-05-04 21:42:55 +00:00
Zachary Turner 54fd7ff6db Update for llvm change to add pdb namespace.
r268544 moves all PDB reading code into a pdb namespace,
so LLDB needs to be updated to take this into account.

llvm-svn: 268545
2016-05-04 20:33:53 +00:00
Bryan Chan c4abaefadb Fix a SIGSEGV caused by dereferencing a pointer without a null check
llvm-svn: 268520
2016-05-04 17:24:31 +00:00
Jason Molenda 955dcf2dbc Add a way for an ObjectFile to indicate that assembly emulation
should not be used for this module -- for use when an ObjectFile
knows that it does not have meaningful or accurate function start
addresses.  

More commonly, it is not clear that function start addresses are
missing in a module.  There are certain cases on Mac OS X where we
can tell that a Mach-O binary has been stripped of this essential
information, and the unwinder can end up emulating many megabytes
of instructions for a single "function" in the binary.

When a Mach-O binary is missing both an LC_FUNCTION_STARTS load 
command (very unusual) and an eh_frame section, then we will assume 
it has also been stripped of symbols and that instruction emulation
will not be useful on this module.

<rdar://problem/25988067> 

llvm-svn: 268475
2016-05-04 03:09:40 +00:00
Jim Ingham c44644d6e9 You have to call setHasLoadedFieldsFromExternalStorage AFTER calling
the field_begin that starts the copy or it won't do anything.

This causes failures, but only in complex apps, I haven't found
a reduced test case for this yet. 

<rdar://problem/21951798>

llvm-svn: 268467
2016-05-04 00:06:23 +00:00
Sean Callanan c6b688a81b Added a testcase for the ptr_refs tool so we catch if it stops working.
llvm-svn: 268433
2016-05-03 20:36:06 +00:00
Francis Ricci 3cf8e16f44 Split out console and file writing cases in TestCommandScriptImmediateOutput
Summary:
As these are really testing separate issues, they should be run as separate
tests.

Reviewers: zturner, granata.enrico, clayborg

Subscribers: lldb-commits

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

llvm-svn: 268397
2016-05-03 16:31:36 +00:00
Pavel Labath ef984e7dc0 Revert "Add a read_full_buffer argument to ConnectionFileDescriptor::Read"
This reverts commit r268380 as it breaks windows build (I forgot to make neccesary adjustments to
ConnectionGenericFileWindows).

llvm-svn: 268384
2016-05-03 14:07:41 +00:00
Pavel Labath 240760207e Add a read_full_buffer argument to ConnectionFileDescriptor::Read
Summary:
AdbClient was attempting to handle the case where the socket input arrived in pieces, but it was
failing to handle the case where the connection was closed before that happened. In this case, it
would just spin in an infinite loop calling Connection::Read. (This was also the cause of the
spurious timeouts on the darwin->android buildbot. The exact cause of the premature EOF remains
to be investigated, but is likely a server bug.)

Since this wait-for-a-certain-number-of-bytes seems like a useful functionality to have, I am
moving it (with the infinite loop fixed) to the Connection class, and adding an
appropriate test for it.

Reviewers: clayborg, zturner, ovyalov

Subscribers: tberghammer, danalbert, lldb-commits

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

llvm-svn: 268380
2016-05-03 13:55:53 +00:00
Jim Ingham c7468b7b96 Another little example use of scripted thread plans.
llvm-svn: 268338
2016-05-03 00:14:52 +00:00
Greg Clayton 7301d39401 debugserver should fflush its log stream in FileLogCallback, now it does.
<rdar://problem/24728287> 

llvm-svn: 268325
2016-05-02 22:53:08 +00:00
Enrico Granata 0a99485341 Fix an issue where the apropos command would not print fully qualified command names for nested command objects
rdar://problem/26020072

llvm-svn: 268309
2016-05-02 21:28:40 +00:00
Sean Callanan c530ba98a9 Import block pointers from DWARF as Clang block pointers, not as structs.
Also added a data formatter that presents them as structs if you use frame
variable to look at their contents.  Now the blocks testcase works.

<rdar://problem/15984431>

llvm-svn: 268307
2016-05-02 21:15:31 +00:00
Enrico Granata 1dccd9da01 Add more debug logging to g_get_shared_cache_class_info_body
llvm-svn: 268303
2016-05-02 20:58:15 +00:00
Enrico Granata fd4e5a8801 Add an argument to ValueObject::GetSyntheticBase that allows for name customization on the generated value
llvm-svn: 268274
2016-05-02 18:13:18 +00:00
Enrico Granata 93529ed9b8 I forgot to check in the test case for the changes I made to synthetic children yesterday. Do so now
llvm-svn: 268263
2016-05-02 17:57:14 +00:00
Enrico Granata 6eec8d6c6f Add support for synthetic child providers to optionally return a customized typename for display
llvm-svn: 268208
2016-05-02 00:41:24 +00:00
Kuba Brecka cdbc450ad6 Update test for r268192.
llvm-svn: 268194
2016-05-01 11:32:10 +00:00
Kuba Brecka 5c7b363534 Improve wording and capitalization of TSan thread names.
llvm-svn: 268193
2016-05-01 11:26:06 +00:00
Kuba Brecka 2ae442b916 Add thread numbers into ASan thread names.
llvm-svn: 268192
2016-05-01 11:23:04 +00:00
Kamil Rytarowski 90db606429 Fix NetBSD build with CMake 3.5.2
Summary:
Building HEAD of LLDB fails in linking against DebugInfoPDB. It also prints the following warning:

```
CMake Warning (dev) in source/Plugins/SymbolFile/PDB/CMakeLists.txt:
  Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
  interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "lldbPluginSymbolFilePDB" has an INTERFACE_LINK_LIBRARIES property.
  This should be preferred as the source of the link interface for this
  library but because CMP0022 is not set CMake is ignoring the property and
  using the link implementation as the link interface instead.

  INTERFACE_LINK_LIBRARIES:

    LLVMDebugInfoPDB

  Link implementation:

    (empty)
```

CMP0022 was introduced in CMake-2.8.11, bump minimal required version from 2.8 to 3.0 to gain more useful features like libexecinfo(3) detection on NetBSD.

Reviewers: emaste, zturner, labath

Subscribers: zturner, lldb-commits, joerg

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

llvm-svn: 268191
2016-05-01 10:23:24 +00:00
Chaoren Lin 6840ae9d3c Fix TestEnumTypes.py for 32 bit platforms.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 268135
2016-04-29 23:34:44 +00:00
Greg Clayton d49a8f9b54 Watch out for compilers that generate bad bitfield info. If the bit size of a bitfield member doesn't lie within the bit bounds of the type itself, just leave it out so we don't get clang asserting and killing our IDE when it gets unhappy with the information.
https://llvm.org/bugs/show_bug.cgi?id=27515
<rdar://problem/21082998>

llvm-svn: 268110
2016-04-29 21:26:46 +00:00
Greg Clayton 349213f941 Fix TestGetVariables.py so it works correctly. We had duplicate static values showing up as we would find static variables in the Block and also in the compile unit. We now make sure a variable hasn't been added to the list before we add it.
llvm-svn: 268101
2016-04-29 21:00:38 +00:00
Greg Clayton 909b277845 Make sure LLDB can deal with forward declarations to enums without crashing or asserting.
<rdar://problem/23776428> 

llvm-svn: 268098
2016-04-29 20:48:39 +00:00
Sean Callanan 7736a208b8 [fix] Fixed a bug where const this would cause parser errors about $__lldb_expr.
In templated const functions, trying to run an expression would produce the
error

error: out-of-line definition of '$__lldb_expr' does not match any declaration
in 'foo' member declaration does not match because it is const qualified
error: 1 error parsing expression

which is no good.  It turned out we don't actually need to worry about "const,"
we just need to be consistent about the declaration of the expression and the
FunctionDecl we inject into the class for "this."

Also added a test case.

<rdar://problem/24985958>

llvm-svn: 268083
2016-04-29 18:09:03 +00:00
Adrian McCarthy 6cd5364556 Used llvm_unreached to quite a VC++ compiler warning.
Differential Revision: http://reviews.llvm.org/D19489

llvm-svn: 267931
2016-04-28 20:14:44 +00:00
Chaoren Lin e8c6840c71 XFail TestBitfields.py Python API tests.
Summary:
Started failing after rL267895.
Possibly related to http://llvm.org/pr27510.

Reviewers: labath, tfiala

Subscribers: lldb-commits

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

llvm-svn: 267923
2016-04-28 19:40:19 +00:00
Kuba Brecka bcdce3fd85 Provide location information (file name, line number) in TSan reports about global variables.
llvm-svn: 267894
2016-04-28 15:27:10 +00:00
Pavel Labath f726c346ea Remote flaky decorator from TestSignalsAPI on linux
The test seems to pass now, and the test does not seem to be doing anything unusual, so I don't
expect it to cause problems.

llvm-svn: 267867
2016-04-28 10:42:47 +00:00
Pavel Labath 35e9ea3812 Revert "Fixed a bug where const this would cause parser errors about $__lldb_expr."
This reverts commit r267833 as it breaks the build. It looks like some work in progress got
committed together with the actual fix, but I'm not sure which one is which, so I'll revert the
whole patch and let author resumbit it after fixing the build error.

llvm-svn: 267861
2016-04-28 08:16:19 +00:00
Jim Ingham deb384d103 Fix an inefficiency in the handling of $__lldb_local_vars in expressions.
The code in ClangExpressionDeclMap::FindExternalVisibleDecls figures out what the token 
means, and adds the namespace to the lookup context, but since it doesn't mark it as
special in the search context, we go on to pass the name $__lldb_local_vars to the ASTSource
for further lookup.  Unless we've done our job wrong, those lookups will always fail, but
the can be costly.

So I added a bit to m_found & use that to short-circuit the lookup.

<rdar://problem/25613384>

llvm-svn: 267842
2016-04-28 02:17:02 +00:00
Jim Ingham 76bb8d6719 Add the ability to limit "source regexp" breakpoints to a particular function
within a source file.

This isn't done, I need to make the name match smarter (right now it requires an
exact match which is annoying for methods of a class in a namespace.

Also, though we use it in tests all over the place, it doesn't look like we have
a test for Source Regexp breakpoints by themselves, I'll add that in a follow-on patch.

llvm-svn: 267834
2016-04-28 01:40:57 +00:00
Sean Callanan 8bdcd52251 Fixed a bug where const this would cause parser errors about $__lldb_expr.
In templated const functions, trying to run an expression would produce the
error

error: out-of-line definition of '$__lldb_expr' does not match any declaration in 'foo'
member declaration does not match because it is const qualified
error: 1 error parsing expression

which is no good.  It turned out we don't actually need to worry about "const,"
we just need to be consistent about the declaration of the expression and the
FunctionDecl we inject into the class for "this."

Also added a test case.

<rdar://problem/24985958>

llvm-svn: 267833
2016-04-28 01:36:21 +00:00
Adrian McCarthy 37d3fac3a7 XFail TestIRInterpreter on Windows
There's an open bug with calling functions in the inferior.  And Windows doesn't have the POSIX function getpid().

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

llvm-svn: 267800
2016-04-27 21:53:19 +00:00
Sean Callanan cac9b70692 Added a testcase for the IR interpreter, ensuring that it behaves like the JIT.
<rdar://problem/25785338>

llvm-svn: 267768
2016-04-27 19:37:42 +00:00
Kate Stone 2eabf2484f Renamed system plugin directory to address https://bugs.swift.org/browse/SR-1093
llvm-svn: 267749
2016-04-27 17:49:51 +00:00
Francis Ricci a030061c5b Use absolute module path when possible if sent in svr4 packets
Summary:
If the remote uses svr4 packets to communicate library info,
the LoadUnload tests will fail, as lldb only used the basename
for modules, causing problems when two modules have the same basename.

Using absolute path as sent by the remote will ensure that lldb
locates the module from the correct directory when there are overlapping
basenames. When debugging a remote process, LoadModuleAtAddress will still
fall back to using basename and module_search_paths, so we don't
need to worry about using absolute paths in this case.

Reviewers: ADodds, jasonmolenda, clayborg, ovyalov

Subscribers: lldb-commits, sas

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

llvm-svn: 267741
2016-04-27 17:10:15 +00:00
Kuba Brecka 3f61a183a8 Decorate TSan tests with "@skipUnlessThreadSanitizer" which skips the tests if the selected compiler can't compile with "-fsanitize=thread".
llvm-svn: 267726
2016-04-27 15:26:27 +00:00
Pavel Labath e0ee7c608a Remove flaky decorator from three tests on linux
The flakyness is no longer reproducible, and the tests seem to be passing reliably now.

llvm-svn: 267704
2016-04-27 12:43:37 +00:00
Pavel Labath 2f13da3ea4 Fix compiler warnings in SymbolFilePDBTests
llvm-svn: 267688
2016-04-27 10:40:52 +00:00
Jason Molenda d8f24a9c4f Committing patch from <Michael Woerister <michaelwoerister@posteo.net>
to use the default clang C/C++ expression parser when debugging
Rust programs.  Ideally there would be a rust language plugin to
support their language natively, but until then this will get simple
variable display to work.

http://reviews.llvm.org/D19545

llvm-svn: 267667
2016-04-27 04:50:51 +00:00
Adrian McCarthy fd5c9be4bb Fix TestRegisterVariables.py on Windows
Use __attribute__((regparm(x))) to ensure the compiler enregisters at least some arguments when calling functions.

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

llvm-svn: 267616
2016-04-26 22:25:40 +00:00
Jim Ingham dae50baf44 UtilityFunction::MakeFunctionCaller uses the Error to report failure,
but when there's was no process it was just returning an null pointer
and not setting the error.  I don't have a scenario where this might
go wrong, just code inspection...

llvm-svn: 267594
2016-04-26 19:46:39 +00:00
Adrian McCarthy d285007720 Fix send and receive of ACK byte in test infrastructure for Python 3.5
Python 3.5 is pickier about the distinction between chars and bytes (and strings and bytearrays) than Python 2.7.

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

llvm-svn: 267562
2016-04-26 15:15:29 +00:00
Pavel Labath a24427533f Bump up timeout in TestCallWithTimeout
Expression very rarely (linux buildbot, build 13907) completed before we managed to interrupt it.

llvm-svn: 267554
2016-04-26 13:37:24 +00:00
Omair Javaid e114a1711a rL267291: Architecture change to thumb on parsing arm.attributes causes regression.
Remove case handling elf arm attribute Tag_THUMB_ISA_use and setting architecture to thumb. 

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

llvm-svn: 267550
2016-04-26 11:26:00 +00:00
Omair Javaid 9a1699c0c6 Fix arm-linux-gnueabi regression due to rL267291
rL267291 introduces a lot regression on arm-linux LLDB testsuite.

This patch fixes half of them. I am merging it under already revied android counterpart.

Another patch fixing rest of the issue will follow this commit.

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

llvm-svn: 267508
2016-04-26 01:08:59 +00:00
Jim Ingham cef461772e When building the list of variables we're going to write "using $_lldb_local_vars"
statements for, be sure not to include variables that have no locations.  We wouldn't
be able to realize them, and that will cause all expressions to fail.

llvm-svn: 267500
2016-04-26 00:29:59 +00:00
Greg Clayton 07c8c4475f Make sure that the following SymbolFileDWARF functions can handle getting a lldb::user_id_t for another SymbolFileDWARF:
CompilerDecl
SymbolFileDWARF::GetDeclForUID (lldb::user_id_t type_uid);

CompilerDeclContext
SymbolFileDWARF::GetDeclContextForUID (lldb::user_id_t type_uid)

CompilerDeclContext
SymbolFileDWARF::GetDeclContextContainingUID (lldb::user_id_t type_uid)

Type*
SymbolFileDWARF::ResolveTypeUID (lldb::user_id_t type_uid)

<rdar://problem/25592223>

llvm-svn: 267494
2016-04-25 23:39:19 +00:00
Chaoren Lin f91daff9e6 Fix TestGetVariables.py.
Reviewers: sivachandra, clayborg

Subscribers: lldb-commits

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

llvm-svn: 267492
2016-04-25 23:29:53 +00:00
Greg Clayton a32532bfa5 Fix StackFrame::GetVariables(...) function that was broken by 261858 when lambda functions were added to Block::AppendBlockVariables(). The Stackframe::GetVariables(...) function should get all variables regardless if they are in scope.
This wasn't caught by the test suite so I added a test for it.

llvm-svn: 267478
2016-04-25 21:54:10 +00:00
Francis Ricci 55954aec70 Maintain register numbering across xml include features
Summary:
If the remote uses include features when communicating
xml register info back to lldb, the existing code would reset the
lldb register index at the beginning of each include node.
This would lead to multiple registers having the same lldb register index.
Since the lldb register numbers should be contiguous and unique,
maintain them accross the parsing of all of the xml feature nodes.

Reviewers: jingham, jasonmolenda, clayborg

Subscribers: lldb-commits, sas

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

llvm-svn: 267468
2016-04-25 21:03:55 +00:00
Francis Ricci be8cab737b Properly unload modules from target image list when using svr4 packets
Summary:
When we receive an svr4 packet from the remote, we check for new modules
and add them to the list of images in the target. However, we did not
do the same for modules which have been removed.

This was causing TestLoadUnload to fail when using ds2, which uses
svr4 packets to communicate all library info on Linux. This patch fixes
the failing test.

Reviewers: zturner, tfiala, ADodds

Subscribers: lldb-commits, sas

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

llvm-svn: 267467
2016-04-25 21:02:24 +00:00
Francis Ricci 39f1189acb Use Process Plugin register indices when communicating with remote
Summary:
eRegisterKindProcessPlugin is used to store the register
indices used by the remote, and eRegisterKindLLDB is used
to store the internal lldb register indices. However, we're currently
using the lldb indices instead of the process plugin indices
when sending p/P packets. This will break if the remote uses
non-contiguous register indices.

Reviewers: jasonmolenda, clayborg

Subscribers: lldb-commits, sas

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

llvm-svn: 267466
2016-04-25 20:59:11 +00:00
Francis Ricci cef04a25f6 Store absolute path for lldb executable in dotest.py
Summary:
lldb-server tests are currently being skipped on the
check-lldb target. This is because we get the path of
lldb-server by modifying the path to the lldb executable.
However, by this point, we've changed directories, and a
relative path to the build/bin directory will no longer point
to the location of lldb-server.

Storing an absolute path solves this issue.

Reviewers: vharron, zturner, tfiala, labath

Subscribers: labath, lldb-commits, sas

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

llvm-svn: 267463
2016-04-25 20:36:22 +00:00
Francis Ricci 4692f52daa Create _lldb python symlink correctly when LLVM_LIBDIR_SUFFIX is used
Summary:
Do not assume that liblldb.so is located in $(lldb -P)/../../../lib
when creating the _lldb python symlink. Instead, use the path passed
to LLVM_LIBDIR_SUFFIX, defaulting to $(lldb -P)/../../../lib when this
variable is not set.

Reviewers: vharron, emaste, zturner

Subscribers: zturner, labath, lldb-commits, sas

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

llvm-svn: 267462
2016-04-25 20:34:34 +00:00
Francis Ricci d60d96ffae Add missing qRegisterInfo option to gdbremote testcase
Summary:
"gcc" is equivalent to "ehframe" in ProcessGDBRemote, but
only "ehframe" was a valid response in the test suite.

Reviewers: tfiala, jasonmolenda, clayborg

Subscribers: lldb-commits, sas

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

llvm-svn: 267459
2016-04-25 20:24:30 +00:00
Francis Ricci 86f37ffa6f test commit
llvm-svn: 267443
2016-04-25 19:02:05 +00:00
Tamas Berghammer 0237eda929 Fix ARM attribute parsing for Android after rL267291
Differential revision: http://reviews.llvm.org/D19480

llvm-svn: 267422
2016-04-25 15:51:45 +00:00
Todd Fiala 6d547205f0 skip TestBitfields.py on OS X
tracked by:
https://llvm.org/bugs/show_bug.cgi?id=27515

llvm-svn: 267421
2016-04-25 15:48:34 +00:00
Pavel Labath 73151ff298 Skip TestBitfileds on linux
Test added in r267248 exposed a bug in handling of dwarf produced by clang>=3.9, which causes a
crash during expression evaluation. Skip the test until this is sorted out.

llvm-svn: 267407
2016-04-25 14:00:23 +00:00
Omair Javaid cbd7f8847e Handle invalid values of PLT entry size generated by linker
Make sure we figure out correct plt entry field in case linker has generated a small value below realistic entry size like 4 bytes or below.

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

llvm-svn: 267405
2016-04-25 13:45:39 +00:00
Pavel Labath 3c924653c1 Remove flaky decorator from two tests on linux
The flakyness is no longer reproducible, and the tests seem to be passing reliably now.

llvm-svn: 267392
2016-04-25 10:32:23 +00:00
Enrico Granata 520a422bd8 Add a --element-count option to the expression command
This option evaluates an expression and, if the result is of pointer type, treats it as if it was an array of that many elements and displays such elements

This has a couple subtle points but is mostly as straightforward as it sounds

Add a parray N <expr> alias for this new mode

Also, extend the --object-description mode to do the moral equivalent of the above but display each element in --object-description mode
Add a poarray N <expr> alias for this

llvm-svn: 267372
2016-04-25 00:52:47 +00:00
Ulrich Weigand 7793ba86d1 Fix unwind failures when PC points beyond the end of a function
RegisterContextLLDB::InitializeNonZerothFrame already has code to attempt
to detect and handle the case where the PC points beyond the end of a
function, but there are certain cases where this doesn't work correctly.

In fact, there are *two* different places where this detection is attempted,
and the failure is in fact a result of an unfortunate interaction between
those two separate attempts.

First, the ResolveSymbolContextForAddress routine is called with the
resolve_tail_call_address flag set to true.  This causes the routine
to internally accept a PC pointing beyond the end of a function, and
still resolving the PC to that function symbol.

Second, the InitializeNonZerothFrame routine itself maintains a
"decr_pc_and_recompute_addr_range" flag and, if that turns out to
be true, itself decrements the PC by one and searches again for
a symbol at that new PC value.

Both approaches correctly identify the symbol associated with the PC.
However, the problem is now that later on, we also need to find the
DWARF CFI record associated with the PC.  This is done in the
RegisterContextLLDB::GetFullUnwindPlanForFrame routine, and uses
the "m_current_offset_backed_up_one" member variable.

However, that variable only actually contains the PC "backed up by
one" if the *second* approach above was taken.  If the function was
already identified via the first approach above, that member variable
is *not* backed up by one but simply points to the original PC.
This in turn causes GetEHFrameUnwindPlan to not correctly identify
the DWARF CFI record associated with the PC.

Now, in many cases, if the first method had to back up the PC by one,
we *still* use the second method too, because of this piece of code:

    // Or if we're in the middle of the stack (and not "above" an asynchronous event like sigtramp),
    // and our "current" pc is the start of a function...
    if (m_sym_ctx_valid
        && GetNextFrame()->m_frame_type != eTrapHandlerFrame
        && GetNextFrame()->m_frame_type != eDebuggerFrame
        && addr_range.GetBaseAddress().IsValid()
        && addr_range.GetBaseAddress().GetSection() == m_current_pc.GetSection()
        && addr_range.GetBaseAddress().GetOffset() == m_current_pc.GetOffset())
    {
        decr_pc_and_recompute_addr_range = true;
    }

In many cases, when the PC is one beyond the end of the current function,
it will indeed then be exactly at the start of the next function.  But this
is not always the case, e.g. if there happens to be alignment padding
between the end of one function and the start of the next.

In those cases, we may sucessfully look up the function symbol via
ResolveSymbolContextForAddress, but *not* set decr_pc_and_recompute_addr_range,
and therefore fail to find the correct DWARF CFI record.

A very simple fix for this problem is to just never use the first method.
Call ResolveSymbolContextForAddress with resolve_tail_call_address set
to false, which will cause it to fail if the PC is beyond the end of
the current function; or else, identify the next function if the PC
is also at the start of the next function.  In either case, we will
then set the decr_pc_and_recompute_addr_range variable and back up the
PC anyway, but this time also find the correct DWARF CFI.

A related problem is that the ResolveSymbolContextForAddress sometimes
returns a "symbol" with empty name.  This turns out to be an ELF section
symbol.  Now, usually those get type eSymbolTypeInvalid.  However, there
is code in ObjectFileELF::ParseSymbols that tries to change the type of
invalid symbols to eSymbolTypeCode or eSymbolTypeData if the symbol
lies within the code or data section.

Unfortunately, this check also hits the symbol for the code section
itself, which is then marked as eSymbolTypeCode.  While the size of
the section symbol is 0 according to the ELF file, LLDB considers
this size invalid and attempts to figure out the "correct" size.
Depending on how this goes, we may end up with a symbol that overlays
part of the code section, even outside areas covered by real function
symbols.

Therefore, if we call ResolveSymbolContextForAddress with PC pointing
beyond the end of a function, we may get this bogus section symbol.
This again means InitializeNonZerothFrame thinks we have a valid PC,
but then we don't find any unwind info for it.

The fix for this problem is me to simply always leave ELF section
symbols as type eSymbolTypeInvalid.

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

llvm-svn: 267363
2016-04-24 20:49:56 +00:00
Saleem Abdulrasool d2d1504805 ObjectFile: parse EABI Attributes
This adds basic parsing of the EABI attributes section.  This section contains
additional information about the target for which the file was built.  Attempt
to infer additional architecture information from that section.

llvm-svn: 267291
2016-04-23 16:00:15 +00:00
Greg Clayton cae0855a62 DWARF layout for bitfields is wrong when the bit offset is negative.
Some older versions of clang emitted bit offsets that were negative and these bitfields would have their bitfield-ness stripped off and it would cause a clang assertion in clang assertions were enabled. I updated the bitfield C test to make sure we don't regress.

<rdar://problem/21082998> 

llvm-svn: 267248
2016-04-22 23:14:35 +00:00
Saleem Abdulrasool 6010f97ee6 Source: fix another -Wunused-variable warning
Conditionalise a variable definition which may be unused in certain compilations
due to the preprocessor.  Protect the variable accordingly.  NFC.

llvm-svn: 267247
2016-04-22 23:08:34 +00:00
Greg Clayton f443135b8c Fixed in issue with ObjectFileMachO where it would add empty sections to the section list that was used to try and cap symbols to the max address of the section in which it is contained. The empty sections would make cap the symbols and make their sizes zero. Also fixed a few other things that could cause problems in the SymbolFileDWARFDebugMap when zero sized symbols were found and used to make OSO range map entries.
<rdar://problem/25886773>

llvm-svn: 267237
2016-04-22 22:35:08 +00:00
Greg Clayton b6bd4618eb Fix a build-llvm.py crasher when we can't find cmake. Now it exits with a valid error that explains what went wrong.
llvm-svn: 267235
2016-04-22 22:15:59 +00:00
Kuba Brecka 5b31c423a0 Renumber ThreadSanitizer-provided thread IDs to match LLDB thread numbers.
llvm-svn: 267133
2016-04-22 10:40:14 +00:00
Pavel Labath 69ef42cc42 Update comment in lldb-enumerations.h
llvm-svn: 267124
2016-04-22 08:41:07 +00:00
Ryan Brown 5852c5a12f Update Go OS Plugin for newer runtimes.
Differential Revision: http://reviews.llvm.org/D19273

llvm-svn: 267048
2016-04-21 20:57:28 +00:00
Saleem Abdulrasool 358efd6557 API: fix a -Wunused-variable warning
expr_log is only conditionally used via preprocessing.  Ensure that we guard the
definition accordingly.  NFC.

llvm-svn: 267001
2016-04-21 16:56:02 +00:00
Saleem Abdulrasool 25b75a2f7d Host: fix some -Wformat-pedantic warnings
Add explicit casts for function pointer to void * for %p conversion.  NFC.

llvm-svn: 267000
2016-04-21 16:55:58 +00:00
Jim Ingham 0d6a90dfc3 Expressions can run without a process.
Code was added in ClangExpressionParser::ClangExpressionParser that was calling through
the process w/o checking that it was good.  Also, we were pretending that we could do something
reasonable if we had no target, but that's actually not true, so I check for a target at the
beginning of the constructor and don't make a compiler in that case.

<rdar://problem/25841198>

llvm-svn: 266944
2016-04-21 01:46:11 +00:00
Kate Stone 0761202612 Corrected wording of REPL not available messaging (contained a repeated word and lacked clarity.)
llvm-svn: 266941
2016-04-21 00:56:08 +00:00
Kate Stone 25d6072adc Added command prefix to new help messages to ensure that they're correctly words in REPL mode.
llvm-svn: 266940
2016-04-21 00:55:20 +00:00
Kate Stone 7cc41e02c1 Removed extraneous print() in decorator for enabling module debugging
llvm-svn: 266924
2016-04-20 21:59:43 +00:00
Greg Clayton 0257603c2d When making an array or stuct/union/class elements, make sure the type is complete. If the type isn't complete, complete the type so that clang won't assert and kill your program. Since the DWARF assists in doing layout, it won't show the array or struct/unions/class elements correctly, but it will stop you from crashing if you have a struct/union/class that contains one of these arrays.
<rdar://problem/25057391>

llvm-svn: 266922
2016-04-20 21:47:56 +00:00
Todd Fiala a8c37c8fa1 update Jenkins Xcode buildbot target for r266885
llvm-svn: 266917
2016-04-20 20:54:59 +00:00
Enrico Granata 612917c784 Fix a bug where LLDB would crash if 'apropos <anything>' was used after spawning an inferior process
llvm-svn: 266911
2016-04-20 20:48:05 +00:00
Zachary Turner b987df4b17 Add missing file needed for PDB unittests.
llvm-svn: 266886
2016-04-20 16:41:02 +00:00
Todd Fiala 49d3c15c3e test infra: move test event-related handling into its own package
This change moves all the test event handling and its related
ResultsFormatter classes out of the packages/Python/lldbsuite/test dir
into a packages/Python/lldbsuite/test_event package. Formatters are
moved into a sub-package under that.

I am limiting the scope of this change to just the motion and a few
minor issues caught by a static Python checker (e.g. removing unused
import statements).

This is a pre-step for adding package-level tests to the test event
system. I also intend to simplify test event results formatter selection
after I make sure this doesn't break anybody.

See:
http://reviews.llvm.org/D19288

Reviewed by:
Pavel Labath

llvm-svn: 266885
2016-04-20 16:27:27 +00:00
Tamas Berghammer 1a8b821099 Fix xfail for test_tilde_home_directory on windows
llvm-svn: 266867
2016-04-20 09:54:47 +00:00
Greg Clayton f258bf9017 llvm::sys::path::home_directory() relies on having "HOME" set in the environment and that might not always be set. Our FileSpec class uses this function to resolve any paths that start with "~/" on systems that support home directories as '~'. I have modified FileSpec::ResolveUsername (llvm::SmallVectorImpl<char> &path) to deal with the cases where llvm::sys::path::home_directory() returns false by digging a little further on unix systems and setting "HOME" in the environment so that subsequent calls to llvm::sys::path::home_directory() will succeed.
I also added a test to ensure we don't regress.

<rdar://problem/25342377> 

llvm-svn: 266832
2016-04-19 23:04:35 +00:00
Kate Stone 317871d793 Eliminate circular dependency introduced between lldbtest.py and decorators.py
llvm-svn: 266815
2016-04-19 20:45:47 +00:00
Kate Stone 8410ddd8b6 Adds a test to detect when clang omits specialized generic types from debug information when using precompiled headers and -gmodules.
llvm-svn: 266791
2016-04-19 18:20:11 +00:00
Pavel Labath 6145366510 Revert "LLDB: Fixed two race conditions when stopping private state thread"
This reverts commit r266733 as it causes a number of failures on linux buildbots.

llvm-svn: 266736
2016-04-19 14:03:43 +00:00
Marianne Mailhot-Sarrasin 0c6d7c0a2c LLDB: Fixed two race conditions when stopping private state thread
When stopping the private state thread, there was a race condition between the time the thread exits (resetting the HostThread object) and the time a Join was attempted, especially in the case of a timeout.

The previous workaround of copying the HostThread object is not enough, since on a Reset the internal thread stuff gets nulled out regardless of which HostThread object actually has Reset called on it, resulting in an attempt to dereference a null pointer on the subsequent call to Join from the copy as well.

Additionally, there was a race between the detach (called when stopping the process) and the stop itself, causing the stop to time out because it was waiting for the private state thread to see the stop state, but it had exited immediately after entering the detached state.

Patch by cameron314

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

llvm-svn: 266733
2016-04-19 13:21:46 +00:00
Pavel Labath 79b25d5ea4 Fix typo in TestSourceManager.py
llvm-svn: 266725
2016-04-19 09:31:14 +00:00
Todd Fiala ca5793ea5c test infra cleanup: convert test_runner lib into package
Also does the following:
* adopts PEP8 naming convention for OptionalWith class (now
  optional_with).
* moves test_runner/lldb_utils.py to lldbsuite/support/optional_with.py.
* packages tests in a subpackage of test_runner per recommendations in
  http://the-hitchhikers-guide-to-packaging.readthedocs.org/en/latest/creation.html

Tests can be run from within pacakges/Python/lldbsuite/test via this
command:

  python -m unittest discover test_runner

The primary cleanup this allows is avoiding the need to muck with the
PYTHONPATH variable from within the source files.  This also aids some
of the static code checkers as they don't need to run code to determine
the proper python path.

llvm-svn: 266710
2016-04-19 04:20:35 +00:00
Chaoren Lin 167c796232 Fix Windows build.
llvm-svn: 266702
2016-04-19 01:09:37 +00:00
Todd Fiala dad52cee4b ensure lldbinline remembers .py extension
This ensure lldbinline.test_file paths are tracked as .py
files rather than .pyc files.

Also, this change adds an assert to the test infrastructure
if a filename that is not ending in .py is attempted to be
added to the test events infrastructure where we track test
results.

See:
http://reviews.llvm.org/D19215

Earlier revision reviewed by:
Pavel Labath

llvm-svn: 266664
2016-04-18 20:26:56 +00:00
Todd Fiala 430309f13a fix a race is the LLDB test suite results collection
The race boiled down to this:

If a test worker queue is able to run the test inferior and
clean up before the dosep.py listener socket is spun up, and
the worker queue is the last one (as would be the case when
there's only one test rerunning in the rerun queue), then
the test suite will exit the main loop before having a chance
to process any test events coming from the test inferior or
the worker queue job control.

I found this race to be far more likely on fast hardware.
Our Linux CI is one such example.  While it will show
up primarily during meta test events generated by
a worker thread when a test inferior times out or
exits with an exceptional exit (e.g. seg fault), it only
requires that the OS takes longer to hook up the
listener socket than it takes for the final test inferior
and worker thread to shut down.

See:
http://reviews.llvm.org/D19214

reviewed by:
Pavel Labath

llvm-svn: 266624
2016-04-18 16:09:21 +00:00
Pavel Labath 7eafdced6e Attempt to fix darwin build after header refactor in llvm (r266595)
llvm-svn: 266605
2016-04-18 12:18:35 +00:00
Pavel Labath 8222151a7e Fixup r266327
Fix XFAILed tests in TestThreadStates for the new signature of wait_for_running_event.

llvm-svn: 266598
2016-04-18 11:01:41 +00:00
Mohit K. Bhakkad 76a7ca0f67 [LLDB][MIPS] Fix TestConcurrentEvents
Patch by Nitesh Jain

Reviewers: clayborg
Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar
Differential Revision: http://reviews.llvm.org/D18389

llvm-svn: 266589
2016-04-18 05:27:42 +00:00
Oleksiy Vyalov 37a09e72bc Fix cmake build after r266524.
llvm-svn: 266530
2016-04-16 16:29:17 +00:00
Alex Denisov 4e0cc9e0fd Replace hardcoded comment at 'lit.site.cfg.in'
At the moment almost every lit.site.cfg.in contains two lines comment:

  ## Autogenerated by LLVM/Clang configuration.
  # Do not edit!

The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from
configure_lit_site_cfg with the note and some useful information.

llvm-svn: 266522
2016-04-16 07:14:05 +00:00
Pavel Labath 7ef36b5c15 Work around a linux libc bug causing a crash in TaskPool
Summary:
Doing a pthread_detach while the thread is exiting can cause crashes or other mischief, so we
make sure the thread stays around long enough. The performance impact of the added
synchronization should be minimal, as the parent thread is already holding a mutex, so I am just
making sure it holds it for a little while longer. It's possible the new thread will block on
this mutex immediately after startup, but it should be unblocked really quickly and some
blocking is unavoidable if we actually want to have this synchronization.

Reviewers: tberghammer

Subscribers: lldb-commits

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

llvm-svn: 266423
2016-04-15 10:49:07 +00:00
Ulrich Weigand 9521ad2a49 Fix usage of APInt.getRawData for big-endian systems
Recommit modified version of r266311 including build bot regression fix.

This differs from the original r266311 by:

- Fixing Scalar::Promote to correctly zero- or sign-extend value depending
  on signedness of the *source* type, not the target type.

- Omitting a few stand-alone fixes that were already committed separately.

llvm-svn: 266422
2016-04-15 09:55:52 +00:00
Ulrich Weigand 9a0fdfe009 Make Scalar::SChar return an explicit signed type
This is needed for platforms where the default "char" type is unsigned.

Originally committed as part of (now reverted) r266311.

llvm-svn: 266420
2016-04-15 09:15:47 +00:00
Ulrich Weigand fb7207ef89 Fix Scalar::MakeSigned for 128- and 256-bit types.
Obvious fix for incorrect result types of the operation.

Originally committed as part of (now reverted) r266311.

llvm-svn: 266419
2016-04-15 09:15:22 +00:00
Ulrich Weigand d8d2c5c81c Fix Scalar::SetValueFromData for 128- and 256-bit types
Obvious fix for incorrect use of GetU64 offset pointer.

Originally committed as part of (now reverted) r266311.

llvm-svn: 266418
2016-04-15 09:14:59 +00:00
Ulrich Weigand 2b6c791930 Fix ABISysV_s390x::GetArgumentValues
This routine contained a stray "return false;" making part of the code
never executed.  Also, the stack offset where to find on-stack arguments
was incorrect.

llvm-svn: 266417
2016-04-15 09:14:32 +00:00
Pavel Labath 5c17454cd6 Make destructor breakpoint location test more resilient
Summary:
The original breakpoint location test was failing for linux, because the compilers here tend to
merge the full-object and subobject destructors even at -O0 (as a result, we are getting only 2
breakpoint locations, and not 4 as the test expected. The fixup in r266164 substantially weakened
the test, as it now did not check whether both kinds of destructors were being found.

Because of these contraints, I have altered the logic of the test. It sets the
breakpoint by name, and then independently verifies that the breakpoint is set on the correct
demangled symbol name (which is not very meaningful since both kinds of destructors demangle to
the same name) *and* the correct symbol address (which is obtained by looking up the mangled
symbol name).

Reviewers: clayborg

Subscribers: ovyalov, zturner, lldb-commits

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

llvm-svn: 266416
2016-04-15 09:11:22 +00:00
Jim Ingham 4cd7c3b7d5 Add the PDBParser.{cpp,h} files to the Xcode project.
llvm-svn: 266407
2016-04-15 01:42:30 +00:00
Oleksiy Vyalov 987c8788d4 Rename out->std_out in AppleObjCRuntimeV2.cpp.
llvm-svn: 266401
2016-04-15 00:56:11 +00:00