This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
pending/1561: gdb 2004-02-20-cvs solaris fails to build "this" properly
- From: "Robert R. Henry" <rrh at cray dot com>
- To: gdb-gnats at sources dot redhat dot com
- Date: Fri, 20 Feb 2004 15:03:57 -0800 (PST)
- Subject: pending/1561: gdb 2004-02-20-cvs solaris fails to build "this" properly
>Number: 1561
>Category: pending
>Synopsis: gdb 2004-02-20-cvs solaris fails to build "this" properly
>Confidential: yes
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: unknown
>Arrival-Date: Mon Feb 23 16:08:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:
>Release:
>Organization:
>Environment:
>Description:
This describes a problem with gdb evaluating function member function calls
from the "print" command.
The gdb I'm using was built from the sourceforge cvs checkout
2004-02-20-cvs, with gdb configured using
./configure --host=sparc64-sun-solaris2.8
as built with gcc 3.2.2.
Consider the program shown at the bottom. That program is compiled
using g++ 3.2.2 -g.
If I use the buggy gdb to put a breakpoint on the line "p->dump()",
and then do:
(gdb) print p
$1 = 0x20be0
and then use the print command to evaluate a call to p->dump()
(gdb) print p->dump()
it appears as if the formal parameter "this" in Thing::dump
is initialized with a bogus actual parameter (0 in this case,
but I've seen 1 in my real application)
Program received signal SIGSEGV, Segmentation fault.
0x0001084c in Thing::dump (this=0x0) at x.cc:20
20 printf("a=%d\n", a);
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (Thing::dump()) will be abandoned.
#include <stdio.h>
class Thing {
private:
int a;
int b;
public:
Thing(void);
~Thing(void);
void dump(void);
};
typedef Thing * ThingP;
int main(void)
{
ThingP p = new Thing();
p->dump();
return 0;
}
void Thing::dump(void)
{
printf("a=%d\n", a);
printf("b=%d\n", b);
}
Thing::Thing(void)
{
a = 0;
b = 0;
}
Thing::~Thing(void)
{
}
_______________________________________________
Bug-gdb mailing list
Bug-gdb@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gdb
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: