Commit Graph

7 Commits

Author SHA1 Message Date
Felipe de Azevedo Piovezan
f7f869c88d [DebugInfo] Don't inherit debug location of previous instruction
Prior to this commit, when lowering SIL instructions that should are
"hidden" for the purposes of debugging, the compiler just attaches the
location of the previous instruction in the name of keeping a simpler
line table.

However, this is wrong for many reasons. One such reason is this: at the
start of a basic block, inheriting the previous debug location will
almost certainly cause the instruction to have a random location in the
code, as it will depend on whatever BB was visited previously.

Other examples can be seen in the tests affect by this commit, which
changes lowering to use Line 0 instead of the line number of the
previous instruction.

CodeView doesn't handle line 0 the same way DWARF does, so this commit
preserves the old behavior for the CodeView path.

The test changes here are effectively undoing some of the diffs from
158772c2ab.

rdar://139826231&110187845
2024-11-18 10:23:41 -08:00
Alastair Houghton
93e05cd1bb [Linux] Disable fatalError() backtraces when the runtime backtracer is active.
There's no need for fatalError() to try to generate its own backtraces
when the runtime's backtracer is enabled.  Not only is the code it uses
more fragile but it also doesn't support async or inline frames and it
can't look-up symbols properly either.

rdar://117470489
2023-11-01 09:18:21 +00:00
Alastair Houghton
6e9151f2f7 [Test][Backtracing] Only disable FatalError for macOS.
Actually, we only need to disable this for macOS.  It should be fine
on Linux.
2023-10-19 15:33:05 +01:00
Alastair Houghton
4e6ad2e872 [Test][Backtracing] Disable FatalError test temporarily.
Some CI nodes currently cause this test to fail because of outdated
software.  Disable it for now.
2023-10-19 15:31:33 +01:00
Alastair Houghton
256e3cd499 [Test][Backtracing] Make FatalError test more lenient.
Somehow since this passed PR testing, `Builtin.int_trap()` has changed
from generating `SIGILL` to `SIGTRAP`.  Accept either.

rdar://116584708
2023-10-06 18:05:37 +01:00
Alastair Houghton
2cbc064a9e [Backtracing][Tests] Tweak the new fatalError test slightly.
The test needs tweaking a little to work on Linux and macOS.

rdar://116112040
2023-10-05 18:04:58 +01:00
Alastair Houghton
7b7f77eeaa [Linux] Enable frame pointers when building Swift libraries.
Turn on frame pointers for the Swift runtime libraries.  This makes
backtraces that go through the runtimes more reliable without having
to parse DWARF data.

rdar://116112040
2023-10-05 16:11:20 +01:00