Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: dje@google.com (Doug Evans)
Cc: gdb-patches@sourceware.org (gdb-patches)
Subject: Re: [RFA] Fix hand called function when another thread has hit a bp.
Date: Mon, 30 Mar 2009 18:48:00 -0000	[thread overview]
Message-ID: <200903301840.n2UIemX1018434@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <e394668d0902231732w3f3a0205ub35444ad0789849b@mail.gmail.com> from "Doug Evans" at Feb 23, 2009 05:32:38 PM

Doug Evans wrote:

> Hi.  Here's an updated version of the patch.

Sorry for the late reply on this!

> Handling the restart after several threads are all stopped at a
> breakpoint (via scheduler-locking = on), is left for a later patch
> (it's happens more rarely).

This patch, as far as I can see, just replaces one incorrect
behaviour with a different incorrect behaviour, right?

That is to say, in the scenario where we have

 - set scheduler-locking on
 - stop on BP in thread A
 - manually switch to thread B
 - continue execution

the behaviour today is:

 - GDB will switch back to A and single-step
 - (correctly) bypass the already-hit breakpoint in A
 - (incorrectly) continue execution thread A

i.e. the incorrect behaviour is that thread A is continued,
and not thread B.

With your patch, the behaviour is:

 - GDB (correctly) continues execution of thread B
 - but the next time thread A is run, GDB will (incorrectly)
   report a second time the same breakpoint the user already saw

Did I miss anything here?

In any case, I guess I agree that the "new" type of incorrect
behaviour is probably less bad that what we have today, so
your patch does seem to be a step forward.

Will you be working on a follow-on patch to fix the new
incorrect behaviour?


>+for { set i 1 } { $i <= $total_nr_threads } { incr i } {
>+    set thread_nr $i
>+    gdb_test "thread $thread_nr" "" "prepare to discard hand call, thread $thread_nr"
>+    set frame_number [get_dummy_frame_number]
>+    if { "$frame_number" == "" } {
>+	fail "dummy stack frame number, thread $thread_nr"
>+	setup_xfail "*-*-*"
>+	# Need something.
>+	set frame_number 0

Why do we need this xfail here?

>+# Continue one last time, the program should exit normally.
>+#
>+# ??? This currently doesn't work because gdb doesn't know how to singlestep
>+# over reported breakpoints that weren't in the last thread to run.
>+# Fixing this first requires defining what the correct behaviour is.
>+# Commented out until then.
>+#
>+# Manually set the thread back to the first thread: the program is still at
>+# the all_threads_running breakpoint, which wasn't the last thread to run,
>+# and gdb doesn't know how to singlestep over reported breakpoints that
>+# weren't in the last thread to run.
>+#gdb_test "thread 1" "" "set thread to 1, prepare to resume"
>+#
>+#gdb_continue_to_end "hand-call-in-threads"

Should the "thread 1" really be here?  It seems to me this was just an 
unsuccessful attempt to work-around the bug ...

Otherwise, the patch is OK.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  parent reply	other threads:[~2009-03-30 18:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02  3:01 Doug Evans
2008-12-02  3:48 ` Doug Evans
2008-12-02 11:41   ` Doug Evans
2008-12-14 22:00     ` Doug Evans
2008-12-14 22:14       ` Ulrich Weigand
2008-12-15 22:07         ` Doug Evans
2008-12-15 22:50           ` Ulrich Weigand
2008-12-15 23:15             ` Doug Evans
2008-12-17 19:14               ` Ulrich Weigand
2009-02-24 10:42                 ` Doug Evans
2009-03-13 17:06                   ` Doug Evans
2009-03-29 13:36                     ` Doug Evans
2009-03-30 18:48                   ` Ulrich Weigand [this message]
2009-04-03 23:25                     ` Doug Evans

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=200903301840.n2UIemX1018434@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /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