Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* help: gdb and c++ strings
@ 2002-12-05 20:07 Murad Nayal
  2002-12-05 20:15 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Murad Nayal @ 2002-12-05 20:07 UTC (permalink / raw)
  To: gdb



Hello,

I am wondering if anyone here can help me with this. I am porting code
to linux and trying to use gdb to do the debugging. unfortunately this
is complicated by the fact that gdb does not print c++ string variables.

p s
$1 = (
    const basic_string<char,std::char_traits<char>,std::allocator<char>
> &) @0xbffff3d0: {static npos = Cannot access memory at address 0x8f4b974

I have come upon an older post to bug-gdb list that mentions this
problem
http://sources.redhat.com/ml/bug-gdb/2000-09/msg00012.html

in response Daniel Berlin suggested that this problem might be related
to the stabs format and that using dwarf-2 format (i.e. g++ -gdwarf-2)
would solve it. however it was mentioned back then that for large
programs this problem persists even when compiling with the -gdwarf-2
flag. this is where I am at right now. I have recompiled gdb from
sources (5.2.1) and recompiled most of the libraries I am using
(including the objects I am trying to debug) using the -gdwarf-2 flag. I
am on a pentium 3 platform using g++ 3.2.1, also compiled from sources.
I am not sure what to try next. can you help?

thanks
Murad Nayal


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: help: gdb and c++ strings
@ 2002-12-05 20:45 Michael Elizabeth Chastain
  2002-12-05 22:25 ` Murad Nayal
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-05 20:45 UTC (permalink / raw)
  To: drow, mn216; +Cc: gdb

Hello Murad,

There are two snapshots available:

  ftp://sources.redhat.com/pub/gdb/snapshots/branch/gdb-5.2.91.tar.bz2
  ftp://sources.redhat.com/pub/gdb/snapshots/current/insight+dejagnu-weekly-CVS-20021206.tar.bz2

The first snapshot is from the 5.3 branch and will become gdb 5.3 soon
if everything goes well.  I am regression testing this right now versus
5.2.1 and there are no big obvious problems yet.

The second snapshot is from the CVS head.  It's more likely to have the
bug fix that Daniel J is referring to.  It's also possible that it has
build problems because the configuration+build machinery is in active
development right now.  If it builds, though, it is also in good shape
for gcc v3 dwarf-2 debugging.

You are on the right track with gcc 3.2.1 and -gdwarf-2.

I recommend you try the "branch" snapshot first; it is much more stable.
If it is not featureful enough (does not fix your problems) then try
the "current" snapshot.

Hope this helps,

Michael C

P. S. I see you are at columbia.edu.  I am on Staten Island.  Isn't
the city beautiful with today's snow?


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

end of thread, other threads:[~2002-12-06  6:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-05 20:07 help: gdb and c++ strings Murad Nayal
2002-12-05 20:15 ` Daniel Jacobowitz
2002-12-05 20:23   ` Murad Nayal
2002-12-05 20:45 Michael Elizabeth Chastain
2002-12-05 22:25 ` Murad Nayal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox