Support new runtime with nim-gdb (#21400)
* Add support for orc strings * Cleaned up testing script Enums now printing properly Merged both old and new strings into the one printer Moving onto sets which seem kinda difficult * Sets working Instead of trying to imitate how Nim represents enums, I just call the dollar proc for each enum value While this runs into problems if the user doesn't call the dollar proc anywhere, I believe its a decent tradeoff I've cleaned up the error message for when it cannot find dollar proc (Might add in proper message on how to fix) * Support sequences V2 runtime seems to have sequences that don't have a len (Guessing its some kind of short seq optimisation?) but I've rolled the implementation into normal sequences since the implementation is practically the same * Clean up test program so it isn't using diff Also don't redirect the first nim compile to /dev/null so that we can check for any compilation errors I found the diff to be annoying to read (Seeing as the test script already performs diffing) * Tables are now supported * Add colours to test output It was getting difficult to tell apart test output from GDB output so I added colour to better tell them apart * Both old and new runtime are working Set exit code in python test script so that this could possibly be added to the CI. Only issue is that it can be flaky (GDB crashes randomly for some reason) * Remove old code that was commented out If I need it later I'll just use git * Remove branch that never runs * Remove the old test output [skip ci]
This commit is contained in:
parent
e896977bd1
commit
c66dc913ce
5 changed files with 160 additions and 307 deletions
20
tests/untestable/gdb/gdb_pretty_printer_test_run.sh
Normal file → Executable file
20
tests/untestable/gdb/gdb_pretty_printer_test_run.sh
Normal file → Executable file
|
|
@ -1,15 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
# Exit if anything fails
|
||||
set -e
|
||||
#!/usr/bin/env bash
|
||||
# Compile the test project with fresh debug information.
|
||||
nim c --debugger:native gdb_pretty_printer_test_program.nim &> /dev/null
|
||||
nim c --debugger:native --mm:orc --out:gdbNew gdb_pretty_printer_test_program.nim
|
||||
echo "Running new runtime tests..."
|
||||
# 2>&1 redirects stderr to stdout (all output in stdout)
|
||||
# <(...) is a bash feature that makes the output of a command into a
|
||||
# file handle.
|
||||
# diff compares the two files, the expected output, and the file
|
||||
# handle that is created by the execution of gdb.
|
||||
diff ./gdb_pretty_printer_test_output.txt <(gdb -x gdb_pretty_printer_test.py --batch-silent --args gdb_pretty_printer_test_program 2>&1)
|
||||
# The exit code of diff is forwarded as the exit code of this
|
||||
# script. So when the comparison fails, the exit code of this script
|
||||
# won't be 0. So this script should be embeddable in a test suite.
|
||||
gdb -x gdb_pretty_printer_test.py --batch-silent --args gdbNew 2>&1
|
||||
|
||||
|
||||
# Do it all again, but with old runtime
|
||||
nim c --debugger:native --mm:refc --out:gdbOld gdb_pretty_printer_test_program.nim &> /dev/null
|
||||
echo "Running old runtime tests"
|
||||
gdb -x gdb_pretty_printer_test.py --batch-silent --args gdbOld 2>&1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue