Commit Graph

145 Commits

Author SHA1 Message Date
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
Oleksiy Vyalov e4ff8ec649 Make TestPlatformProcessConnect to support abstract/domain sockets.
llvm-svn: 261974
2016-02-26 04:01:58 +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
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
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
Zachary Turner 362e06d7ba Remove expectedFailureLinux decorator.
llvm-svn: 260422
2016-02-10 19:53:36 +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 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 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
Pavel Labath 5990cd5a0c Bump up the packet timeout for gdbremote tests
Log confirmed that the we are sometimes timing out on the receive, even though the server is
sending the correct packets.

llvm-svn: 259878
2016-02-05 11:17:22 +00:00
Zachary Turner 9a1a2946af Move the rest of the tests over to using the new decorator module.
llvm-svn: 259838
2016-02-04 23:04:17 +00:00
Zachary Turner 7a5382de82 Move some of the common decorators to decorators.py.
This doesn't attempt to move every decorator.  The reason for
this is that it requires touching every single test file to import
decorators.py.  I would like to do this in a followup patch, but
in the interest of keeping the patches as bite-sized as possible,
I've only attempted to move the underlying common decorators first.
A few tests call these directly, so those tests are updated as part
of this patch.

llvm-svn: 259807
2016-02-04 18:03:01 +00:00
Pavel Labath 1dafd45e6f Enable test_lldbmi_settings_set_target_run_args_before on linux
Test has passed last 200 runs of the build bot.

llvm-svn: 259777
2016-02-04 11:51:07 +00:00
Pavel Labath fcf08db0f9 Add verbose logging support to gdb-remote tests
Summary:
gdb-remote tests are not able to use the same logging mechanisms as the rest of our tests, and
currently we get no host logs from them, even though the tests themselves have logging
capability. This commit changes that. When user specifies that he would like to log the
gdb-remote channel (--channel gdb-remote argument to dotest.py), we write detailed logs to the
<TEST_ID>-host.log file, just like we would in the case of regular tests. If this argument is not
specified, we only log the serious messages to stderr, which matches the existing behaviour.

Reviewers: tfiala, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 259774
2016-02-04 09:53:33 +00:00
Zachary Turner e5a7990dbe Always write the session file in UTF-8.
This patch attempts to solve the Python 2 / Python 3 incompatibilities by
introducing a new `encoded_file` abstraction that we use instead of
`io.open()`.  The problem with the builtin implementation of `io.open` is
that `read` and `write` accept and return `unicode` objects, which are not
always convenient to work with in Python 2.  We solve this by making
`encoded_file.open()` return the same object returned by `io.open()` but
with hooked `read()` and `write()` methods.  These hooked methods will
accept binary or text data, and conditionally convert what it gets to a
`unicode` object using the correct encoding.  When calling `read()` it
also does any conversion necessary to convert the output back into the
native `string` type of the running python version.

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

llvm-svn: 259379
2016-02-01 18:12:59 +00:00
Eugene Leviant ec4d04e507 Fix crash in lldb-mi when stack variable name is nullptr. This always happens when execution stops in try scope with unnamed catch clause
llvm-svn: 259189
2016-01-29 12:17:09 +00:00
Omair Javaid 94b94421a4 Mark arm/aarch64 specific xfails with expectedFailureLinux decorator
This patch marks some known failures and puts on expectedFailureLinux decorator to have testsuite xfail them.

Affected tests are: 

test/functionalities/watchpoint/step_over_watchpoint.py
test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
test/tools/lldb-server/TestGdbRemoteSingleStep.py
test/tools/lldb-server/TestGdbRemote_vCont.py

llvm-svn: 258315
2016-01-20 15:01:54 +00:00
Pavel Labath d0f89cd721 Centralize the handling of attach permissions on linux in tests
Summary:
On linux we need the process to give us special permissions before we can attach to it.
Previously, the code for this was copied into every file that needed it. This moves the code to a
central place to reduce code duplication.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 257319
2016-01-11 10:24:50 +00:00
Pavel Labath 876ae59cf6 XFAIL TestMiSymbol on linux
new test introduced in r256863 fails on linux.

llvm-svn: 256925
2016-01-06 09:48:54 +00:00
Dawn Perchik 07ac14fa48 Apply missed changes from svn r256863 "Add support for "source info" and use it to fix MI's -symbol-list-lines.".
Patch is part of Differential Revision: http://reviews.llvm.org/D15593
Differential Revision: http://reviews.llvm.org/D15904

llvm-svn: 256877
2016-01-06 00:03:43 +00:00
Dawn Perchik 954b40bf63 Add support for "source info" and use it to fix MI's -symbol-list-lines.
This patch adds support the command 'source info' as follows:
    (lldb) help source info
         Display source line information (as specified) based on the current executable's
         debug info.
    
    Syntax: source info <cmd-options>
    
    Command Options Usage:
      source info [-c <count>] [-s <shlib-name>] [-f <filename>] [-l <linenum>] [-e <linenum>]
      source info [-c <count>] [-s <shlib-name>] [-n <symbol>]
      source info [-c <count>] [-a <address-expression>]
    
           -a <address-expression> ( --address <address-expression> )
                Lookup the address and display the source information for the corresponding
                file and line.
    
           -c <count> ( --count <count> )
                The number of line entries to display.
    
           -e <linenum> ( --end-line <linenum> )
                The line number at which to stop displaying lines.
    
           -f <filename> ( --file <filename> )
                The file from which to display source.
    
           -l <linenum> ( --line <linenum> )
                The line number at which to start the displaying lines.
    
           -n <symbol> ( --name <symbol> )
                The name of a function whose source to display.
    
           -s <shlib-name> ( --shlib <shlib-name> )
                Look up the source in the given module or shared library (can be specified
                more than once).
For example:
    (lldb) source info --file x.h
    Lines for file x.h in compilation unit x.cpp in `x
    [0x0000000100000d00-0x0000000100000d10): /Users/dawn/tmp/./x.h:10
    [0x0000000100000d10-0x0000000100000d1b): /Users/dawn/tmp/./x.h:10

The new options are used to fix the MI command:
    -symbol-list-lines <file>
which didn't work for header files because it called:
    target modules dump line-table <file>
which only dumps line tables for a compilation unit.

The patch also fixes a bug in the error reporting when no files were supplied to the command. Previously you'd get:
    (lldb) target modules dump line-table
    error:
    Syntax:
    error: no source filenames matched any command arguments
Now you get:
    error: file option must be specified.

Reviewed by: clayborg, jingham, ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D15593

llvm-svn: 256863
2016-01-05 19:51:51 +00:00
Pavel Labath 6f38342af1 Mark a test_lldbmi_gdb_set_target_async_on as flaky on linux
Test fails in about 1% of buildbot runs. Marking as flaky to avoid the noise.

llvm-svn: 256835
2016-01-05 14:21:15 +00:00
Tamas Berghammer 0e59c516c4 XFAIL some tests failing for Windows -> Android
llvm-svn: 255885
2015-12-17 10:58:35 +00:00
Tamas Berghammer 31fef1e273 Fix a cleanup error in TestPlatformProcessConnect.py
llvm-svn: 255104
2015-12-09 10:16:05 +00:00
Tamas Berghammer ccd6cffba3 Modify "platform connect" to connect to processes as well
The standard remote debugging workflow with gdb is to start the
application on the remote host under gdbserver (e.g.: gdbserver :5039
a.out) and then connect to it with gdb.

The same workflow is supported by debugserver/lldb-gdbserver with a very
similar syntax but to access all features of lldb we need to be
connected also to an lldb-platform instance running on the target.

Before this change this had to be done manually with starting a separate
lldb-platform on the target machine and then connecting to it with lldb
before connecting to the process.

This change modifies the behavior of "platform connect" with
automatically connecting to the process instance if it was started by
the remote platform. With this command replacing gdbserver in a gdb
based worflow is usually as simple as replacing the command to execute
gdbserver with executing lldb-platform.

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

llvm-svn: 255016
2015-12-08 14:08:19 +00:00
Zachary Turner 606e3a5221 Get rid of global variables in dotest.py
This moves all the global variables into a separate module called
`configuration`.  This has a number of advantages:

1. Configuration data is centrally maintained so it's easy to get
   a high level overview of what configuration data the test suite
   makes use of.
2. The method of sharing configuration data among different parts
   of the test suite becomes standardized.  Previously we would
   put some things into the `lldb` module, some things into the
   `lldbtest_config` module, and some things would not get shared.
   Now everything is shared through one module and is available to
   the entire test suite.
3. It opens the door to moving some of the initialization code into
   the `configuration` module, simplifying the implementation of
   `dotest.py`.

There are a few stragglers that didn't get converted over to using
the `configuration` module in this patch, because it would have grown
the size of the patch unnecessarily.  This includes everything
currently in the `lldbtest_config` module, as well as the
`lldb.remote_platform` variable.  We can address these in the future.

llvm-svn: 254982
2015-12-08 01:15:30 +00:00
Chuck Ries 1ffd4f5093 Allow variable names to be quoted with -var-list-children
Allow both '-var-list-children var0' and '-var-list-children "var0"' to be used with the -var-list-children command. GDB MI allows for this and it is necessary if the variable name contains spaces, such as var5.std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<cahr> > > >.

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

llvm-svn: 254941
2015-12-07 20:43:52 +00:00
Mohit K. Bhakkad 1e577e66e9 [LLDB][MIPS] Fix gdbremote_testcase.py
Patch by Nitesh Jain

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

llvm-svn: 254711
2015-12-04 09:58:07 +00:00
Pavel Labath 02559bbfd7 Enable TestMiBreak on Linux
test reliably passed last 100 buildbot runs. Enable it and see what happens.

llvm-svn: 254072
2015-11-25 16:29:04 +00:00
Ying Chen ca922bb9b9 Support unix-abstract-connect scheme as platform url in lldb testsuite
Reviewers: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 253488
2015-11-18 19:03:20 +00:00
Abhishek Aggarwal be994649b4 Fix to solve Bug 23139 & Bug 23560
Summary:
 - Reason of both bugs:

   1. For the very first frame, Unwinder doesn't check the validity
      of Full UnwindPlan before creating StackFrame from it:

        When 'process launch' command is run after setting a breakpoint
        in inferior, the Unwinder runs and saves only Frame 0 (the frame
        in which breakpoint was set) in thread's StackFrameList i.e.
        m_curr_frames_sp. However, it doesn't check the validity of the
        Full UnwindPlan for this frame by unwinding 2 more frames further.

   2. Unwinder doesn't update the CFA value of Cursor when Full UnwindPlan
      fails and FallBack UnwindPlan succeeds in providing valid CFA values
      for frames:

        Sometimes during unwinding of stack frames, the Full UnwindPlan
        inside the RegisterContextLLDB object may fail to provide valid
        CFA values for these frames. Then the Fallback UnwindPlan is used
        to unwind the frames.

        If the Fallback UnwindPlan succeeds, then it provides a valid new
        CFA value. The RegisterContextLLDB::m_cfa field of Cursor object
        is updated during the Fallback UnwindPlan execution. However,
        UnwindLLDB misses the implementation to update the 'cfa' field
        of this Cursor with this valid new CFA value.

 - This patch fixes both these issues.

 - Remove XFAIL in test files corresponding to these 2 Bugs

Change-Id: I932ea407545ceee2d628f946ecc61a4806d4cc86
Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>

Reviewers: jingham, lldb-commits, jasonmolenda

Subscribers: lldb-commits, ovyalov, tberghammer

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

llvm-svn: 253026
2015-11-13 10:47:49 +00:00
Todd Fiala fa93eb8f4f Marked test_qRegisterInfo_returns_{one_valid_result,all_valid_results} XFAIL on Darwin.
Tracked by:
https://llvm.org/bugs/show_bug.cgi?id=25486

llvm-svn: 252707
2015-11-11 06:32:44 +00:00
Pavel Labath bf5210f8ed Mark TestMiInterpreterExec.test_lldbmi_thread_continue as flaky on linux
llvm-svn: 252596
2015-11-10 10:33:12 +00:00
Zachary Turner e73a0601bd Python 3 - Port use of string.maketrans and don't use sets.Set.
`sets.Set` has been deprecated in favor of `set` since 2.6, and
`string.maketrans` has to be special cased.  In Python 3 there
is `str.maketrans`, `bytes.maketrans`, and `bytearray.maketrans`
and you have to choose the correct one.  So we need to introduce
a runtime version check at this site.

llvm-svn: 252348
2015-11-06 21:37:33 +00:00
Zachary Turner 19474e1801 Remove `use_lldb_suite` from the package, and don't import it anymore.
This module was originally intended to be imported by top-level
scripts to be able to find the LLDB packages and third party
libraries.  Packages themselves shouldn't need to import it,
because by the time it gets into the package, the top-level
script should have already done this.  Indeed, it was just
adding the same values to sys.path multiple times, so this
patch is essentially no functional change.

To make sure it doesn't get re-introduced, we also delete the
`use_lldb_suite` module from `lldbsuite/test`, although the
original copy still remains in `lldb/test`

llvm-svn: 251963
2015-11-03 19:20:39 +00:00
Zachary Turner 95c453a221 Tighten up sys.path, and use absolute imports everywhere.
For convenience, we had added the folder that dotest.py was in
to sys.path, so that we could easily write things like
`import lldbutil` from anywhere and any test.  This introduces
a subtle problem when using Python's package system, because when
unittest2 imports a particular test suite, the test suite is detached
from the package.  Thus, writing "import lldbutil" from dotest imports
it as part of the package, and writing the same line from a test
does a fresh import since the importing module was not part of
the same package.

The real way to fix this is to use absolute imports everywhere.  Instead
of writing "import lldbutil", we need to write "import
lldbsuite.test.util".  This patch fixes up that and all other similar
cases, and additionally removes the script directory from sys.path
to ensure that this can't happen again.

llvm-svn: 251886
2015-11-03 02:06:18 +00:00
Hafiz Abid Qadeer c10e82087b Handle the options and parameters separator in every MI command
Summary:
As per the following link, the "--" separator can appear between the options
and parameters of any MI command. Previously this separator was only
handled by the `-data-disassemble` MI command. I have moved the relevant
code into `CMICmdBase` so that any MI command can handle the
aforementioned separator.

https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax

Reviewers: ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 251793
2015-11-02 11:43:40 +00:00
Hafiz Abid Qadeer d122fd8d06 Better handle the arguments common to all MI commands.
Summary:
I observed that eclipse was passing --thread-group for many other commands
then we are currently handling. Looking at the MI documentation, the
following link states that each MI command accept the --thread and
--frame option. Looking at the GDB implementation, it seems that apart
from these 2, --thread-group is also handled the same way.

https://sourceware.org/gdb/onlinedocs/gdb/Context-management.html#Context-management

So instead of handling those arguments in every comamnds, I have moved
them into the base class and removed them from elsewhere. Now any command
can use these arguments. The patch seems big but most of the changes are
mechanical.

Reviewers: ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 251636
2015-10-29 16:30:47 +00:00
Zachary Turner c432c8f856 Move lldb/test to lldb/packages/Python/lldbsuite/test.
This is the conclusion of an effort to get LLDB's Python code
structured into a bona-fide Python package.  This has a number
of benefits, but most notably the ability to more easily share
Python code between different but related pieces of LLDB's Python
infrastructure (for example, `scripts` can now share code with
`test`).

llvm-svn: 251532
2015-10-28 17:43:26 +00:00