J'ai tenté de mettre un place l'astuce de jack-ft mais sans succès
Voici mon script :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| #!/bin/bash
# Trap SIGINT (CTRL+C) to avoid stopping the script and redirect it to GDB
trap ctrl_c INT
function ctrl_c() {
echo "** Trapped CTRL+C, redirecting it to ${pid_gdb}"
killall -INT ${pid_gdb}
}
# Run mspdebug as GDB proxy
mspdebug rf2500 gdb 1>/dev/null 2>&1 &
pid_mspdebug=$!
echo "mspdebug is running with PID ${pid_mspdebug}"
# Run GDB
msp430-gdb a.out --command=command.gdb --quiet
pid_gdb=$!
echo "gdb is running with PID ${pid_gdb}"
# Wait for GDB completion
wait ${pid_gdb}
echo "dgb has ended, waiting for mspdebug..."
wait ${pid_mspdebug}
echo "mspdebug has ended, script exits" |
Quand je lance ce script depuis un premier terminal, la session de debug se lance. Depuis un second terminal, je fais killall msp430-gdb -INT et le GDB se met correctement en pause. En revanche, si je fais un CRTL+C depuis le premier terminal, voici ce qui se passe :
$./debug.bash
mspdebug is running with PID 7396
Reading symbols from /home/pgradot/Documents/GitHub/Planteur/launchpad/a.out...done.
_reset_vector__ () at /build/buildd/gcc-msp430-4.6.3~mspgcc-20120406/./gcc-4.6.3/gcc/config/msp430/crt0.S:105
105 /build/buildd/gcc-msp430-4.6.3~mspgcc-20120406/./gcc-4.6.3/gcc/config/msp430/crt0.S: No such file or directory.
in /build/buildd/gcc-msp430-4.6.3~mspgcc-20120406/./gcc-4.6.3/gcc/config/msp430/crt0.S
Breakpoint 1 at 0xfb08
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
Remote connection closed
thread.c:79: internal-error: inferior_thread: Assertion `tp' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
thread.c:79: internal-error: inferior_thread: Assertion `tp' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
** Trapped CTRL+C, redirecting it to
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
./debug.bash: line 18: 7397 Aborted (core dumped) msp430-gdb a.out --command=command.gdb --quiet
gdb is running with PID 7396
dgb has ended, waiting for mspdebug...
mspdebug has ended, script exits
Je ne sais pas si c'est un problème de ce portage de gdb ou un problème de mon script... Des idées ?
Partager