public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "marc.khouzam at ericsson dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug breakpoints/16551] New: Execution stops when encountering a dprintf with an invalid string
Date: Mon, 10 Feb 2014 18:18:00 -0000	[thread overview]
Message-ID: <bug-16551-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=16551

            Bug ID: 16551
           Summary: Execution stops when encountering a dprintf with an
                    invalid string
           Product: gdb
           Version: 7.7
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: marc.khouzam at ericsson dot com

I define a dprintf that has an error in its printout function (as the user may
do this by mistake).  When the dprintf is hit, an error printout is output and
the execution stops.  However, no *stopped event is issued.

This missing *stopped event is not good, but I think the problem to fix is that
the execution should not stop in this case.  If a user sets a dprintf, she
expects the execution to continue and there may be negative consequence at
suddenly stopping the execution.

Addressing bug 15185 would probably fix this.

Here is a stripped session that shows how to reproduce:

> gdb -i mi loopfirst
=thread-group-added,id="i1"
~"GNU gdb (GDB) 7.7\n"
~"Reading symbols from loopfirst..."
~"done.\n"
(gdb) 
dprintf 5,"%d\n",badvariable
(gdb) 
i b
&"i b\n"
~"Num     Type           Disp Enb Address            What\n"
~"1       dprintf        keep y   0x000000000040054c in main() at
loopfirst.cc:5\n"
~"        printf \"%d\\n\",badvariable\n"
^done
(gdb) 
22-exec-run
=thread-group-started,id="i1",pid="13398"
=thread-created,id="1",group-id="i1"
22^running
*running,thread-id="all"
(gdb)
22^error,msg="No symbol \"badvariable\" in current context."
(gdb)
i thre
&"i thre\n"
~"  Id   Target Id         Frame \n"
~"* 1    process 13398 \"loopfirst\" main () at loopfirst.cc:5\n"
^done

=== Notice that the thread is stopped although we did an -exec-run ==

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


             reply	other threads:[~2014-02-10 18:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10 18:18 marc.khouzam at ericsson dot com [this message]
2014-04-06  4:11 ` [Bug breakpoints/16551] " malaperle at gmail dot com
2015-02-05 16:24 ` antoine.tremblay at ericsson dot com
2015-02-05 18:23 ` antoine.tremblay at ericsson dot com
2015-02-05 18:24 ` marc.khouzam at ericsson dot com
2015-03-24 17:30 ` antoine.tremblay at ericsson dot com
2015-03-24 20:08 ` marc.khouzam at ericsson 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-16551-4717@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).