Made generated prettyasserts more debuggable

The main star of the show is the adoption of __builtin_trap() for
aborting on assert failure. I discovered this GCC/Clang extension
recently and it integrates much, _much_ better with GDB.

With stdlib's abort(), GDB drops you off in several layers of internal
stdlib functions, which is a pain to navigate out of to get to where the
assert actually happened. With __builtin_trap(), GDB stops immediately,
making debugging quick and easy.

This is great! The pain of debugging needs to come from understanding
the error, not just getting to it.

---

Also tweaked a few things with the internal print functions to make
reading the generated source easier, though I realize this is a rare
thing to do.
This commit is contained in:
Christopher Haster
2024-02-14 01:01:37 -06:00
parent 06a360462a
commit 1422a61d16
5 changed files with 25 additions and 38 deletions

View File

@@ -1366,13 +1366,6 @@ def run(runner, bench_ids=[], **args):
'-ex', 'break %s:%d' % (path, lineno),
'-ex', 'run',
'--args']
elif failure.assert_ is not None:
cmd[:0] = args['gdb_path'] + [
'-q',
'-ex', 'run',
'-ex', 'frame function raise',
'-ex', 'up 2',
'--args']
else:
cmd[:0] = args['gdb_path'] + [
'-q',