NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/54508: gdb watch variable backgrounds gdb



	Note: There was a bad value `' for the field `Class'.
	It was set to the default value of `sw-bug'.

	Note: There was a bad value `' for the field `Priority'.
	It was set to the default value of `medium'.

	Note: There was a bad value `' for the field `Severity'.
	It was set to the default value of `serious'.

>Number:         54508
>Category:       toolchain
>Synopsis:       'watch'ing a variable backgrounds gdb process
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 29 17:30:00 +0000 2019
>Originator:     Tobias Ulmer
>Release:        NetBSD 9.99.10
>Organization:
	
>Environment:
	
	
System: NetBSD nbsd1.tmux.org 9.99.10 NetBSD 9.99.10 (GENERIC) #0: Sat Aug 24 11:51:26 UTC 2019 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
This is a bit of a WTF.  Watching a variable in gdb sends the gdb process into
the (terminal) background. Recovery (with fg) is not possible.  Does not depend
on the program, volatile in the example is just to stop optimization.
>How-To-Repeat:
$ echo "int main(void) { volatile int x; return 0; }" > gt.c
$ gcc -ggdb gt.c
$ gdb ./a.out
(gdb) break main
Breakpoint 1 at 0x40092e: file gt.c, line 1.
(gdb) run
Starting program: /home/tobiasu/a.out 

Breakpoint 1, main () at gt.c:1
1       int main(void) { volatile int x; return 0; }
(gdb) watch x
Hardware watchpoint 2: x
(gdb) step
[1] + Stopped (tty output) gdb ./a.out 
$ fg
gdb ./a.out 
[1] + Stopped (tty output) gdb ./a.out 
$ fg
gdb ./a.out 
[1] + Stopped (tty output) gdb ./a.out 
$ kill -9 %1
$ [ 96995.7464743] sorry, pid 12282 was killed: orphaned traced process
[1] + Killed               gdb ./a.out
>Fix:

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index