Commit Graph

142 Commits

Author SHA1 Message Date
Christian Sigg f3ad6eb5d3 Change to individual pretty printer classes, remove generic `make_printer`.
Summary: Follow-up from D72589.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: merge_guards_bot, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73609
2020-03-11 15:04:03 +01:00
Pierre-vh b4b9fa5e11 [debuginfo-tests][dexter] Add --builder gcc support for POSIX
Differential Revision: https://reviews.llvm.org/D75339
2020-03-03 16:42:24 +00:00
Pierre-vh 527bd24c3b [debuginfo-tests][dexter] Add a test tool --calculate-average option
Differential Revision: https://reviews.llvm.org/D75235
2020-02-28 10:00:37 +00:00
Jeremy Morse 0a3b083791 [debuginfo-tests] Warn, not error, if we can't delete working directory
On Windows, an error running the debugger typically leaves a process
hanging around in the working directory. When Dexter exits, it can't then
delete the working directory and produces an exception, masking the problem
in the debugger. (This can be worked around by specifying --save-temps).
Rather than hard-erroring, print a warning when we can't delete the working
directory instead.

It'd be much better to improve our error handling, and make the
WorkingDirectory class aware that something's wrong when it enters exit.
However, this is something that's going to mask genuine errors and make
everyones lives harder right now, so I think this non-ideal fix is
important to get in first.

Differential Revision: https://reviews.llvm.org/D74548
2020-02-25 13:15:07 +00:00
Shoaib Meenai e34ddc09f4 [arcconfig] Delete subproject arcconfigs
From https://secure.phabricator.com/book/phabricator/article/arcanist_new_project/:

> An .arcconfig file is a JSON file which you check into your project's root.

I've done some experimentation, and it looks like the subproject
.arcconfigs just get ignored, as the documentation says. Given that
we're fully on the monorepo now, it's safe to remove them.

Differential Revision: https://reviews.llvm.org/D74996
2020-02-24 16:20:36 -08:00
Jeremy Morse 5ee4a03bc9 [debuginfo-tests][Dexter] Fix some Windows-unfriendly Dexter behaviours
These are some minor things that I've run into on Windows, largely in
error handling paths:

 * Giving --lldb-executable on Windows triggers a "useless option" code
   path, which touches an attribute that only exists in the
   list_debuggers tool. Switch this to use hasattr, which will work in
   all subtools.
 * We were over-decoding some text reporting errors, but only in an
   exception path
 * The path to lldb on Windows needs to be quoted (even though dexter
   isn't making use of it).

Differential Revision: https://reviews.llvm.org/D74546
2020-02-13 14:24:33 +00:00
Jeremy Morse 26f6aa9e3b [debuginfo-tests] Fix Dexter process creation failure on Windows
When writing the Windows dbgeng driver for Dexter, I couldn't work out why it
would either launch a process and leave it free running, or if I started the
process suspended, never do anything with it. The result was a hack to create
and attach processes manually. This has been flaking out on Reids Windows
buildbot, and clearly wasn't a good solution.

Digging into this, it turns out that the "normal" cdb / windbg behaviour of
breaking whenever we attach to a process is not the default: it has to be
explicitly requested from the debug engine. This patch does so (by setting
DEBUG_ENGOPT_INITIAL_BREAK in the engine options), after which we can simply
call "CreateProcessAndAttach2" and everything automagically works.

No test for this behaviour: everything was just broken before.

Differential Revision: https://reviews.llvm.org/D74409
2020-02-13 12:46:32 +00:00
Adrian Prantl 248435e9c9 Replace CHECK-NEXT with CHECK-DAG. The order isn't relevant we just
want to make sure that all are present.
2020-02-07 15:09:44 -08:00
Jason Molenda 4a18a5bdd9 Change first test to be CHECK: to make the test run. 2020-02-07 14:31:35 -08:00
Sourabh Singh Tomar 5752bcf9e5 [DebugInfo]: Fix the debuginfo-tests/llgdb-tests/apple-accel.cpp test
failure after 84e5760.
2020-02-08 01:27:32 +05:30
Christian Sigg 5a21d2bbb9 Rename prettyprinters test to llvm-support.
Summary: Make room for mlir-support pretty printers that I would like to add next.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: merge_guards_bot, mgorny, rriddle, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73726
2020-02-07 14:05:26 +01:00
Christian Sigg a03ec58da6 Add GDB pretty printers for llvm::ilist, llvm::simple_ilist, and llvm::ilist_node.
Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: merge_guards_bot, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72589
2020-01-30 09:35:49 +01:00
Christian Sigg 97431831e5 Add pretty printers for llvm::PointerIntPair and llvm::PointerUnion.
Reviewers: aprantl, dblaikie, jdoerfert, nicolasvasilache

Reviewed By: dblaikie

Subscribers: jpienaar, dexonsmith, merge_guards_bot, llvm-commits

Tags: #llvm, #clang, #lldb, #openmp

Differential Revision: https://reviews.llvm.org/D72557
2020-01-27 17:23:59 +01:00
Christian Sigg 60346bdbd7 Add test for GDB pretty printers.
Reviewers: dblaikie, aprantl, davide, JDevlieghere

Reviewed By: aprantl

Subscribers: jmorse, aprantl, merge_guards_bot, mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72321
2020-01-11 09:17:15 +01:00
Jonas Devlieghere 8a44d4850d [debuginfo] Update test to account for missing __debug_macinfo
We no longer emit this section if it's empty.
2019-11-11 10:40:47 -08:00
Adrian Prantl d0416b91f0 Don't attempt to upgrade debug-info-tests to Python3.
There was CMake code that would attempt to detect Python 3 even if
LLVM was configured with Python 2, but it messed with the environment
for the other LLVM projects. This commit removes this functionality
and just lkeaves a hard error if Python < 3 is detected and
debuginfo-tests are required.
2019-11-08 14:14:12 -08:00
Reid Kleckner 63f49465c3 [dexter] Fix feature tests on Windows
First, add LLD as a dependency on Windows. The windows batch scripts
pass -fuse-ld=lld, so they need it.

Second, decode builder stdout/stderr even if the command fails.
Otherwise it gets printed as b'line 1\n\rline 2\n\r'.

Last, make the batch script one line less noisy. We might want to try to
do more here, though. It would be nice if we could get as close to
possible as lit, where you can literally copy & paste the failing
command to re-run it.

With the two changes above, now the feature tests that use clang++.bat
pass for me. The clang-cl_vs2015 ones still fail, and I'll fix them
separately.

Reviewers: jmorse

Differential Revision: https://reviews.llvm.org/D69725
2019-11-05 10:49:57 -08:00
Reid Kleckner 7035ea6e3e [dexter] Remove lit check for python 3
This is checking the version of Python used to run lit, which is not
necessarily the same as the version used to run the dexter tests.  If
the tests are run via the build/bin/llvm-lit[.py] helper script, then
that is likely to pick up whatever version of Python is on PATH.
Conventionally, this will find Python 2. CMake already checks that
Python 3 is in use and puts the path to it in the lit site config, so
this check is redundant, and Python 3 will ultimately be used to run
dexter.

Reviewers: jmorse

Differential Revision: https://reviews.llvm.org/D69724
2019-11-05 10:49:56 -08:00
Reid Kleckner 309f9a1c52 [debuginfo-tests] Don't look for Python 3 if we already have it
LLDB already requires Python 3 on Windows, so I already configure it
that way. For some reason CMake fails to find the one that Visual Studio
automatically installs at this standard location:
  C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe

CMake prefers the python on path, which happens to be python 2.7.

Reviewers: aprantl, jmorse

Differential Revision: https://reviews.llvm.org/D69684
2019-11-01 11:24:39 -07:00
Jeremy Morse be79db93fb [Dexter] Continue sprinking no-location fixes
Example failure:

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/3255/testReport/junit/debuginfo-tests/dexter-tests/asan_c/

The tests themselves seem to be working, it's just unexplored paths within
dexter that are flaking out.
2019-11-01 13:57:52 +00:00
Jeremy Morse 6e217ba3ea [Dexter] Account for another no-lineno scenario
This is another part of Dexter that had never seen a missing source
location before, now newly turning up on Darwin.
2019-11-01 13:41:56 +00:00
Jeremy Morse e34179aad1 [Dexter] Cope better with empty source locations
When running a program, Dexter single steps if it's in one of the source
files under test, or free-runs if it isn't. Handle the circumstance where
the current source file simply isn't known.
2019-11-01 13:30:26 +00:00
Jeremy Morse 2665f3e436 Unmask dexter debuginfo tests on Darwin
These tests almost certainly work on Darwin anyway, I just wanted to
keep things in a fixed, working configuration, while pushing Dexter
up.

I've left Windows unsupported as the dexter command line will need further
adjustment to run dbgeng. This can be abstracted through the %dexter
substitution, but is a task for another time.
2019-11-01 13:12:47 +00:00
Jeremy Morse 7f738c811a Fix a brain-fail with debuginfo-tests/dexter internal tests
I baked the "test" subcommand into the %dexter substituion, as that's
what all of the dexter tests use. However I forgot about the internal
tests for whether dexters features are working. Install a %dexter_base
command to allow those tests to call dexter.py directly, and un-xfail
the tests on darwin.

Update too the list of paths the unittests shouldn't try and cover, as it
tries to load dbgeng on unix machines. Ideally we wouldn't be using this
method of test discovery in the future.
2019-11-01 12:35:38 +00:00
Reid Kleckner f9061049c1 Quote path to Python 3 executable in case it contains spaces 2019-10-31 15:23:45 -07:00
Reid Kleckner 7ac4c31762 Fix undefined variable bug in debuginfotests lit.cfg.py 2019-10-31 15:19:02 -07:00
Adrian Prantl 8e40620441 XFAIL dexter tests on Darwin.
These fail parsing command line arguments.
2019-10-31 11:22:19 -07:00
Jeremy Morse 984fad243d Reapply "Import Dexter to debuginfo-tests""
This reverts commit cb935f3456.

Discussion in D68708 advises that green dragon is being briskly
refurbished, and it's good to have this patch up testing it.
2019-10-31 16:51:53 +00:00
Jeremy Morse cb935f3456 Revert "Import Dexter to debuginfo-tests"
This reverts commit f78c236efd.

Green dragon breakage was observed; I'll take a look at why.
2019-10-31 16:22:10 +00:00
Jeremy Morse f78c236efd Import Dexter to debuginfo-tests
Dexter (Debug Experience Tester) is a test-driver for our debug info
integration tests, reading a set of debug experience expectations and
comparing them with the actual behaviour of a program under a debugger.
More about Dexter can be found in the RFC:

  http://lists.llvm.org/pipermail/llvm-dev/2019-October/135773.html

and the phab review in D68708. Not all the debuginfo tests have been
transformed into Dexter tests, and we look forwards to doing that
incrementally.

This commit mostly aims to flush out buildbots that are running
debuginfo-tests but don't have python 3 installed, possibly
green-dragon and some windows bots.
2019-10-31 13:49:47 +00:00
Adrian Prantl 559c6e17cd Make nrvo-string test more robust.
This is a follow-up to r364466, but better implemented. Original
commit message still applies:

    The breakpoint locations were in places where clang doesn't actually
    emit a source location for and depend on the debugger's ability to
    move the breakpoint forward onto a line that is already in the
    function epilogue. In my testing older versions of LLDB fail to do
    that, so I'm modifying the test to force a break-able location by
    calling a noinline function.

    <rdar://problem/52079841>

llvm-svn: 364589
2019-06-27 20:38:37 +00:00
Adrian Prantl 8ac899c600 Make nrvo-string test more robust.
The breakpoint locations were in places where clang doesn't actually
emit a source location for and depend on the debugger's ability to
move the breakpoint forward onto a line that is already in the
function epilogue. In my testing older versions of LLDB fail to do
that, so I'm modifying the test to force a break-able location by
calling a noinline function.

<rdar://problem/52079841>

llvm-svn: 364466
2019-06-26 20:04:09 +00:00
Jonas Devlieghere 635eb80662 [Python 3] Decode check_ouput result as UTF-8
llvm-svn: 364325
2019-06-25 15:58:32 +00:00
Amy Huang 7fac5c8d94 Store a pointer to the return value in a static alloca and let the debugger use that
as the variable address for NRVO variables.

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D63361

llvm-svn: 363952
2019-06-20 17:15:21 +00:00
Adrian Prantl 2d26cf37d7 llgdb.py: Make sure to clean up the debugger on exit.
<rdar://problem/51807962>

llvm-svn: 363611
2019-06-17 20:06:34 +00:00
Amy Huang 980d3645df Add cdb test for global constants
Summary: This creates an integration test for global constants

Reviewers: rnk

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62974

llvm-svn: 362745
2019-06-06 20:23:05 +00:00
Reid Kleckner 479568e645 Add cdb test for inline line tables
This creates an integration test for inlined call line tables, and in
particular, ones that are discontiguous. We've had issues in the past
with discontiguous inline line tables, and until r362429 LLD didn't
write the inlinees section into the PDB.

The test was reduced from https://crbug.com/965670

Reviewers: thakis

Differential Revision: https://reviews.llvm.org/D62758

llvm-svn: 362431
2019-06-03 18:24:55 +00:00
Reid Kleckner b9b64468ca Move the pybool logic from CMake to Python for simplicity
This is how similar booleans are handled, and seems to work for me
locally.

llvm-svn: 362039
2019-05-29 21:45:43 +00:00
Reid Kleckner 75d38f1e48 Add debuginfo-tests that use cdb on Windows
This is an initial prototype of how we can run debugger integration
tests on Windows. cdb and windbg share a command language and debugger
engine. Visual Studio has its own, but we should at least be able to use
cdb as the basis for optimized debug info integration tests.

There's a lot of work to do here still. For example:
- Make fewer assumptions about the SDK location
- Don't assume x64 (important, I need x86 testing)
- More environment isolation, have lit setup vcvars instead of passing
  LIB and INCLUDE down.
- Write a .py file to replace the grep+sed RUN line

But, this seemed like a good enough concept to commit as is, since it's
useful to me already.

Reviewers: aprantl, zturner

Differential Revision: https://reviews.llvm.org/D54187

llvm-svn: 361889
2019-05-28 23:03:33 +00:00
Reid Kleckner c3ad28d5e8 Set config.lit_tools_dir, which is needed by lit.llvm.initialize.
llvm-svn: 346271
2018-11-06 21:54:27 +00:00
Fangrui Song 93deae23d1 [debuginfo-tests] commands.getoutput -> subprocess.check_output
We should also make Darwin Python3 happy after r346059
The output has an extra newline but it is fine in this particular case.

llvm-svn: 346066
2018-11-03 04:52:32 +00:00
Reid Kleckner 75c16d8180 Update debuginfo tests lit for r341135
llvm-svn: 346060
2018-11-03 00:22:03 +00:00
Reid Kleckner 64189b8f57 [debuginfo-tests] Avoid "import commands" which was deprecated in Py3
llvm-svn: 346059
2018-11-03 00:16:23 +00:00
Vedant Kumar d08d9bf528 Revert "(Retry) Add a basic integration test for C++ smart pointers"
This reverts r340189. The new test is still failing on some
Apple-internal bots.

llvm-svn: 340204
2018-08-20 19:53:33 +00:00
Vedant Kumar 651c2cdb4c (Retry) Add a basic integration test for C++ smart pointers
Check that the debugger can pretty-print unique_ptr and shared_ptr when
passed as a function argument.

This was reverted in r339961 because of a bug in the version of lldb
installed on the public Green Dragon builders.

rdar://42314305

llvm-svn: 340189
2018-08-20 17:17:38 +00:00
Bruno Cardoso Lopes 526a31a5a4 Revert "Add a basic integration test for C++ smart pointers"
This reverts commit 73786631984289b3d601034b2bf4ba2b8f5845eb.

Revert r339961 since its causing debuginfo-tests to fail:
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/48514/

rdar://problem/43449629

llvm-svn: 340119
2018-08-18 04:16:50 +00:00
Vedant Kumar 103018e9d9 Add a basic integration test for C++ smart pointers
Check that the debugger can pretty-print unique_ptr and shared_ptr when
passed as a function argument.

rdar://42314305

llvm-svn: 339961
2018-08-16 23:05:15 +00:00
Vlad Tsyrklevich cd4056c881 SafeStack: Disable Darwin support
SafeStack support for Darwin has not been functional and was disabled in
r339719/r339720. Disable Darwin for the safestack debuginfo test.

llvm-svn: 339732
2018-08-14 21:38:50 +00:00
Vedant Kumar efab30c73e Disable the asan-deque.cpp integration test for AppleLLDB < v1000
Some of Apple's public CI nodes ship an lldb which has trouble debugging
the asan-deque.cpp test. Specifically, that lldb appears to either parse
location lists in the test program incorrectly or to have a broken
std::deque data formatter.

We don't want to work around this by weakening the integration test, and
we're unable to update the lldb version on the CI node at the moment.

The compromise is to require AppleLLDB >= 1000 when AppleLLDB is being
used to debug this test.

Reviewed (in person) by Adrian Prantl.

Bot failure:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA/48074

rdar://42892721

llvm-svn: 338937
2018-08-04 00:02:48 +00:00
Wolfgang Pieb 959fe03933 [DWARF] Change a test to ensure the creation of a __debug_ranges section.
Reviewer: aprantl
llvm-svn: 338424
2018-07-31 19:37:29 +00:00