Commit Graph

169 Commits

Author SHA1 Message Date
Christian Sigg e9b3884161 Add GDB prettyprinters for a few more MLIR types.
Reviewed By: dblaikie, jpienaar

Differential Revision: https://reviews.llvm.org/D87159
2020-09-30 21:22:47 +02:00
OCHyams 485e6db872 Revert "Adding GDB PrettyPrinter for mlir::Identifier."
This reverts commit 9e9e6e698d.

This commit is causing builds that include the 'debuginfo-tests' project to
fail.

Apple has a public bot which shows the failure:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/23667/console
2020-09-03 08:28:15 +01:00
Christian Sigg 9e9e6e698d Adding GDB PrettyPrinter for mlir::Identifier.
This is the first bit from D73546. Primarily setting up the corresponding test. Will add more pretty printers in a separate revision.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D86937
2020-09-03 08:18:09 +02:00
serge-sans-paille 515bc8c155 Harmonize Python shebang
Differential Revision: https://reviews.llvm.org/D83857
2020-07-16 21:53:45 +02:00
Fangrui Song ac567eec11 [CMake] Add check-debuginfo-* targets
* check-debuginfo-dexter runs lit tests under debuginfo-tests/dexter/
* check-debuginfo-llgdb-tests runs lit tests under debuginfo-tests/llgdb-tests/
* ...

Reviewed By: tbosch

Differential Revision: https://reviews.llvm.org/D82605
2020-06-26 11:18:18 -07:00
Fangrui Song 161ae1f398 [CMake] Add optional lldb dependency to DEBUGINFO_TEST_DEPS
if(TARGET asan) is still brittle as it depends on the order of
compiler-rt and debuginfo-tests in LLVM_ENABLE_PROJECTS.
2020-06-25 18:28:43 -07:00
Fangrui Song e477a5f6c8 [CMake] Add optional asan & safestack dependencies to DEBUGINFO_TEST_DEPS 2020-06-25 17:56:35 -07:00
Fangrui Song 40dd5cb110 [debuginfo-tests] Require "lldb" for some dexter tests 2020-06-25 17:35:01 -07:00
Fangrui Song ca8b7ef763 [CMake] Add llvm-config to DEBUGINFO_TEST_DEPS
Fix `fatal: Could not run process ['/path/to/build/./bin/llvm-config', '--build-mode']`
when running check-debuginfo in a fresh build directory.
2020-06-25 16:49:33 -07:00
Tobias Bosch 53d6bfef32 [Dexter] Add --source-dir-root flag
Summary:
This allows to run dexter tests with separately compiled
binaries that are specified via --binary if the source file
location changed between compilation and dexter test run.

Reviewers: TWeaver, jmorse, probinson, #debug-info

Reviewed By: jmorse

Subscribers: #debug-info, cmtice, llvm-commits

Tags: #llvm, #debug-info

Differential Revision: https://reviews.llvm.org/D81319
2020-06-18 09:29:08 -07:00
Mehdi Amini d31c9e5a46 Change filecheck default to dump input on failure
Having the input dumped on failure seems like a better
default: I debugged FileCheck tests for a while without knowing
about this option, which really helps to understand failures.

Remove `-dump-input-on-failure` and the environment variable
FILECHECK_DUMP_INPUT_ON_FAILURE which are now obsolete.

Differential Revision: https://reviews.llvm.org/D81422
2020-06-09 18:57:46 +00:00
Tom Weaver c6aa829644 [Dexter] Add DexLimitSteps command and ConditionalController
* Adds DexLimitSteps Command.
* Add ConditionalController, a new DebuggerController type.
* 5 regression tests
* documentation

* recommit, fixed accidental adding of unnecessary file

Reviewers: jmorse

Differential Revision: https://reviews.llvm.org/D79786
2020-06-05 12:53:56 +01:00
Tom Weaver 05eabb5204 Revert "[Dexter] Add DexLimitSteps command and ConditionalController"
This reverts commit 81e836a5a6.

Accidentally committed a diff file.
2020-06-03 12:28:26 +01:00
Tom Weaver 81e836a5a6 [Dexter] Add DexLimitSteps command and ConditionalController
* Adds DexLimitSteps Command.
  * Add ConditionalController, a new DebuggerController type.
  * 5 regression tests
  * documentation

  Reviewers: jmorse

  Differential Revision: https://reviews.llvm.org/D79786
2020-06-02 16:19:43 +01:00
Tom Weaver bf1cdc2c6c [Dexter] Add os.path.normcase(...) transform to test path early.
When passing a test path, if the path points directly at a file, then
  normcase would not be called on path.

  This would change the expected lower case drive path, on windows, to be
  uppercase. This patch simply calls normcase on the test path at the earliest
  point possible to avoid this issue.

  Reviewers: djtodoro, jmorse

  Differential Revision: https://reviews.llvm.org/D78633
2020-06-02 16:09:17 +01:00
Christian Sigg 104e38cf76 Only run pretty-printer tests for builds with debug-info.
Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: tbosch, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79897
2020-05-14 09:19:43 +02:00
Christopher Tetreault f829ba60da Ensure that CMake tries to find Python3 before processing
Summary:
It is possible that CMake tries to process debuginfo-tests before any
attempt to find Python3. Ensure that CMake attempts to find it before
complaining that it doesn't exist.

Reviewers: zturner, rnk, jmorse, chandlerc

Reviewed By: rnk

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79795
2020-05-13 13:56:48 -07:00
Jonas Devlieghere 7f84b6c1ba [debuginfo-tests] Update Python variable in lit.site.cfg.py 2020-04-30 10:51:45 -07:00
Jonas Devlieghere ba8163e629 [debuginfo-tests] Update Python CMake variable 2020-04-29 09:51:32 -07:00
Djordje Todorovic 871388e384 [dexter] Require python >= 3.6
The documentation says we need python >= 3.6. Running it with an older
version, we get verbose output from python interpreter.
This patch fixes that as:

  $ python2 dexter.py list-debuggers
  You need python 3.6 or later to run DExTer

Differential Revision: https://reviews.llvm.org/D78621
2020-04-23 11:46:10 +02:00
Tom Weaver b1097e29d3 [Dexter] Fix failing clang-opt-bisect sub tool test
Fixes a mismatch in expected arguments passed to run_debugger_subprocess

  Fix for:
    https://reviews.llvm.org/D76926
    rG9cf9710bb0d61cb5c27c6e780af6a182cb162bfb
2020-04-21 13:40:02 +01:00
Tom Weaver 9cf9710bb0 [Dexter][NFC] Add Debugger Controller To Dexter
Add DebuggerControllerBase and DefaultController to Dexter
  implements a new architecture that supports new and novel ways of running
  a debugger under dexter.
  Current implementation adds the original default behaviour via the new
  architecture via the DefaultController, this should have NFC.

Reviewers: Orlando

Differential Revision: https://reviews.llvm.org/D76926
2020-04-20 15:46:55 +01:00
Tom Weaver b6d2212f52 [Dexter] Add support for Windows to regression test suite.
This patch addresses the issue of the regression suite not running on windows
hardware. It changes the following things:

* add new dexter regression suite command to lit.cfg.py that makes use of the
  clang-cl_vs2015 and dbgend builder and debuggers.

* sprinkle the new regressionsuite command through the feature and tool tests
  that require them.

* mark certain problem tests on windows

* [revert fix] fixed darwin regression test failures by adding unsupported line
  for system-darwin to command tests.

There's a couple of tests that fail (or pass) in unexpected ways on Windows.

Problem tests are both the penalty and perfect expect_watch_type.cpp tests.
Type information reporting parity is not possible a this time in dexter due to
the nature of how different debuggers report type information back to their users.

reviewers: Orlando

Differential Revision: https://reviews.llvm.org/D76609
2020-03-31 10:18:12 +01:00
Davide Italiano 470e82cd06 Revert "[Dexter] Add support for Windows to regression test suite."
This reverts commit 89025da9f6 as
it breaks the lldb macOS bot.
2020-03-27 13:12:24 -07:00
Tom Weaver 89025da9f6 [Dexter] Add support for Windows to regression test suite.
This patch addresses the issue of the regression suite not running on windows hardware. It changes the following things:

add new dexter regression suite command to lit.cfg.py that makes use of the clang-cl_vs2015 and dbgend builder and debuggers.
sprinkle the new regression suite command through the feature and tool tests that require them.
mark certain problem tests on windows

There's a couple of tests that fail (or pass) in unexpected ways on Windows.

Problem tests are both the penalty and perfect expect_watch_type.cpp tests. Type information reporting parity is not possible a this time in dexter due to the nature of how different debuggers report type information back to their users.

reviewers: Orlando

Differential Revision: https://reviews.llvm.org/D76609
2020-03-27 18:15:17 +00:00
Tom Weaver 09f4bdc03f [DexTer] Add step.UNKNOWN check for NoneType line numbers.
Summary: It's possible for an instance of the visual studio debugger
to return a NoneType line number location when stepping during a
debugging session.

This patches teaches DexTer how to handle this particular case without
crashing out.

Reviewers: Orlando

Differential revision: https://reviews.llvm.org/D75992
2020-03-16 16:38:41 +00:00
Jonas Devlieghere 54146cbd32 [debuginfo-tests] Update test for double-dash long-option. 2020-03-15 20:56:33 -07:00
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