public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/15718] New: inferior calls confuse target-async
@ 2013-07-03 19:46 tromey at redhat dot com
  2013-07-03 19:50 ` [Bug cli/15718] " tromey at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2013-07-03 19:46 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 15718
           Summary: inferior calls confuse target-async
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at redhat dot com

Consider this source:

int false (void)
{
  return 0;
}

void hibob (void)
{
}

int main ()
{
  hibob ();
  return 0;
}


If you run this with target-async enabled, and use
"break hibob if false()", then a synchronous "run"
will become async at some point:

Reading symbols from /tmp/q...done.
(gdb) set target-async 1
(gdb) break hibob if false()
Breakpoint 1 at 0x4004fb: file q.c, line 8.
(gdb) r
Starting program: /tmp/q 
(gdb) [Inferior 1 (process 4399) exited normally]

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/15718] inferior calls confuse target-async
  2013-07-03 19:46 [Bug cli/15718] New: inferior calls confuse target-async tromey at redhat dot com
@ 2013-07-03 19:50 ` tromey at redhat dot com
  2013-07-08 16:46 ` tromey at redhat dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2013-07-03 19:50 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |15712

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/15718] inferior calls confuse target-async
  2013-07-03 19:46 [Bug cli/15718] New: inferior calls confuse target-async tromey at redhat dot com
  2013-07-03 19:50 ` [Bug cli/15718] " tromey at redhat dot com
@ 2013-07-08 16:46 ` tromey at redhat dot com
  2014-03-20 17:54 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2013-07-08 16:46 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tromey at redhat dot com

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/15718] inferior calls confuse target-async
  2013-07-03 19:46 [Bug cli/15718] New: inferior calls confuse target-async tromey at redhat dot com
  2013-07-03 19:50 ` [Bug cli/15718] " tromey at redhat dot com
  2013-07-08 16:46 ` tromey at redhat dot com
@ 2014-03-20 17:54 ` cvs-commit at gcc dot gnu.org
  2014-03-20 18:17 ` palves at redhat dot com
  2014-03-20 18:19 ` palves at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-03-20 17:54 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  beb460e8d2ddf5327a6ab146055a6e6e9f552a4b (commit)
      from  5fc35d961bda7f8d40bfad9ca458a6b08de02bcb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=beb460e8d2ddf5327a6ab146055a6e6e9f552a4b

commit beb460e8d2ddf5327a6ab146055a6e6e9f552a4b
Author: Pedro Alves <palves@redhat.com>
Date:   Thu Mar 20 17:03:43 2014 +0000

    make dprintf.exp pass in target async mode

    When target-async is enabled, dprintf.exp fails:

     Running ../../../src/gdb/testsuite/gdb.base/dprintf.exp ...
     FAIL: gdb.base/dprintf.exp: 1st dprintf, call
     FAIL: gdb.base/dprintf.exp: 2nd dprintf, call
     FAIL: gdb.base/dprintf.exp: Set dprintf function
     FAIL: gdb.base/dprintf.exp: 1st dprintf, fprintf
     FAIL: gdb.base/dprintf.exp: 2nd dprintf, fprintf

     Breakpoint 2, main (argc=1, argv=0x7fffffffd3f8) at
../../../src/gdb/testsuite/gdb.base/dprintf.c:33
     33        int loc = 1234;
     (gdb) continue
     Continuing.
     kickoff 1234
     also to stderr 1234
     At foo entry
     (gdb) FAIL: gdb.base/dprintf.exp: 1st dprintf, call

    The problem is that GDB gave the prompt back to the user too early.

    This happens when calling functions while handling an event that
    doesn't cause a user visible stop.  dprintf with "set dprintf-style
    gdb" is one such case.  This patch adds a test case that has a
    breakpoint with a condition that calls a function that returns false,
    so that regression testing isn't dependent on the implementation of
    dprintf.

    The problem happens because run_inferior_call causes GDB to forget
    that it is running in sync_execution mode, so any event that runs an
    inferior call causes fetch_inferior_event to display the prompt, even
    if the event should not result in a user visible stop (that is, gdb
    resumes the inferior and waits for the next event).

    This patch fixes the issue by noticing when GDB was in sync_execution
    mode in run_inferior_call, and taking care to restore this state
    afterward.

    gdb/
    2014-03-20  Tom Tromey  <tromey@redhat.com>

        PR cli/15718
        * infcall.c: Include event-top.h.
        (run_inferior_call): Call async_disable_stdin if needed.

    gdb/testsuite/
    2014-03-20  Tom Tromey  <tromey@redhat.com>
            Pedro Alves  <palves@redhat.com>

        PR cli/15718
        * gdb.base/condbreak-call-false.c: New file.
        * gdb.base/condbreak-call-false.exp: New file.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                                   |    6 +++
 gdb/infcall.c                                   |   10 ++++++
 gdb/testsuite/ChangeLog                         |    7 ++++
 gdb/testsuite/gdb.base/condbreak-call-false.c   |   39 +++++++++++++++++++++++
 gdb/testsuite/gdb.base/condbreak-call-false.exp |   33 +++++++++++++++++++
 5 files changed, 95 insertions(+), 0 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/condbreak-call-false.c
 create mode 100644 gdb/testsuite/gdb.base/condbreak-call-false.exp

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/15718] inferior calls confuse target-async
  2013-07-03 19:46 [Bug cli/15718] New: inferior calls confuse target-async tromey at redhat dot com
                   ` (2 preceding siblings ...)
  2014-03-20 17:54 ` cvs-commit at gcc dot gnu.org
@ 2014-03-20 18:17 ` palves at redhat dot com
  2014-03-20 18:19 ` palves at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: palves at redhat dot com @ 2014-03-20 18:17 UTC (permalink / raw)
  To: gdb-prs

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

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |palves at redhat dot com
         Resolution|---                         |FIXED

--- Comment #2 from Pedro Alves <palves at redhat dot com> ---
Fixed.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/15718] inferior calls confuse target-async
  2013-07-03 19:46 [Bug cli/15718] New: inferior calls confuse target-async tromey at redhat dot com
                   ` (3 preceding siblings ...)
  2014-03-20 18:17 ` palves at redhat dot com
@ 2014-03-20 18:19 ` palves at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: palves at redhat dot com @ 2014-03-20 18:19 UTC (permalink / raw)
  To: gdb-prs

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

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |7.8

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-20 18:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-03 19:46 [Bug cli/15718] New: inferior calls confuse target-async tromey at redhat dot com
2013-07-03 19:50 ` [Bug cli/15718] " tromey at redhat dot com
2013-07-08 16:46 ` tromey at redhat dot com
2014-03-20 17:54 ` cvs-commit at gcc dot gnu.org
2014-03-20 18:17 ` palves at redhat dot com
2014-03-20 18:19 ` palves at redhat dot com

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).