[PATCH v3] gdb: Fix deleted thread when issuing next command
Simon Marchi
simon.marchi@polymtl.ca
Wed Jun 23 19:34:44 GMT 2021
On 2021-06-23 2:16 p.m., Aleksandar Paunovic wrote:
> V2 can be found here https://sourceware.org/pipermail/gdb-patches/2021-June/179888.html
> V3 addresses all comments from Simon.
> Changes compared to V2:
> * Commit message updated to indicate target_thread_alive was called on the wrong target stack.
> * Tests are moved to gdb.multi
> * Tests are renamed from breakpoint-running-inferior to break-while-other-inf-steps
> * Duplicated tests are removed with with_test_prefix
> * Skip the test with native-extended-gdbserver board with [target_info gdb_protocl] check.
>
Thanks. There's just one issue to fix: I noticed that even with the
default board, the test doesn't finish cleanly, it finishes with:
WARNING: Timed out waiting for EOF in server after monitor exit
The useful portion of the test finishes in like 1 second, but then takes
time to exit because of that. If you `tail -F testsuite/gdb.log` which
running the test, you'll see what I mean.
> diff --git a/gdb/testsuite/gdb.multi/break-while-other-inf-steps.exp b/gdb/testsuite/gdb.multi/break-while-other-inf-steps.exp
> new file mode 100644
> index 0000000000..6936d3db3d
> --- /dev/null
> +++ b/gdb/testsuite/gdb.multi/break-while-other-inf-steps.exp
> @@ -0,0 +1,99 @@
> +# Copyright 2021 Free Software Foundation, Inc.
> +
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program. If not, see <http://www.gnu.org/licenses/>.
> +
> +# Create two inferiors with different targets. The first runs on top of
> +# a native target while the second on a remote target. Both inferiors
> +# use the copy of the same source code. The copy is done in order to make
> +# sure that a breakpoint is only in inferior 2. While in inferior 1, do
> +# a "next" which should break in a thread in inferior 2.
> +# Both executables will run total of 4 threads (2 per executable) and
> +# we will put a breakpoint only in the second executable to achieve this.
> +
> +load_lib gdbserver-support.exp
> +
> +# This test explicitly sets up native and remote target. Do not run
> +# it with a board file which defaults to a remote target.
> +if {[target_info gdb_protocol] != ""} {
> + return 0
> +}
> +
> +standard_testfile break-while-other-inf-steps-1.c break-while-other-inf-steps-2.c
You can shorten this to:
standard_testfile -1.c -2.c
Simon
More information about the Gdb-patches
mailing list