From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Paul N. Hilfinger" To: cagney@cygnus.com, gdb-patches@sources.redhat.com Subject: Advice needed on fix to heuristic_proc_desc in mips-tdep.c Date: Mon, 26 Feb 2001 04:17:00 -0000 Message-id: <200102261216.EAA16281@localhost.localdomain> X-SW-Source: 2001-02/msg00464.html 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