Commit Graph

12210 Commits

Author SHA1 Message Date
Pavel Labath c6a144b0aa Increase timeout in TestCallWithTimeout to reduce flakyness
The test was flaky on the android buildbot, because the 10ms test completed before we got a
chance to interrupt it. I increase the duration to 50ms to hopefully get more consistent results.

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

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

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

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

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

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

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

Reviewers: ovyalov, tberghammer

Subscribers: lldb-commits

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

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

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

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

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

llvm-svn: 245488
2015-08-19 20:04:03 +00:00
Chaoren Lin b0138025ec XTIMEOUT TestChangeProcessGroup for Linux.
llvm-svn: 245477
2015-08-19 18:39:25 +00:00
Chaoren Lin febef1b017 XTIMEOUT TestEvents and TestThreadStates for Windows to Android.
llvm-svn: 245464
2015-08-19 17:22:12 +00:00
Chaoren Lin d904371271 XTIMEOUT TestExitDuringStep for Darwin.
llvm-svn: 245460
2015-08-19 17:13:02 +00:00
Pavel Labath 4b48595adf Increase timeout in TestCallThatRestarts
the test was failing on android because processing 30 signals involved a lot of round-trips,
which was not possible in the 0.5s default timeout. After the increase the test seems to pass
reliably.

llvm-svn: 245448
2015-08-19 15:24:02 +00:00
Pavel Labath 14e21925a5 Add TestCrashDuringStep
this tests that a crash that happens during instruction step is reported correctly.

llvm-svn: 245440
2015-08-19 14:15:45 +00:00
Pavel Labath 78856474fb On Linux, clear the signal mask of the launched inferior
Summary:
Due to fork()/execve(), the launched inferior inherits the signal mask of its parent (lldb-server). But because lldb-server modifies its signal mask (It blocks SIGCHLD, for example), the inferior starts with some signals being initially blocked.

One consequence is that TestCallThatRestarts.ExprCommandThatRestartsTestCase (test/expression_command/call-restarts) fails because sigchld_handler() in lotta-signals.c is not called, due to the SIGCHLD signal being blocked.

To prevent the signal masking done by lldb-server from affecting the created inferior, the signal mask of the inferior is now cleared before the execve().

Patch by: Yacine Belkadi

Reviewers: ovyalov, labath

Subscribers: lldb-commits

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

llvm-svn: 245436
2015-08-19 13:47:57 +00:00
Omair Javaid dee4a867be Fix lldb-server arm-linux-g++ build
llvm-svn: 245428
2015-08-19 10:44:16 +00:00
Chaoren Lin 9a379c19a9 XFAIL TestCppScope for Darwin.
llvm-svn: 245418
2015-08-19 06:21:09 +00:00
Chaoren Lin 464be90e6d Fix TestCppNsImport and TestCppScope for remote tests.
llvm-svn: 245412
2015-08-19 04:08:56 +00:00
Chaoren Lin 46fc8168c2 XFAIL TestCppChainedCalls for GCC.
llvm-svn: 245407
2015-08-19 02:55:33 +00:00
Chaoren Lin 57998de165 Update to r245397.
`ast_transformer` could be null, in which case we should initialize
`m_code_generator` with the ASTContext.

llvm-svn: 245398
2015-08-19 01:24:57 +00:00
Richard Smith 453930d7c3 Fix LLDB after Clang r245346.
The right thing to do here would be to give the ASTConsumer to the
CompilerInstance so it can set things up for us, but we can't do that
because we don't own it. So instead just initialize it ourselves.

llvm-svn: 245397
2015-08-19 01:05:34 +00:00
Paul Herman 10bc1a4e83 Fix resolution conflict between global and class static variables in C++
llvm-svn: 245381
2015-08-18 22:46:57 +00:00
Paul Herman b058fb47db Test chaned function calls and imported namespaces in C++
llvm-svn: 245380
2015-08-18 22:43:37 +00:00
Greg Clayton 6dc8d583b9 More abstraction to get almost all clang specific DWARF parsing code into ClangASTContext.
llvm-svn: 245376
2015-08-18 22:32:36 +00:00
Greg Clayton 7b1c497862 Fix inconsistent use of override warnings.
llvm-svn: 245375
2015-08-18 22:31:29 +00:00
Greg Clayton 2ad6ac5461 Quiet build warnings on MacOSX.
llvm-svn: 245373
2015-08-18 22:30:25 +00:00
Zachary Turner 913f776ff9 Fix TestArrayTypes on Windows.
Whether or not frames print their tid in hex or decimal is apparently
hardcoded to depend on the operating system.  For now a comment was
added that this should be changed to a more sane check (for example
a setting), and the OS check is updated to do the right thing for
Windows.

llvm-svn: 245371
2015-08-18 22:25:40 +00:00
Oleksiy Vyalov 6e295cd179 Mark TestCModules as XFAIL on OSX.
http://reviews.llvm.org/D11962

llvm-svn: 245357
2015-08-18 21:20:25 +00:00
Zachary Turner 2878bf44b1 [Windows] XFAIL tests that depend on expression name lookup.
Name lookup doesn't work properly with Windows targets.  This is
most likely due to issues with name mangling, although there is at
least one set of debug info related issues as well, since some of
the name lookup requests appear to be failing on types rather than
symbols.

Specifically, this patch XFAILS the following set of tests:

TestChar1632T.py
TestRdar12991846.py
TestConstVariables.py
TestCallCPPFunction.py
TestCallStopAndContinue.py
TestCallUserDefinedFunction.py
TestCModules.py
TestCPPThis.py
TestExprs2.py
TestOverloadedFunctions.py
TestRvalueReferences.py

And fixing the underlying issue is tracked in http://llvm.org/pr24489

llvm-svn: 245338
2015-08-18 20:01:28 +00:00
Siva Chandra 9851b1f62b [ValueObjectSynthetic and ValueObjectDynamicValue] Override GetDeclaration
Summary:
Returns the declaration of the parent (non-synthetic or static) value.


Reviewers: granata.enrico, clayborg

Subscribers: lldb-commits

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

llvm-svn: 245319
2015-08-18 17:56:06 +00:00
Pavel Labath 083645bc5c Fix Clang-tidy misc-use-override warnings in include/lldb/Expression and include/lldb/Initialization, unify inclusion guards
patch by Eugene Zelenko.

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

llvm-svn: 245283
2015-08-18 09:18:19 +00:00
Pavel Labath 04b7f51250 Fix Clang-tidy misc-use-override warnings in include/lldb/DataFormatters and include/lldb/Host, unify closing inclusion guards
patch by Eugene Zelenko.

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

llvm-svn: 245279
2015-08-18 09:06:31 +00:00
Pavel Labath e6f9abfd91 Fix Clang-tidy misc-use-override warnings in include/lldb/Utility and some files in include/lldb/Target, unify closing inclusion guards
patch by Eugene Zelenko.

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

llvm-svn: 245277
2015-08-18 08:54:26 +00:00
Pavel Labath 280eb8ab4d Fix Clang-tidy misc-use-override warnings in some files in include/lldb/Core, unify closing inclusion guards
patch by Eugene Zelenko

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

llvm-svn: 245275
2015-08-18 08:39:09 +00:00
Omair Javaid e68ee7f960 Fix AArch64 watchpoint exception handling
http://reviews.llvm.org/D11987

llvm-svn: 245273
2015-08-18 08:28:06 +00:00
Pavel Labath d2c4c9b132 [LLGS] Avoid misrepresenting log lines as inferior output
Summary:
in case we are logging to stdout, any log lines from the forked child can be misconstrued to be
inferior output. To avoid this, we disable all logging immediately after forking.

I also fix the implementatoion of DisableAllLogChannels, which was a no-op before this commit.

Reviewers: clayborg, ovyalov

Subscribers: dean, lldb-commits

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

llvm-svn: 245272
2015-08-18 08:23:35 +00:00
Chaoren Lin dea51da7a5 Revert part of "Convert all use of pthreads in tests to c++11 threads."
TestExprDoesntBlock started failing because deadlocks behave differently with
pthread_mutex and std::mutex.

This reverts part of commit r245234.

llvm-svn: 245262
2015-08-18 00:27:08 +00:00
Jason Molenda 040cd4207c Remove unintentional ;'s.
llvm-svn: 245261
2015-08-18 00:21:24 +00:00
Greg Clayton 196e8cd792 Make sure to save the types we parse in our SymbolFile's type list so they don't get deleted.
llvm-svn: 245237
2015-08-17 20:31:46 +00:00
Zachary Turner 8778fea0bb Convert all use of pthreads in tests to c++11 threads.
This eliminates portability issues among platforms that don't have
a pthreads implementation.

Differential Revision: http://reviews.llvm.org/D12043
Reviewed By: Greg Clayton

llvm-svn: 245234
2015-08-17 20:12:04 +00:00
Pavel Labath bb467f6f04 Revert "[LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue"
Reverting as this commit causes an infinite loop.

llvm-svn: 245222
2015-08-17 15:28:05 +00:00
Sagar Thakur 789da6678e [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode support
This patch :

- Fixes offsets of all register sets for Mips.
- Adds MSA register set and FRE=1 mode support for FP register set.
- Separates lldb register numbers and register infos of freebsd/mips64 from linux/mips64.
- Re-orders the register numbers of all kinds for mips to be consistent with freebsd order of register numbers.

Reviewers: jaydeep, clayborg, jasonmolenda, ovyalov, emaste
Subscribers: tberghammer, ovyalov, emaste, mohit.bhakkad, nitesh.jain, bhushan
Differential: http://reviews.llvm.org/D10919
llvm-svn: 245217
2015-08-17 13:40:17 +00:00
Sagar Thakur ee3443e0d6 [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue
Eliminated ENABLE_128_BIT_SUPPORT and union ValueData from Scalar.cpp and use llvm::APInt and llvm::APFloat for all integer and floating point types. Also used Scalar in RegisterValue.cpp

Reviewers: jaydeep, clayborg, jasonmolenda, ovyalov, emaste
Subscribers: tberghammer, ovyalov, emaste, mohit.bhakkad, nitesh.jain, bhushan
Differential: http://reviews.llvm.org/D10919
llvm-svn: 245216
2015-08-17 12:05:31 +00:00
Yaron Keren fe16dea62a Try to fix the lldb build on Visual C++.
llvm-svn: 245185
2015-08-16 19:40:40 +00:00
Jason Molenda a3664138dd Update DynamicRegisterInfo::SetRegisterInfo to accept eh_frame register
numbers in the key name "ehframe" or "eh_frame" in addition to the deprecated
"gcc" name (e.g. from a plugin.process.gdb-remote.target-definition-file
python file).

llvm-svn: 245151
2015-08-15 02:59:42 +00:00
Jason Molenda a18f7071c2 A messy bit of cleanup: Move towards more descriptive names
for eh_frame and stabs register numberings.  This is not
complete but it's a step in the right direction.  It's almost
entirely mechanical.

lldb informally uses "gcc register numbering" to mean eh_frame.
Why?  Probably because there's a notorious bug with gcc on i386
darwin where the register numbers in eh_frame were incorrect.
In all other cases, eh_frame register numbering is identical to
dwarf.

lldb informally uses "gdb register numbering" to mean stabs.
There are no official definitions of stabs register numbers
for different architectures, so the implementations of gdb
and gcc are the de facto reference source.

There were some incorrect uses of these register number types
in lldb already.  I fixed the ones that I saw as I made
this change.

This commit changes all references to "gcc" and "gdb" register
numbers in lldb to "eh_frame" and "stabs" to make it clear 
what is actually being represented.

lldb cannot parse the stabs debug format, and given that no
one is using stabs any more, it is unlikely that it ever will.
A more comprehensive cleanup would remove the stabs register
numbers altogether - it's unnecessary cruft / complication to
all of our register structures.

In ProcessGDBRemote, when we get register definitions from
the gdb-remote stub, we expect to see "gcc:" (qRegisterInfo)
or "gcc_regnum" (qXfer:features:read: packet to get xml payload).
This patch changes ProcessGDBRemote to also accept "ehframe:"
and "ehframe_regnum" from these remotes.

I did not change GDBRemoteCommunicationServerLLGS or debugserver
to send these new packets.  I don't know what kind of interoperability
constraints we might be working under.  At some point in the future
we should transition to using the more descriptive names.

Throughout lldb we're still using enum names like "gcc_r0" and "gdb_r0",
for eh_frame and stabs register numberings.  These should be cleaned
up eventually too.

The sources link cleanly on macosx native with xcode build.  I
don't think we'll see problems on other platforms but please let
me know if I broke anyone.

llvm-svn: 245141
2015-08-15 01:21:01 +00:00