This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Advice needed on fix to heuristic_proc_desc in mips-tdep.c
- To: cagney at cygnus dot com, gdb-patches at sources dot redhat dot com
- Subject: Advice needed on fix to heuristic_proc_desc in mips-tdep.c
- From: "Paul N. Hilfinger" <hilfingr at otisco dot mckusick dot com>
- Date: Mon, 26 Feb 2001 04:16:50 -0800
- Reply-to: Hilfinger at syracuse dot mckusick dot com
I have developed a patch for an obscure problem I've encountered in
MIPS code (specifically on IRIX). Consider a source file containing
void global_f (...) {
...
}
static void local_f (...) {
...
}
and suppose that this file has been compiled with no debugging
information (as in the implementations of many standard libraries).
Consider what happens when someone stepi's into or seg faults in
local_f (I did say "obscure", did I not?). Basically,
non_heuristic_proc_desc fails, but finds the start of the nearest
preceding global function, global_f. heuristic_proc_desc then starts
looking through the prologue of global_f, and generally gets terribly
confused.
Now, I am experimenting with an obvious but kludgy patch: rather than
blindly accept non_heuristic_proc_desc's guess as to the beginning of
the enclosing function, I use it as a limit for looking backwards from
the current pc in the same fashion as heuristic_proc_start. That way,
I find the beginning of local_f, and use that (correctly) as the beginning
of the current function.
I know: debugging in code without debugging symbols is probably
inherently kludgy. Even considering that, though, I am a bit
uncomfortable with my current solution.
So: comments, anyone?
Paul Hilfinger
Ada Core Technologies