aboutsummaryrefslogtreecommitdiff
path: root/make-all.com
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-08-18 20:51:29 +0200
committerTom de Vries <tdevries@suse.de>2024-08-18 20:51:29 +0200
commit9747e37ed4a6b167b8d1b0468fc6657c0781743f (patch)
tree54bfcd258687d69a1a66925d2e16e7a809b09008 /make-all.com
parentf9b44496e631edfa5c8218699d5a5ffe59b21033 (diff)
downloadbinutils-master.zip
binutils-master.tar.gz
binutils-master.tar.bz2
[gdb] Prune inferior after switching inferiorHEADmaster
Usually with test-case gdb.python/py-progspace-events.exp I get: ... (gdb) inferior 1^M [Switching to inferior 1 [process 4116] (py-progspace-events)]^M [Switching to thread 1.1 (Thread 0xf77d0ce0 (LWP 4116))]^M 28 { /* Nothing. */ }^M (gdb) PASS: gdb.python/py-progspace-events.exp: inferior 1 step^M FreeProgspaceEvent: <gdb.Progspace object at 0xabf4f850>^M do_parent_stuff () at py-progspace-events.c:41^M 41 ++global_var;^M (gdb) PASS: gdb.python/py-progspace-events.exp: step ... But occasionally I run into the following FAIL: ... (gdb) inferior 1^M [Switching to inferior 1 [process 5199] (py-progspace-events)]^M [Switching to thread 1.1 (Thread 0xf77d0ce0 (LWP 5199))]^M 28 { /* Nothing. */ }^M (gdb) FreeProgspaceEvent: <gdb.Progspace object at 0xabaf03a0>^M FAIL: gdb.python/py-progspace-events.exp: inferior 1 (timeout) ... This is caused by a race between the handling of an event, and the "inferior 1" command. In the passing case, the event is handled first. During which prune_inferiors is called, but it can't remove inferior 2, because it's still the current one. In the failing case, the "inferior 1" command is handled first. Then during handling of the event, prune_inferiors is called, and it can remove inferior 2 because it's no longer the current one. This looks like a test-case issue to me, but ISTM that we can do better: by calling prune_inferiors asap, at the end of the "inferior 1" command, we stabilize the moment when the inferior is removed: ... (gdb) inferior 1^M [Switching to inferior 1 [process 5199] (py-progspace-events)]^M [Switching to thread 1.1 (Thread 0xf77d0ce0 (LWP 5199))]^M 28 { /* Nothing. */ }^M FreeProgspaceEvent: <gdb.Progspace object at 0xabaf03a0>^M (gdb) PASS: gdb.python/py-progspace-events.exp: inferior 1 ... This also allows us to simplify the test-case by removing the step command, which is no longer required to trigger the pruning of the inferior. Tested on x86_64-linux. Approved-by: Kevin Buettner <kevinb@redhat.com> PR gdb/31440 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31440
Diffstat (limited to 'make-all.com')
0 files changed, 0 insertions, 0 deletions