mirror of https://github.com/oxen-io/lokinet
add gdb to ci runners on debian to catch backtraces if they happen
parent
fc08f92425
commit
52bc2facc2
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
rm -f crash.out.txt exit.out.txt
|
||||
gdb -q -x $(readlink -e $(dirname $0))/gdb-filter.py --args $@
|
||||
test -e crash.out.txt && cat crash.out.txt
|
||||
exit $(cat exit.out.txt)
|
@ -0,0 +1,23 @@
|
||||
def exit_handler (event):
|
||||
code = 1
|
||||
if hasattr(event, "exit_code"):
|
||||
code = event.exit_code
|
||||
with open("exit.out.txt", 'w') as f:
|
||||
f.write("{}".format(code))
|
||||
|
||||
def crash_handler (event):
|
||||
if (isinstance(event, gdb.SignalEvent)):
|
||||
log_file_name = "crash.out.txt"
|
||||
gdb.execute("set logging file " + log_file_name )
|
||||
gdb.execute("set logging on")
|
||||
gdb.execute("set logging redirect on")
|
||||
gdb.execute("thread apply all bt")
|
||||
gdb.execute("q")
|
||||
|
||||
gdb.events.stop.connect(crash_handler)
|
||||
|
||||
gdb.events.exited.connect(exit_handler)
|
||||
gdb.execute("set confirm off")
|
||||
gdb.execute("set pagination off")
|
||||
gdb.execute("r")
|
||||
gdb.execute("q")
|
Loading…
Reference in New Issue