This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
Re: Can't debug x86_64 C++ programs.
- From: John Fine <johnsfine at verizon dot net>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: insight at sourceware dot org
- Date: Wed, 17 Sep 2008 12:20:58 -0400
- Subject: Re: Can't debug x86_64 C++ programs.
- References: <48D024D1.3000107@verizon.net> <48D0A482.8060000@redhat.com>
Keith Seitz wrote:
If I try to view the registers window anytime after pressing Run, the
whole debugger crashes. If I view the register window first, it
appears, then when I press run it populates, then a moment later the
whole debugger crashes.
Once again, I am sorry, but I cannot reproduce this (on x86).
Can you give me an expert opinion on these lines of code in gdbtk-register.c
regformat = (int *)xcalloc (numregs, sizeof(int));
regtype = (struct type **)xcalloc (numregs, sizeof(struct type **));
especially that sizeof(int)
I know that whatever object lies directly in physical ram before the
allocation of regtype has overflowed and corrupted regtype.
I think the above allocations happen early enough in initialization that
they would sequentially grab new memory (rather than reuse chunks that
would tend to be distant from each other).
So (barely more than guess) I think regformat is the object using more
memory than was allocated for it and overflowing into regtype.