public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/13170] New: some :werror and warning messages are written to gdb/mi log stream
@ 2011-09-08 19:34 xdegaye at gmail dot com
  2011-09-08 20:43 ` [Bug mi/13170] some error " xdegaye at gmail dot com
  2011-09-08 20:52 ` xdegaye at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: xdegaye at gmail dot com @ 2011-09-08 19:34 UTC (permalink / raw)
  To: gdb-prs

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

             Bug #: 13170
           Summary: some :werror and warning messages are written to
                    gdb/mi log stream
           Product: gdb
           Version: 7.3
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mi
        AssignedTo: unassigned@sourceware.org
        ReportedBy: xdegaye@gmail.com
    Classification: Unclassified


How-To-Repeat
-------------

* build a plain executable:

$ echo "main(){}" | gcc -x c -g  -


* run the following test and confirm that the message "No source file
  named foo.c." is written to gdb/mi log stream instead of the console
  stream:

$ gdb --interpreter=mi -q -ex "set confirm off" a.out
=thread-group-added,id="i1"
~"Reading symbols from /home/xavier/tmp/a.out..."
~"done.\n"
(gdb)
-interpreter-exec console "break foo.c:1"
&"No source file named foo.c.\n"
^done
(gdb)
quit
&"quit\n"

-- 
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] 3+ messages in thread

* [Bug mi/13170] some error and warning messages are written to gdb/mi log stream
  2011-09-08 19:34 [Bug mi/13170] New: some :werror and warning messages are written to gdb/mi log stream xdegaye at gmail dot com
@ 2011-09-08 20:43 ` xdegaye at gmail dot com
  2011-09-08 20:52 ` xdegaye at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: xdegaye at gmail dot com @ 2011-09-08 20:43 UTC (permalink / raw)
  To: gdb-prs

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

Xavier de Gaye <xdegaye at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|some :werror and warning    |some error and warning
                   |messages are written to     |messages are written to
                   |gdb/mi log stream           |gdb/mi log stream

-- 
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] 3+ messages in thread

* [Bug mi/13170] some error and warning messages are written to gdb/mi log stream
  2011-09-08 19:34 [Bug mi/13170] New: some :werror and warning messages are written to gdb/mi log stream xdegaye at gmail dot com
  2011-09-08 20:43 ` [Bug mi/13170] some error " xdegaye at gmail dot com
@ 2011-09-08 20:52 ` xdegaye at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: xdegaye at gmail dot com @ 2011-09-08 20:52 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Xavier de Gaye <xdegaye at gmail dot com> 2011-09-08 20:41:55 UTC ---
Warning message written to the log stream
-----------------------------------------
The following test case shows a warning message written to the log
stream instead of the console output stream.

Test with the following source code:
=======================================
class A {
    public:
        void test(void) {}
        void test(int a) {}
};

int main()
{
    A obj;
    obj.test();
    obj.test(0);
}
=======================================

xavier@maritorne:multiple_choice$ gdb -q --interpreter=mi a.out
=thread-group-added,id="i1"
~"Reading symbols from a.out..."
~"done.\n"
(gdb) 
-break-insert A::test
&"warning: Multiple breakpoints were set.\nUse the \"delete\" command to delete
unwanted breakpoints."
&"\n"
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004005a7",func="A::test(int)",file="overloaded.cc",fullname="/home/xavier/tmp/gdb_bugs/multiple_choice/overloaded.cc",line="4",times="0",original-location="A::test(int)"},bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x000000000040059a",func="A::test()",file="overloaded.cc",fullname="/home/xavier/tmp/gdb_bugs/multiple_choice/overloaded.cc",line="3",times="0",original-location="A::test()"}
(gdb) 



Message written twice: to the log stream and as an error result record
----------------------------------------------------------------------
The following test case shows that a same error message is written
twice, once to the log stream and once as an error result record.

This is annoying as frontends that choose to display all the log
stream messages in the same window together with the console output
stream messages and the error result records (as a workaround to these
error messages mis-routed to the log stream) will print twice the
message.

Test with the following source code:
=======================================
void foo() {}

int main()
{
    foo();
}
=======================================

$ gdb -q --interpreter=mi a.out
=thread-group-added,id="i1"
~"Reading symbols from a.out..."
~"done.\n"
(gdb) 
-break-insert foo
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400480",func="foo",file="foo.c",fullname="/home/xavier/tmp/gdb_bugs/print/foo.c",line="1",times="0",original-location="foo"}
(gdb) 
-exec-run
=thread-group-started,id="i1",pid="12432"
=thread-created,id="1",group-id="i1"

[1]+  Stopped                 gdb -q --interpreter=mi a.out
$ fg
gdb -q --interpreter=mi a.out
^running
*running,thread-id="all"
(gdb) 
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/lib/libc.so.6",target-name="/lib/libc.so.6",host-name="/lib/libc.so.6",symbols-loaded="0",thread-group="i1"
*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0000000000400480",func="foo",args=[],file="foo.c",fullname="/home/xavier/tmp/gdb_bugs/print/foo.c",line="1"},thread-id="1",stopped-threads="all",core="1"
(gdb) 
-interpreter-exec console "print foo()"
~"\nBreakpoint "
~"1, foo () at foo.c:1\n"
~"1\tvoid foo() {}\n"
&"The program being debugged stopped while in a function called from GDB.\n"
&"Evaluation of the expression containing the function\n"
&"(foo) will be abandoned.\n"
&"When the function is done executing, GDB will silently stop.\n"
^error,msg="The program being debugged stopped while in a function called from
GDB.\nEvaluation of the expression containing the function\n(foo) will be
abandoned.\nWhen the function is done executing, GDB will silently stop."
(gdb)

-- 
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] 3+ messages in thread

end of thread, other threads:[~2011-09-08 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-08 19:34 [Bug mi/13170] New: some :werror and warning messages are written to gdb/mi log stream xdegaye at gmail dot com
2011-09-08 20:43 ` [Bug mi/13170] some error " xdegaye at gmail dot com
2011-09-08 20:52 ` xdegaye at gmail 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).