[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-bugs
Subject:    bin/59551: Problem with GDB on latest -CURRENT
From:       Vladimir Grebenschikov <vova () sw ! ru>
Date:       2003-11-21 14:39:56
[Download RAW message or body]


> Number:         59551
> Category:       bin
> Synopsis:       Problem with GDB on latest -CURRENT
> Confidential:   no
> Severity:       non-critical
> Priority:       medium
> Responsible:    freebsd-bugs
> State:          open
> Quarter:        
> Keywords:       
> Date-Required:
> Class:          sw-bug
> Submitter-Id:   current-users
> Arrival-Date:   Fri Nov 21 06:40:15 PST 2003
> Closed-Date:
> Last-Modified:
> Originator:     Vladimir Grebenschikov
> Release:        FreeBSD 5.1-CURRENT i386
> Organization:
SWsoft
> Environment:
System: FreeBSD vbook.fbsd.ru 5.1-CURRENT FreeBSD 5.1-CURRENT #2: Mon Nov 17 08:10:40 \
MSK 2003 root@walder.asplinux.ru:/ext/obj/ext/current/src/sys/VBOOK i386

% g++ -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.3.3 [FreeBSD] 20031106
% gdb -v
GNU gdb 5.2.1 (FreeBSD)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-undermydesk-freebsd".

> Description:

FreeBSD gdb fails to show some valid C++ objects

> How-To-Repeat:

% cat str.cpp
#include <string>

using namespace std;

class a
{
public:  string x;
};

int main()
{
  a s;
  s.x = "Test1";
  return 0;
}
% g++ -g -o str str.cpp
%  gdb str
GNU gdb 5.2.1 (FreeBSD)
...
(gdb) b main
Breakpoint 1 at 0x8048665: file str.cpp, line 12.
(gdb) r
Starting program:
/usr/local/home/vova/str 

Breakpoint 1, main () at str.cpp:12
12        a s;
(gdb) n
13        s.x = "Test1";
(gdb) p a
Attempt to use a type name as an expression
(gdb) p s
$1 = {x = {static npos = Error accessing memory address 0x83c451c: Bad address.
(gdb)

> Fix:

gdb53 from ports works as expected:

% gdbada str
GNU gdb 5.3 (FreeBSD)
...
This GDB was configured as "i386-portbld-freebsd5.1"...
(gdb) b main
Breakpoint 1 at 0x8048665: file str.cpp, line 12.
(gdb) r
Starting program:
/usr/local/home/vova/str 

Breakpoint 1, main () at str.cpp:12
12        a s;
(gdb) n
13        s.x = "Test1";
(gdb) p s
$1 = {x = {static npos = 4294967295, _M_dataplus = {<allocator<char>> = {<No
data fields>}, _M_p = 0x281326b8 ""}, static _S_empty_rep_storage = {0, 
      0, 1, 0}}}
(gdb) 

PS:
 Another question, why gdb53-ada present in packages directory as
   ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-current/Latest/gdb.tbz
> Release-Note:
> Audit-Trail:
> Unformatted:
_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic