🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Michael Elizabeth Chastain Sun, 26 May 2002 23:40
Re: c++ strings with gdb??
#1997
Author: Michael Elizabeth Chastain
Date: Sun, 26 May 2002 23:40
21 lines
1569 bytes
Hi Eric,

> I have tried the examine the memory. I got '<' when using "x/c
> 0x24340" but got "<A HREF=\"http:/" when using "x/s 0x24340".

Okay.  Now try "x/c 0x24341", "x/c 0x24342", and so on.
Or you can just hit the carriage return after the first one.

> I tried to use "cout" and "cerr" to print the content(s) of "substring"
> and I got expected '<'.

That's dicey, it doesn't work for me even with gdb 5.2.
Maybe someday it will.  :-/

> I suspect the string does not end with null char. So, gdb overshots
> when it tries to print out the contents of the string.

That's likely.  You'll have to look at the header file for the string
class and figure out the data representation.

Michael C
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads