philippe | 6654de8 | 2014-04-15 22:35:23 +0000 | [diff] [blame] | 1 | # connect gdb to Valgrind gdbserver: |
| 2 | target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-nlvgdbsigqueue |
| 3 | echo vgdb launched process attached\n |
| 4 | monitor v.set vgdb-error 999999 |
| 5 | # |
| 6 | # |
| 7 | # simulate control-c in a 1 second |
| 8 | shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-nlvgdbsigqueue 1 grep main nlvgdbsigqueue.stderr.out |
| 9 | # |
| 10 | # send SIGUSR1/SIGUSR1 in a few seconds, when vgdb is attached |
philippe | 90afa78 | 2014-04-26 19:55:33 +0000 | [diff] [blame^] | 11 | shell ./send_signal USR1 --vgdb-prefix=./vgdb-prefix-nlvgdbsigqueue 4 |
| 12 | shell ./send_signal USR1 --vgdb-prefix=./vgdb-prefix-nlvgdbsigqueue 4 |
philippe | 6654de8 | 2014-04-15 22:35:23 +0000 | [diff] [blame] | 13 | # |
| 14 | echo continuing to have vgdb interrupted by simulate_control_c\n |
| 15 | continue |
| 16 | # |
| 17 | # Now vgdb should have received the interrupt, and so has |
| 18 | # attached to the sleeping process. |
| 19 | # wait for the USR sig to be sent, that will be queued by vgdb. |
philippe | 90afa78 | 2014-04-26 19:55:33 +0000 | [diff] [blame^] | 20 | shell sleep 8 |
philippe | 6654de8 | 2014-04-15 22:35:23 +0000 | [diff] [blame] | 21 | # continue, so as to have vgdb sending queued signals when PTRACE_DETACHing |
| 22 | echo continuing to receive first SIGUSR1\n |
| 23 | continue |
| 24 | # simulate a control c to afterwards stop the execution |
| 25 | shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-nlvgdbsigqueue 1 |
| 26 | echo continuing to receive second SIGUSR1\n |
| 27 | continue |
| 28 | kill |
| 29 | quit |