From: Michael Veksler <mveksler@techunix.technion.ac.il>
To: Frederic RISS <frederic.riss@st.com>
Cc: gdb@sourceware.org
Subject: Re: Get versioned minsyms from dynamic symtab (Was: Re: How to call operator<< functions?)
Date: Thu, 31 Aug 2006 13:02:00 -0000 [thread overview]
Message-ID: <44F6DDF8.9000703@tx.technion.ac.il> (raw)
In-Reply-To: <1157027172.3429.309.camel@crx549.cro.st.com>
Frederic RISS wrote:
> On Thu, 2006-08-31 at 15:09 +0300, Michael Veksler wrote:
>
>
>> Great, now std::cout does not cause crashes. Still there is the problem of
>>
>> (gdb) p std::cout
>> $1 = <incomplete type>
>>
>> But that's unrelated, right?
>>
>
> Yes, unrelated.
> This should work if you've got a version of libstdc++ compiled with
> debug info. If you don't, then GDB can't find std::cout's type. This
> works for me once the library is loaded (i.e. once the inferior is
> running):
>
>
Sounds reasonable, however look at the end for my test.
> (gdb) ptype std::cout
> type = struct std::basic_ostream<char,std::char_traits<char> > {
> <incomplete type>
> }
> (gdb) start
>
...
> (gdb) ptype std::cout
> type = class std::basic_ostream<char,std::char_traits<char> >
> : public virtual std::basic_ios<char,std::char_traits<char> > {
>
Take the two files from my test case in:
http://sources.redhat.com/ml/gdb/2006-08/msg00271.html
=> gdb-6.5 -silent a.out
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) b 30
Breakpoint 1 at 0x8048a62: file cout-gdb.cpp, line 30.
(gdb) r
Starting program: /home/veksler/a.out
Enter B::Print() this=0xbfffec00
Breakpoint 1, main () at cout-gdb.cpp:30
warning: Source file is more recent than executable.
30 return forceLink;
(gdb) p x.Print(std::cout)
Enter B::Print() this=0xbfffec00
$1 = void
(gdb) p x.Print(myCout)
Cannot resolve method B::Print to any overloaded instance
(gdb) p x.Print(std::cout)
Cannot resolve method B::Print to any overloaded instance
(gdb)
==============
What is going on here. Why the second Print(std::cout) no longer works?
Let's try to rerun without exiting GDB:
=============
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/veksler/a.out
Enter B::Print() this=0xbfffec00
Breakpoint 1, main () at cout-gdb.cpp:30
30 return forceLink;
(gdb) p x.Print(std::cout)
Cannot resolve method B::Print to any overloaded instance
(gdb)
===========
Still does not work!?
Is it related to your patch?
Michael
next prev parent reply other threads:[~2006-08-31 13:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-30 10:11 How to call operator<< functions? Michael Veksler
2006-08-30 11:13 ` Frederic RISS
2006-08-30 13:30 ` Frederic RISS
2006-08-30 13:40 ` Breakpoint Handling in GDB Veenu Verma (AS/EAB)
2006-08-30 13:43 ` Daniel Jacobowitz
2006-08-30 20:30 ` Michael Snyder
2006-08-31 11:34 ` Get versioned minsyms from dynamic symtab (Was: Re: How to call operator<< functions?) Frederic RISS
2006-08-31 12:09 ` Michael Veksler
2006-08-31 12:26 ` Frederic RISS
2006-08-31 13:02 ` Michael Veksler [this message]
2006-08-31 13:23 ` Frederic RISS
2006-08-31 16:48 ` Frederic RISS
2006-08-31 16:57 ` Daniel Jacobowitz
2006-08-31 17:41 ` Frédéric Riss
2006-08-31 17:45 ` Daniel Jacobowitz
2006-08-31 19:48 ` Michael Veksler
2006-08-31 19:52 ` Daniel Jacobowitz
2006-08-30 12:46 ` How to call operator<< functions? Daniel Jacobowitz
2006-08-30 20:05 ` Michael Veksler
2006-08-30 20:24 ` Daniel Jacobowitz
2006-08-30 20:45 ` Michael Veksler
2006-08-30 20:54 ` Daniel Jacobowitz
2006-08-31 12:05 ` Michael Veksler
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=44F6DDF8.9000703@tx.technion.ac.il \
--to=mveksler@techunix.technion.ac.il \
--cc=frederic.riss@st.com \
--cc=gdb@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