public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/15186] New: Agent style dprintf does not buffer output properly
@ 2013-02-24 13:56 marc.khouzam at ericsson dot com
  2013-04-19 10:51 ` [Bug breakpoints/15186] " teawater at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: marc.khouzam at ericsson dot com @ 2013-02-24 13:56 UTC (permalink / raw)
  To: gdb-prs

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

             Bug #: 15186
           Summary: Agent style dprintf does not buffer output properly
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
        AssignedTo: unassigned@sourceware.org
        ReportedBy: marc.khouzam@ericsson.com
    Classification: Unclassified


Output buffering for "agent" style is not behaving as a real printf.  For
example, if my program does
     printf("hello");
     printf("friend\n");
and I put a dprintf " my " on the second line, I would expect to see
   "hello my friend"
but instead I see the " my " gets buffered until the program terminates.

Note two sessions below, one no using a new line and one with a new line:

> gdb.7.6 ~/loopfirst
GNU gdb (GDB) 7.5.50.20130223-cvs
(gdb) l
1       #include <unistd.h>
2       #include <stdio.h>
3
4       int main() {
5           for (int i=0;i<5;i++) {
6               printf("hello");
7               printf("friend\n");
8               printf("home\n");
9               sleep(1);
10          }
(gdb) target remote :9999
Remote debugging using :9999
Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux.so.2
0x00110850 in ?? () from /lib/ld-linux.so.2
(gdb) dprintf 7," my "
Dprintf 1 at 0x8048553: file loopfirst.cc, line 7.
(gdb) set dprintf-style agent
(gdb) info b
Num     Type           Disp Enb Address    What
1       dprintf        keep y   0x08048553 in main() at loopfirst.cc:7
        agent-printf " my "
(gdb) c

gdbserver output:
Remote debugging from host 127.0.0.1
hellofriend
home
hellofriend
home
hellofriend
home
hellofriend
home
hellofriend
home

Child exited with status 0
GDBserver exiting
 my  my  my  my  my >


Even with a new-line in the dprintf, things don't behave right:

> gdb.7.6 ~/loopfirst
GNU gdb (GDB) 7.5.50.20130223-cvs
(gdb) target remote :9999
Remote debugging using :9999
Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux.so.2
0x00110850 in ?? () from /lib/ld-linux.so.2
(gdb) l
1       #include <unistd.h>
2       #include <stdio.h>
3
4       int main() {
5           for (int i=0;i<5;i++) {
6               printf("hello");
7               printf("friend\n");
8               printf("home\n");
9               sleep(1);
10          }
(gdb) dprintf 7," my\n"
Dprintf 1 at 0x8048553: file loopfirst.cc, line 7.
(gdb) set dprintf-style agent
(gdb) info b
Num     Type           Disp Enb Address    What
1       dprintf        keep y   0x08048553 in main() at loopfirst.cc:7
        agent-printf " my\n"
(gdb) c

gdbserver output:
Remote debugging from host 127.0.0.1
 my
hellofriend
home
 my
hellofriend
home
 my
hellofriend
home
 my
hellofriend
home
 my
hellofriend
home

Child exited with status 0
GDBserver exiting
> 

Note how the "my" is flushed first and not after the "hello", although the
dprintf was put after the "hello".

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug breakpoints/15186] Agent style dprintf does not buffer output properly
  2013-02-24 13:56 [Bug breakpoints/15186] New: Agent style dprintf does not buffer output properly marc.khouzam at ericsson dot com
@ 2013-04-19 10:51 ` teawater at gmail dot com
  2013-04-19 10:52 ` teawater at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: teawater at gmail dot com @ 2013-04-19 10:51 UTC (permalink / raw)
  To: gdb-prs

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

teawater <teawater at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |teawater at gmail dot com

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug breakpoints/15186] Agent style dprintf does not buffer output properly
  2013-02-24 13:56 [Bug breakpoints/15186] New: Agent style dprintf does not buffer output properly marc.khouzam at ericsson dot com
  2013-04-19 10:51 ` [Bug breakpoints/15186] " teawater at gmail dot com
@ 2013-04-19 10:52 ` teawater at gmail dot com
  2013-04-19 10:59 ` teawater at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: teawater at gmail dot com @ 2013-04-19 10:52 UTC (permalink / raw)
  To: gdb-prs

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

teawater <teawater at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at sourceware    |teawater at gmail dot com
                   |dot org                     |

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug breakpoints/15186] Agent style dprintf does not buffer output properly
  2013-02-24 13:56 [Bug breakpoints/15186] New: Agent style dprintf does not buffer output properly marc.khouzam at ericsson dot com
  2013-04-19 10:51 ` [Bug breakpoints/15186] " teawater at gmail dot com
  2013-04-19 10:52 ` teawater at gmail dot com
@ 2013-04-19 10:59 ` teawater at gmail dot com
  2013-04-25  2:58 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: teawater at gmail dot com @ 2013-04-19 10:59 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from teawater <teawater at gmail dot com> 2013-04-19 10:59:38 UTC ---
http://sourceware.org/ml/gdb-patches/2013-04/msg00566.html

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug breakpoints/15186] Agent style dprintf does not buffer output properly
  2013-02-24 13:56 [Bug breakpoints/15186] New: Agent style dprintf does not buffer output properly marc.khouzam at ericsson dot com
                   ` (2 preceding siblings ...)
  2013-04-19 10:59 ` teawater at gmail dot com
@ 2013-04-25  2:58 ` cvs-commit at gcc dot gnu.org
  2013-04-25  3:13 ` teawater at gmail dot com
  2013-04-25  8:10 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-04-25  2:58 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-04-25 02:58:07 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    teawater@sourceware.org    2013-04-25 02:58:05

Modified files:
    gdb/gdbserver  : ChangeLog ax.c 

Log message:
    2013-04-25  Hui Zhu  <hui@codesourcery.com>

    PR gdb/15186

    * ax.c (ax_printf): Add fflush.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbserver/ChangeLog.diff?cvsroot=src&r1=1.708&r2=1.709
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbserver/ax.c.diff?cvsroot=src&r1=1.7&r2=1.8

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug breakpoints/15186] Agent style dprintf does not buffer output properly
  2013-02-24 13:56 [Bug breakpoints/15186] New: Agent style dprintf does not buffer output properly marc.khouzam at ericsson dot com
                   ` (3 preceding siblings ...)
  2013-04-25  2:58 ` cvs-commit at gcc dot gnu.org
@ 2013-04-25  3:13 ` teawater at gmail dot com
  2013-04-25  8:10 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: teawater at gmail dot com @ 2013-04-25  3:13 UTC (permalink / raw)
  To: gdb-prs

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

teawater <teawater at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from teawater <teawater at gmail dot com> 2013-04-25 03:13:56 UTC ---
http://www.sourceware.org/ml/gdb-cvs/2013-04/msg00234.html

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug breakpoints/15186] Agent style dprintf does not buffer output properly
  2013-02-24 13:56 [Bug breakpoints/15186] New: Agent style dprintf does not buffer output properly marc.khouzam at ericsson dot com
                   ` (4 preceding siblings ...)
  2013-04-25  3:13 ` teawater at gmail dot com
@ 2013-04-25  8:10 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-04-25  8:10 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-04-25 08:10:28 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Branch:     gdb_7_6-branch
Changes by:    teawater@sourceware.org    2013-04-25 08:10:26

Modified files:
    gdb/gdbserver  : ax.c ChangeLog 

Log message:
    2013-04-25  Hui Zhu  <hui@codesourcery.com>

    PR gdb/15186
    * ax.c (ax_printf): Add fflush.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbserver/ax.c.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.7&r2=1.7.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbserver/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.697.2.2&r2=1.697.2.3

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2013-04-25  8:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-24 13:56 [Bug breakpoints/15186] New: Agent style dprintf does not buffer output properly marc.khouzam at ericsson dot com
2013-04-19 10:51 ` [Bug breakpoints/15186] " teawater at gmail dot com
2013-04-19 10:52 ` teawater at gmail dot com
2013-04-19 10:59 ` teawater at gmail dot com
2013-04-25  2:58 ` cvs-commit at gcc dot gnu.org
2013-04-25  3:13 ` teawater at gmail dot com
2013-04-25  8:10 ` cvs-commit at gcc dot gnu.org

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