Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@gnu.org>
To: cagney@gnu.org
Cc: gdb@sources.redhat.com
Subject: Re: [RFC] Is skip_prologue_using_sal actually usable?
Date: Tue, 09 Nov 2004 16:07:00 -0000	[thread overview]
Message-ID: <200411091605.iA9G5WdZ091107@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <4190D933.5070006@gnu.org> (message from Andrew Cagney on Tue, 09 Nov 2004 09:50:27 -0500)

   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


  reply	other threads:[~2004-11-09 16:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-07 14:28 Mark Kettenis
2004-11-09  2:43 ` Randolph Chung
2004-11-09 10:16 ` Daniel Jacobowitz
2004-11-09 14:35   ` Mark Kettenis
2004-11-09 14:51     ` Daniel Jacobowitz
2004-11-09 14:56 ` Andrew Cagney
2004-11-09 16:07   ` Mark Kettenis [this message]
2004-11-09 16:55   ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200411091605.iA9G5WdZ091107@elgar.sibelius.xs4all.nl \
    --to=kettenis@gnu.org \
    --cc=cagney@gnu.org \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox