This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug mi/13170] some error and warning messages are written to gdb/milog stream


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]