This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
Re: Can't debug x86_64 C++ programs.
I really appreciate all the time you've spent helping me, especially as
it is getting more and more likely that something is wrong with the
environment in which I compiled Insight, rather than with Insight's
source code.
But I still don't know how to find out what was wrong.
Keith Seitz wrote:
setup_architecture_data is called twice, once on startup (in which
case the architecture is i386 w/50 registers) and then once after
"file" command is issued (when the arch changes to i386:x86_64 w/58
registers) -- at least it is in my copy. You might be seeing an old bug?
I have the lines you quoted in insight-6.8\gdb\gdbtk\ChangeLog-2007. I
don't know how to be certain I have the correction that goes with it.
But in regwin.itb, in RegWin::arch_changed it does call gdb_reg_arch_changed
However, I am quite sure:
1) setup_architecture_data is called only once (directly from
Gdbtk_Register_Init)
2) (Before my kludge to allocate excess memory in
setup_architecture_data) regformat did overflow corrupting regtype
I'm still not sure I understand how the call to setup_architecture_data
when the architecture changes is supposed to occur.
Much to my surprise, debugging the broken Insight inside the broken
Insight is moderately practical, so ...
I set a breakpoint inside architecture_changed_event (in gdb-events.c)
on the line
if (!current_event_hooks->architecture_changed)
and I verified that current_event_hooks->architecture_changed is equal
to zero, so architecture_changed_event does nothing.
I expect that is where the second call to setup_architecture_data is
supposed to happen, so current_event_hooks->architecture_changed is not
supposed to be zero, so now I have to search/guess for the code that is
supposed to set current_event_hooks->architecture_changed to something
nonzero.
Can you confirm that current_event_hooks->architecture_changed is
supposed to be nonzero at that point and would be the path to
setup_architecture_data if it were working?