This is the mail archive of the insight@sourceware.org mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can't debug x86_64 C++ programs.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]