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.


John Fine wrote:
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)

The file global regformat simply holds a bunch of ints which are passed to gdb to specify the output format for the register -- one per register.


So (barely more than guess) I think regformat is the object using more memory than was allocated for it and overflowing into regtype.

That sounds like a plausible explanation. You might try to see if numregs is changing or if the register number is greater than the amount that has been allocated.


It shouldn't, but who knows. There has been a fair amount of churn in this area in gdb over the last year.

Keith


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