Commit Graph

10909 Commits

Author SHA1 Message Date
David Blaikie dab893cb99 Fix -Wsign-compare warning
llvm-svn: 233408
2015-03-27 20:19:14 +00:00
Ed Maste a59d4db4f7 Move debug register output into __amd64__ (FreeBSD)
This debug register diagnostic is really only applicable to amd64 at
present.

llvm-svn: 233403
2015-03-27 20:11:37 +00:00
Siva Chandra bfbc7b9c41 [TestMiExec] Fix the test for GCC after r233336.
Test Plan: dotest.py -C gcc p TestMiExec

Reviewers: vharron

Subscribers: lldb-commits

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

llvm-svn: 233382
2015-03-27 16:00:51 +00:00
Tamas Berghammer 492519c884 Specify LLDB_REGNUM_GENERIC_ARG* registers for arm64
llvm-svn: 233369
2015-03-27 10:29:25 +00:00
Ying Chen 464d1e1439 Allow ExpectedFailure* decorators to work with optional arguments
-if the decorator functions called with optional arguments, return decorator to orignal method

llvm-svn: 233338
2015-03-27 00:26:52 +00:00
Siva Chandra 462722d135 [DWARF] Generate qualified names of functions if linkage names are missing.
Summary:
This is similar to the change introduced for variable DIEs in r233098. If the
linkage names of functions are missing in the DWARF, then their fully qualified
names (similar to the name that would be got by demangling their linkage name)
is generated using the decl context.

This change fixes TestNamespace when the test case is compiled with GCC, hence
it is enabled for GCC. The test and the test case are also enhanced to cover
variadic functions.

Test Plan: dotest.py -C <clang|gcc> -p TestNamespace

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 233336
2015-03-27 00:10:04 +00:00
Robert Flack a5bcb2ed8a Add/fix FreeBSD/arm64 files in xcode build from r233273.
llvm-svn: 233317
2015-03-26 21:02:03 +00:00
Zachary Turner e6d213a84a Fix a race condition in Target::Launch
When no hijack listener is set up, the global event listener will
try to pull events off the queue, racing with the event thread.
By always forcing a hijack listener, even when one was not given,
we guarantee that the listener always gets all events.

This was causing problems in synchronous mode with the process
stop event sometimes never being picked up and causing the debugger
to hang while processing a .lldbinit file.

Reviewed by: Jim Ingham
Differential Revision: http://reviews.llvm.org/D8562

llvm-svn: 233315
2015-03-26 20:41:14 +00:00
Robert Flack efa49c2665 Change expectedFailureOS and skipIfPlatform checks to be based on target platform when running test suite remotely.
Most expected OS failures or skipped tests are about the target platform on
which the test binary is being run, not the host platform launching the tests.
This changes expectedFailureOS and skipIfPlatform to check against the remote
platform when running remote tests.

Test Plan:
Run ./do_sep.py test suite against a remote target on a different platform and
verify that tests which should be excluded on the remote platform are excluded.

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

llvm-svn: 233311
2015-03-26 19:34:26 +00:00
Zachary Turner 072964dc0d Fix the remaining two test failures caused by re-ordering of teardown.
Previously we were using teardown hooks in these two instances to
shutdown processes.  TestBase already deletes all targets in its
own teardown, which will kill processes, so these steps weren't
necessary.

llvm-svn: 233308
2015-03-26 18:59:56 +00:00
Zachary Turner 9581204ceb Fix test failures caused by order of initialization.
tear down hooks run as part of Base.tearDown().  Some of these
hooks rely on accessing the debugger instance.  So although it
looks awkward, we need to call "del self.dbg" after calling
Base.tearDown().

llvm-svn: 233306
2015-03-26 18:54:21 +00:00
Stephane Sezer ca05ae2bff Add an assertion for frame[0] being valid in CommandObjectThread.cpp.
Summary:
This should always be true but sometimes is not, during platform bring
up. As recommended by Jim Ingham, an assertion should be enough here to
help.
This addresses post commit comments in http://reviews.llvm.org/D8554.

Test Plan: Run unit tests.

Reviewers: jasonmolenda, emaste, jingham, clayborg

Subscribers: lldb-commits

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

llvm-svn: 233298
2015-03-26 17:47:34 +00:00
Adrian McCarthy c7fd5ff745 Fixing typo in tutorial as test commit.
llvm-svn: 233287
2015-03-26 16:53:34 +00:00
Zachary Turner 65fe1eb5f8 Tear down tests in reverse order from setting them up.
Tests derive from TestBase, which derives from Base.  In the
test setUp() methods, we always call TestBase.setUp() first and
then call implementation-specific setup.  Tear down needs to do
the reverse.

This was causing over 20 failures on Windows, and was the culprit
behind about 80% of the files not being cleaned up after test run.
TestBase.tearDown() is responsible for deleting all targets created
during the test run and without this step, on Windows files will
be locked and cannot be deleted.  But TestBase.tearDown() was
calling Base.tearDown() before its own cleanup (i.e. deleting the
targets) and in some cases one of the teardown hooks would be to
call make clean.  So make clean would be run before the targets
had been deleted, and fail to remove the files, and subsequently
result in a failed test as well.

llvm-svn: 233284
2015-03-26 16:43:25 +00:00
Zachary Turner aa4dabfd85 Add a --all command option to "target delete".
llvm-svn: 233283
2015-03-26 16:43:13 +00:00
Ed Maste 27b4ed0983 Add FreeBSD/arm64 files to xcode build
llvm-svn: 233281
2015-03-26 15:55:16 +00:00
Ilia K 841e30ae71 Fix RegisterCommandsTestCase and HelloWorldTestCase tests which hang on OS X after TestBase.tearDown()
llvm-svn: 233279
2015-03-26 15:43:46 +00:00
Ilia K 5704347c29 Fix infinite loop when ^D was pressed (MI)
llvm-svn: 233278
2015-03-26 15:10:32 +00:00
Ed Maste 7754d21ae0 Handle FreeBSD/arm64 core files
This is derived from FreeBSD/mips64 and Darwin and Linux arm64 support.

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

llvm-svn: 233273
2015-03-26 14:20:00 +00:00
Ilia K c235b16819 Destroy the attached process in tearDown() to fix ProcessAttachTestCase tests on OS X
This patch fixes the following:
```
1: test_attach_to_process_by_id_with_dsym (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process id ... ok
2: test_attach_to_process_by_id_with_dwarf (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process id ... ok
3: test_attach_to_process_by_name_with_dsym (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process name ... FAILURE
4: test_attach_to_process_by_name_with_dwarf (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process name ... FAILURE

======================================================================
FAIL: test_attach_to_process_by_name_with_dsym (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process name
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 462, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/TestProcessAttach.py", line 35, in test_attach_to_process_by_name_with_dsym
    self.process_attach_by_name()
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/TestProcessAttach.py", line 79, in process_attach_by_name
    self.runCmd("process attach -n s" + exe_name)
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2008, in runCmd
    msg if msg else CMD_MSG(cmd))
AssertionError: False is not True : Command 'process attach -n sProcessAttach' returns successfully
Config=x86_64-clang
======================================================================
FAIL: test_attach_to_process_by_name_with_dwarf (TestProcessAttach.ProcessAttachTestCase)
   Test attach by process name
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 479, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/TestProcessAttach.py", line 41, in test_attach_to_process_by_name_with_dwarf
    self.process_attach_by_name()
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/TestProcessAttach.py", line 79, in process_attach_by_name
    self.runCmd("process attach -n s" + exe_name)
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2008, in runCmd
    msg if msg else CMD_MSG(cmd))
AssertionError: False is not True : Command 'process attach -n sProcessAttach' returns successfully
Config=x86_64-clang
----------------------------------------------------------------------
```

Failure-x86_64-clang-TestProcessAttach.ProcessAttachTestCase.test_attach_to_process_by_name_with_dsym.log:
```
[...]
runCmd: process attach -n ProcessAttach
runCmd failed!
error: attach failed: more than one process named ProcessAttach:
PID    PARENT USER       TRIPLE                   ARGUMENTS
====== ====== ========== ======================== ============================
43752  43680  IliaK      x86_64-apple-macosx      /Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/ProcessAttach
43663  1      IliaK      x86_64-apple-macosx      /Users/IliaK/p/llvm/tools/lldb/test/functionalities/process_attach/ProcessAttach
[...]
```

llvm-svn: 233272
2015-03-26 13:39:25 +00:00
Ilia K b6e094cc70 Fix StopHookForMultipleThreadsTestCase tests after r233098
llvm-svn: 233266
2015-03-26 10:28:15 +00:00
Ilia K c248ec2c29 Use std::vector::iterator in CMICmnLLDBDebuggerHandleEvents::ChkForStateChanges to fix build on Linux after r233260 (MI)
llvm-svn: 233265
2015-03-26 09:43:23 +00:00
Ilia K 23536d92c7 Use std::vector::const_iterator and std::vector::cbegin/cend in CMICmnLLDBDebuggerHandleEvents::ChkForStateChanges (MI)
llvm-svn: 233260
2015-03-26 08:16:18 +00:00
Ilia K c7efd564bb Fix Process::Finalize to do Process::Destroy if needed after r233255
llvm-svn: 233258
2015-03-26 07:40:40 +00:00
Ilia K 490500a7e8 Fix =thread-exited message (MI)
Summary:
This patch includes:
# Fix invalid thread id in =thread-exited message
# Remove invalid threads from cache

All tests pass on OS X.

Test Plan:
now
```
=thread-exited,id="3",group-id="i1"
=thread-exited,id="4",group-id="i1"
=thread-exited,id="5",group-id="i1"
```

was
```
=thread-exited,id="4294967295",group-id="i1"
=thread-exited,id="4294967295",group-id="i1"
...
=thread-exited,id="4294967295",group-id="i1"
=thread-exited,id="4294967295",group-id="i1"
```

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh

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

llvm-svn: 233256
2015-03-26 07:11:31 +00:00
Ilia K fcc89a079f Fix -gdb-exit to detach if was attached or destroy otherwise (MI)
Summary:
This patch fixes -gdb-exit for locally target. It includes the following changes:
# Fix Process::Finalize
# Use SBProcess::Destroy in -gdb-exit

Reviewers: abidh, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 233255
2015-03-26 07:08:47 +00:00
Sean Callanan 7e9793f57a Changed '-x'/'-xsize' to '-s'/'-size' when specifying
the size of a watchpoint.

<rdar://problem/18184972>

llvm-svn: 233237
2015-03-26 00:42:27 +00:00
Greg Clayton 40ca211071 Add a test to make sure if you do:
% lldb /bin/echo
(lldb) r 1 2 3
(lldb) r 

You get "1", "2", and "3" as arguments in the next re-run when no args are specified. This is behavior we do to match what GDB did and we need to test that we don't regress on it.

<rdar://problem/20300941>

llvm-svn: 233236
2015-03-26 00:27:46 +00:00
Greg Clayton 896e0ecd16 Keep launch info up to date when accessors are called directly (not through "settings set").
<rdar://problem/20300941>

llvm-svn: 233233
2015-03-26 00:15:24 +00:00
Siva Chandra 71e080646e [DWARF] Remove an unused arg to SymbolFileDWARF::ParseChildParameters.
Test Plan: Build LLDB

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 233230
2015-03-25 23:23:44 +00:00
Oleksiy Vyalov 6f001068d3 Use Android device serial number instead of hostname as a target identifier within module cache.
http://reviews.llvm.org/D8597

llvm-svn: 233202
2015-03-25 17:58:13 +00:00
Tamas Berghammer c85b493df4 Fix AVX register detection
* Use target triple instead of host platform

llvm-svn: 233194
2015-03-25 15:50:08 +00:00
Tamas Berghammer d542efde8b Remove virtual and add override for lots of function.
Effeted pathes:
* Host/posix/*
* Platform/gdb-server/*
* Process/Linux/*
* Process/POSIX/*

llvm-svn: 233193
2015-03-25 15:37:56 +00:00
Tamas Berghammer 3e0ecb202a Fix not_remote_testsuite_ready annotation in the test runner
Treat a test run as remote run also if lldb.remote_platform is set.

llvm-svn: 233190
2015-03-25 15:13:28 +00:00
Robert Flack a0e70cd4b6 Allow multiple simultaneous connections to platform.
Adds the --server argument to lldb-server platform which when specified will allow multiple simultaneous connections by forking off to handle each individual connection. This will allow us to run the remote tests in parallel.

Test Plan:
Run: lldb-server platform --listen *:1234 --server
Connect from multiple lldb clients simultaneously.
I will also test running the test suite remotely with multiple simultaneous jobs.

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

llvm-svn: 233185
2015-03-25 12:51:31 +00:00
Tamas Berghammer 639e8ad644 Fix StdVBoolImplementation to handle large vectors
The previous implementation only read out the first element of the
underlying storage array. Because of it only the first 32 (on x86) or
the first 64 (on x86_64) element was displayed.

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

llvm-svn: 233179
2015-03-25 10:59:12 +00:00
Tamas Berghammer 86e7018e79 Add support for 'leal' instruction to UnwindAssembly-x86
Gcc for android use the leal instruction to substract from the stack
pointer in the prologue of a function call. This patch add basic support
for evaluating this instruction to support stack unwinding on
android-x86.

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

llvm-svn: 233178
2015-03-25 10:46:45 +00:00
Tamas Berghammer adf8adbd77 Fix wrong type convesrion in ReadRegOperation
The automatic conversion from long int to lldb::addr_t caused sign
extension but for a register read it is an unwanted behaviour. Fix with
forcing different conversion path.

llvm-svn: 233176
2015-03-25 10:14:19 +00:00
Jason Molenda 4f57d6abbe Update xcode project file for addition/removals in r233083 and r233114.
llvm-svn: 233167
2015-03-25 03:26:02 +00:00
Ying Chen 4e0587d26a xfail tests that failed with clang-3.7, gcc4.8.2 and on i386 to get buildbot green
Summary:
-Refer to bug https://buganizer.corp.google.com/issues/19893563
-Test log http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/1145

Test Plan: Run tests with different compiler and archs locally

Reviewers: sivachandra, ovyalov, chaoren, vharron

Subscribers: llvm-commits

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

llvm-svn: 233157
2015-03-25 00:39:25 +00:00
Oleksiy Vyalov 037f6b9c0f Fix ModuleCache usage in Platform - ask remote platform for module's ModuleSpec beforehand so we can look for a module by UUID locally without need to download it.
http://reviews.llvm.org/D8557

llvm-svn: 233136
2015-03-24 23:45:49 +00:00
Chaoren Lin f9e915ae10 ComputeSupportExeDirectory for Linux
Summary:
Fixes http://reviews.llvm.org/D8511

The original method of using dladdr() could return the incorrect relative
path if not dynamically linked against liblldb and the working directory
has changed. This is not a problem when built with python, since
ScriptInterpreterPython::InitializePrivate calls
HostInfo::GetLLDBPath(ePathTypeLLDBShlibDir, ...) and caches the
correct path before any changes to the working directory.

The /proc/self/exe approach fails if run using Python, but works for all other
cases (including for android, which doesn't have dladdr()).

So if we combine the two, we should reasonably cover all corner cases.

Reviewers: vharron, ovyalov, clayborg

Reviewed By: ovyalov, clayborg

Subscribers: lldb-commits

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

llvm-svn: 233129
2015-03-24 23:07:02 +00:00
David Blaikie 377dc25333 Fix some -Winconsistent-missing-override warnings (& some particularly weird indenting)
llvm-svn: 233123
2015-03-24 22:10:47 +00:00
Ilia K d0aa59f77f Add -gdb-show and target-async option in -gdb-show command (MI)
Summary:
This path adds -gdb-show command with 1 option: target-async.

Also it adds tests for -gdb-set and -gdb-show commands.

All tests pass on OS X.

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb -f MiGdbSetShowTestCase

Reviewers: clayborg, abidh

Reviewed By: clayborg, abidh

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 233114
2015-03-24 21:15:42 +00:00
Ilia K 689dda1c67 Add support for CLI commands in lldb-mi
Summary:
This patch adds support for CLI command in lldb-mi. It's useful ability which also was implemented in gdb.

All tests pass on OS X.

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/interpreter/

Reviewers: ted, clayborg, abidh

Reviewed By: clayborg, abidh

Subscribers: jingham, lldb-commits, ted, clayborg, abidh

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

llvm-svn: 233112
2015-03-24 20:59:38 +00:00
Siva Chandra 43386c3b9c [TestDataFormatterStdVector] s/-fstandalone-debug/-fno-limit-debug-info
Test Plan: dotest.py -C <clang|gcc> -p TestDataFormatterStdVector

Reviewers: vharron

Subscribers: lldb-commits

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

llvm-svn: 233108
2015-03-24 20:27:38 +00:00
Zachary Turner b2a2539cc7 Fix build broken by missing `typename` keyword.
llvm-svn: 233106
2015-03-24 20:22:50 +00:00
Zachary Turner a98fac28aa Fix error introduced by changing function signatures.
Since ClangASTSource::layoutRecordType() was overriding a virtual
function in the base, this was inadvertently causing a new method
to be introduced rather than an override.  To fix this all method
signatures are changed back to taking DenseMaps, and the `override`
keyword is added to make sure this type of error doesn't happen
again.

To keep the original fix intact, which is that fields and bases
must be added in offset order, the ImportOffsetMap() function
now copies the DenseMap into a vector and then sorts the vector
on the value type (e.g. the offset) before iterating over the
sorted vector and inserting the items.

llvm-svn: 233099
2015-03-24 18:56:08 +00:00
Siva Chandra 0783ab9a7f [DWARF] If linkages names are missing, use decl context to get qualified names.
Summary:
This commit adds this alternate route only when parsing variable dies
corresponding to global or static variables. The motivation for this is that GCC
does not emit linkage names for functions and variables declared/defined in
anonymous namespaces. Having this alternate route fixes one part of
TestNamespace which fails when the test case is compiled with GCC.

An alternate route to get fully qualified names of functions whose linkage names
are missing will be added with a followup change. With that, the other failing
part of TestNamespace will also be fixed.

Test Plan: dotest.py -C gcc -p TestNamespace

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 233098
2015-03-24 18:32:27 +00:00
Zachary Turner 504f38da4e Fix record layout when synthesizing class types.
Prior to this patch, we would try to synthesize class types by
iterating over a DenseMap of FieldDecls and adding each one to
a CXXRecordDecl.  Since a DenseMap doesn't provide a deterministic
ordering of the elements, this would not add the fields in
FieldOffset order, but rather in some random order determined by
the memory layout of the DenseMap.

This patch fixes the issue by changing DenseMaps to vectors.  The
ability to lookup a value in the DenseMap was hardly being used,
and where it is sufficient to do a vector lookup.

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

llvm-svn: 233090
2015-03-24 16:24:50 +00:00