public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "palves at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug breakpoints/15693] Extra *running event when call-style dprintf hits
Date: Fri, 28 Jun 2013 14:24:00 -0000	[thread overview]
Message-ID: <bug-15693-4717-Nfug3OOHJ4@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-15693-4717@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=15693

--- Comment #3 from Pedro Alves <palves at redhat dot com> ---
> That is interesting.  If there is an infcall that causes a bp to be skipped, 
> we see this extra *running event.
> But if it is not an infcall and the bp is still skipped (due to some other
> condition), we don't see the event.

Indeed.  We also have:

static void
mi_on_resume (ptid_t ptid)
{
  struct thread_info *tp = NULL;

  if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid))
    tp = inferior_thread ();
  else
    tp = find_thread_ptid (ptid);

  /* Suppress output while calling an inferior function.  */
  if (tp->control.in_infcall)
    return;


In the non-infcall case, the thread is never marked THREAD_STOPPED, so
set_running never ends up letting the MI observer known a thread was started.

However, if an infcall is involved, then when the infcall finishes, the
normal_stop ends up making the thread state be THREAD_STOPPED:

(top-gdb) bt
#0  0x00000000005dfc87 in finish_thread_state (ptid=...) at
../../src/gdb/thread.c:723
#1  0x00000000005dfdcf in finish_thread_state_cleanup (arg=0xc51a00) at
../../src/gdb/thread.c:750
#2  0x0000000000571474 in do_my_cleanups (pmy_chain=0xc4c630,
old_chain=0xf194c0) at ../../src/gdb/cleanups.c:155
#3  0x00000000005714e1 in do_cleanups (old_chain=0xf194c0) at
../../src/gdb/cleanups.c:177
#4  0x00000000005d3476 in normal_stop () at ../../src/gdb/infrun.c:6040
#5  0x00000000005cbb12 in proceed (addr=18446744073709551615,
siggnal=GDB_SIGNAL_DEFAULT, step=0) at ../../src/gdb/infrun.c:2342
#6  0x00000000005c3e24 in continue_1 (all_threads=0) at
../../src/gdb/infcmd.c:726
#7  0x00000000005c409b in continue_command (args=0x0, from_tty=1) at
../../src/gdb/infcmd.c:818
#8  0x00000000004dc5cf in do_cfunc (c=0xd380b0, args=0x0, from_tty=1) at
../../src/gdb/cli/cli-decode.c:113
#9  0x00000000004df664 in cmd_func (cmd=0xd380b0, args=0x0, from_tty=1) at
../../src/gdb/cli/cli-decode.c:1888
#10 0x00000000006e4425 in execute_command (p=0x7fffffffd341 "", from_tty=1) at
../../src/gdb/top.c:489


However, we don't want that in an infcall -- from the frontend's and user's
perspective the thread was nver THREAD_STOPPED.  Sounds like then the fix is to
do the suppressing in the normal_stop/THREAD_STOPPED path, not on the
"set_running" path.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


  parent reply	other threads:[~2013-06-28 14:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 19:05 [Bug breakpoints/15693] New: " marc.khouzam at ericsson dot com
2013-06-28 11:05 ` [Bug breakpoints/15693] " palves at redhat dot com
2013-06-28 13:39 ` marc.khouzam at ericsson dot com
2013-06-28 14:24 ` palves at redhat dot com [this message]
2013-07-08  8:23 ` teawater at gmail dot com
2014-05-15 23:59 ` palves at redhat dot com
2014-05-29 12:13 ` palves at redhat dot com

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=bug-15693-4717-Nfug3OOHJ4@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).