Tweak dexter-tests/memvars/inline-escaping-function.c added in D94761
(b7e516202e) by adding a 'param' use after the merge point. The test XFAILS
with and without this change, but without it the test looks very similar to
memvars/unused-merged-value.c. The test now demonstrates the problem more
clearly.
These dexter tests illustrate PR48719, the summary of which is:
Sometimes we insert dbg.values for merged values (PHIs) when promoting
variables, sometimes we don't. Sometimes there is no PHI because the merged
value is never used. It doesn't matter because LiveDebugValues understands these
merged values (implicit or otherwise) and correctly updates the debug
info. Importantly, these merged variable values (which may or may not exist as
PHIs, and may or not be represented with dbg.values) are //always// implicitly
defined by the combination of incoming edges and the incoming variable locations
along those edges by virtue of LiveDebugValues existing. Unfortunately, it is
possible to mess with the CFG and remove / move these edges before
LiveDebugValues runs. In this case our debug info model only works when the
merged value is tracked by a dbg.value. Currently, this is only done rigorously
for variables which are A) promoted in the first round of mem2reg and B) are
used after the merge point.
As an example, compile the following source with -O3 -g and step through with a
debugger. You will see parama=5 throughout the function fun which is incorrect -
we expect to see param=20 after the conditional assignment.
__attribute__((optnone))
void esc(int* p) {}
__attribute__((optnone))
void fluff() {}
__attribute__((noinline))
int fun(int parama, int paramb) {
if (parama)
parama = paramb;
fluff(); // DexLabel('s0')
esc(¶ma);
return 0;
}
int main() {
return fun(5, 20);
}
1. parama is escaped by esc(¶ma) so it is not promoted by
SROA/mem2reg (failing condition "A" above).
2. InstCombine's LowerDbgDeclare converts the dbg.declare to a set of
dbg.values (tracking the stored SSA values).
3. InstCombine replaces the two stores to parama's alloca (the initial
parameter register store in entry and the assignment in if.then) with a
PHI+store in the common sucessor.
4. SimplifyCFG folds the blocks together and converts the PHI to a
select.
The debug info is not updated to account for the merged value in the successor
prior to SimplifyCFG when it exists as a PHI, or during when it becomes a
select.
As with D89543, which added some dexter tests for escaped locals, the idea is
to build a set of source-level tests which highlights existing issues and
might be useful in evaluating a new debug info model.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D94761
This is part of a larger refactoring the better congregates the builtin structures under the BuiltinDialect. This also removes the problematic "standard" naming that clashes with the "standard" dialect, which is not defined within IR/. A temporary forward is placed in StandardTypes.h to allow time for downstream users to replaced references.
Differential Revision: https://reviews.llvm.org/D92435
Adds visual studio debugger support to dexter via option --debugger vs2019
Differential Revision: https://reviews.llvm.org/D89803
Author: Nabeel Omer <nabeel.omer@sony.com>
both deferred_globals.cpp namespace.cpp require lldb in order to run and will
fail if it's not available.
add the required lines to the top of the tests.
deferred_globals.cpp: Verify that debug information for a local variable does
not hide a global definition that has the same name
namespace.cpp: Ensure that the debug information for a global variable
includes namespace information.
Differential Revision: https://reviews.llvm.org/D89462
Author: Nabeel Omer <nabeel.omer@sony.com>
Recently there has been renewed interest in improving debug-info for variables
that (partially or otherwise) live on the stack in optimised code.
At the moment instcombine speculates that stack slots are probably going to be
promoted to registers, and prepares the debug-info accordingly. It runs a
function called LowerDbgDeclare which converts dbg.declares to a set of
dbg.values after loads, and before stores and calls. Sometimes the stack
location remains (e.g. for escaped locals). If any dbg.values become undef
where the stack location is still valid we end up unnecessarily reducing
variable location coverage due to our inability to track multiple locations
simultaneously. There is a flag to disable this feature
(-instcombine-lower-dbg-declare=0), which prevents this conversion at the cost
of sometimes providing incorrect location info in the face of DSE, DCE, GVN,
CSE etc.
This has been discussed fairly extensively on PR34136.
The idea of these tests is to provide examples of situations that we should
consider when designing a new system, to aid discussions and eventually help
evaluate the implementation.
Dexter isn't ideal for observing specific optimisation behaviour. Writing an
exaustive test suite would be difficult, and the resultant suite would be
fragile. However, I think having some concrete executable examples is useful
at least as a reference.
Differential Revision: https://reviews.llvm.org/D89543
NFC patch simply updates the commands.md documentation contents with missing
links to the DexLimitSteps and DexLabel command documentation.
Differential Revision: https://reviews.llvm.org/D89689
Author: Nabeel Omer <nabeel.omer@sony.com>
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
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
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
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
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
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
Fixes a mismatch in expected arguments passed to run_debugger_subprocess
Fix for:
https://reviews.llvm.org/D76926
rG9cf9710bb0d61cb5c27c6e780af6a182cb162bfb
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
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
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
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
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
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
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