public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH v2 5/5] gdb: disable commit resumed in target_kill
Date: Mon, 28 Nov 2022 09:12:18 -0500	[thread overview]
Message-ID: <ec1fc3d3-ecac-0cb0-0d16-11dd6c3ec9f9@polymtl.ca> (raw)
In-Reply-To: <87a64b2nz3.fsf@redhat.com>


>> +proc do_test { action1 action2 } {
>> +    save_vars { ::GDBFLAGS } {
>> +	append ::GDBFLAGS " -ex \"maintenance set target-non-stop on\""
>> +	clean_restart $::binfile
>> +    }
>> +
>> +    # Ensure we are at least after the getpid call, shall we need it.
> 
> s/shall/should/

Fixed.

> 
>> +    if { ![runto "after_getpid"] } {
>> +	return
>> +    }
>> +
>> +    # Some commands below ask for confirmation.  Turn that off for simplicity.
>> +    gdb_test "set confirm off"
>> +    gdb_test -no-prompt-anchor "continue &"
>> +
>> +    if { $action1 == "kill" } {
>> +	gdb_test "kill" "Inferior 1 .* killed.*"
>> +    } elseif { $action1 == "detach" } {
>> +	set child_pid [get_integer_valueof "mypid" -1]
>> +	if { $child_pid == -1 } {
>> +	    fail "failed to extract child pid"
>> +	    return
>> +	}
>> +
>> +	gdb_test "detach" "Inferior 1 .* detached.*" "detach from first instance"
>> +
>> +	# Kill the detached process, to avoid hanging when exiting GDBserver,
>> +	# when testing with the native-extended-gdbserver board.
>> +	remote_exec target "kill $child_pid"
>> +    } elseif { $action1 == "add" } {
>> +	gdb_test "add-inferior -exec $::binfile" \
>> +	    "Added inferior 2 on connection 1.*" "add-inferior"
>> +	gdb_test "inferior 2" "Switching to inferior 2 .*"
>> +    } elseif { $action1 == "none" } {
>> +
>> +    } else {
>> +	error "invalid action 1"
>> +    }
>> +
>> +    if { $action2 == "start" } {
>> +	gdb_test "start" "Temporary breakpoint $::decimal, main .*"
> 
> When I tested using a recent version of master, I needed to change this
> line to:
> 
>   gdb_test "start" "Temporary breakpoint $::decimal\(?:\.$::decimal\)?, main .*"
> 
> this is a result of commit 78805ff8aecf0a8c828fb1e2c344fa3a56655120.

Fixed.

> 
>> +    } elseif { $action2 == "run" } {
>> +	gdb_test "break main" "Breakpoint $::decimal at $::hex.*"
>> +	gdb_test "run" "Breakpoint $::decimal, main .*"
> 
> and I ran into the same issue here:
> 
>   gdb_test "run" "Breakpoint $::decimal\(?:\.$::decimal\)?, main .*"

Fixed, thanks for spotting these.

> With those fixes, this LGTM.

Thanks, will push.

Simon

      reply	other threads:[~2022-11-28 14:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 17:12 [PATCH v2 0/5] Fix some commit_resumed_state assertion failures (PR 28275) Simon Marchi
2022-11-21 17:12 ` [PATCH v2 1/5] gdb/testsuite: remove global declarations in gdb.threads/detach-step-over.exp Simon Marchi
2022-11-28 11:43   ` Andrew Burgess
2022-11-21 17:12 ` [PATCH v2 2/5] gdb/testsuite: refactor gdb.threads/detach-step-over.exp Simon Marchi
2022-11-28 12:05   ` Andrew Burgess
2022-11-21 17:12 ` [PATCH v2 3/5] gdb: fix assert when quitting GDB while a thread is stepping Simon Marchi
2022-11-28 12:11   ` Andrew Burgess
2022-11-28 13:03     ` Simon Marchi
2022-11-21 17:12 ` [PATCH v2 4/5] gdbserver: switch to right process in find_one_thread Simon Marchi
2022-11-28 13:30   ` Andrew Burgess
2022-11-28 14:09     ` Simon Marchi
2022-11-21 17:12 ` [PATCH v2 5/5] gdb: disable commit resumed in target_kill Simon Marchi
2022-11-28 13:44   ` Andrew Burgess
2022-11-28 14:12     ` Simon Marchi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec1fc3d3-ecac-0cb0-0d16-11dd6c3ec9f9@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).