This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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: [RFC] Is skip_prologue_using_sal actually usable?


   Date: Tue, 09 Nov 2004 09:50:27 -0500
   From: Andrew Cagney <cagney@gnu.org>

   Mark,

   DWARF 2 provides us with the exact location[s] of a prologue end, can we 
   use that?

DW_LNS_set_prologue_end is a DWARF3 thingy, which GCC doesn't generate
yet.  The DWARF3 definition seems to match exactly what I have in mind
though.

   skip_prologue, just like the traditional unwinder, only has to be ``good 
   enough''.

The problem here is that we as devlopers don't seem to agree on what
we mean by "good enough".  As a result, the implementations in GDB
vary wildly throughout GDB.

The concrete problem I'm facing here is that skip_prologue_using_sal
as used by mips-tdep.c doesn't work for me on OpenBSD/mips64.  It can
be fixed by applying the patch in the message that started this
thread, but if an implementation only has to be "good enough", I think
skip_prologue_using_sal is actually doing to much.  Something like the
following code would be better:

static CORE_ADDR
sparc32_skip_prologue (CORE_ADDR start_pc)
{
  struct symtab_and_line sal;
  CORE_ADDR func_start, func_end;
  struct sparc_frame_cache cache;

  /* This is the preferred method, find the end of the prologue by
     using the debugging information.  */
  if (find_pc_partial_function (start_pc, NULL, &func_start, &func_end))
    {
      sal = find_pc_line (func_start, 0);

      if (sal.end < func_end
	  && start_pc <= sal.end)
	return sal.end;
    }

  return sparc_analyze_prologue (start_pc, 0xffffffffUL, &cache);
}

Mark


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