Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Mark Kettenis <kettenis@chello.nl>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [i386newframe/PATCH] New i386newframe branch
Date: Tue, 29 Apr 2003 01:50:00 -0000	[thread overview]
Message-ID: <3EADA9AC.8030607@redhat.com> (raw)
In-Reply-To: <200304191651.h3JGp1Kr004648@elgar.kettenis.dyndns.org>

(thanks for eliminating the code cache!).

> +static int
> +i386_frameless_function_invocation (struct frame_info *frame)
>  {

I'd consider deleting it.

For non legacy architectures, apart from appending "(FRAMELESS)" to the 
output of "info frame", that architecture method does nothing useful 
(and even this is marginal :-).  I think a per frame 
PRINT_EXTRA_FRAME_INFO like function would be more useful. 
Alternatively, a per-frame ``frameless'' attribute could be added.

Have you tried adding just this:

> +/* Signal trampolines.  */
> +
> +static struct i386_frame_cache *
> +i386_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache)
> +{
> +  struct i386_frame_cache *cache;
> +  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
> +  CORE_ADDR addr;
> +  char buf[4];
> +
> +  if (*this_cache)
> +    return *this_cache;
> +
> +  cache = i386_alloc_frame_cache ();
> +
> +  frame_unwind_register (next_frame, I386_ESP_REGNUM, buf);
> +  cache->base = extract_address (buf, 4) - 4;
> +
> +  addr = tdep->sigcontext_addr (next_frame);
> +  cache->saved_regs[I386_EIP_REGNUM] = addr + tdep->sc_pc_offset;
> +  cache->saved_regs[I386_ESP_REGNUM] = addr + tdep->sc_sp_offset;
> +
> +  *this_cache = cache;
> +  return cache;
>  }
>  
>  static void
> -i386_pop_frame (void)
> +i386_sigtramp_frame_this_id (struct frame_info *next_frame, void **this_cache,
> +			     struct frame_id *this_id)
>  {
> -  generic_pop_current_frame (i386_do_pop_frame);
> +  struct i386_frame_cache *cache =
> +    i386_sigtramp_frame_cache (next_frame, this_cache);
> +
> +  (*this_id) = frame_id_build (cache->base, frame_pc_unwind (next_frame));
> +}
> +
> +static void
> +i386_sigtramp_frame_prev_register (struct frame_info *next_frame,
> +				   void **this_cache,
> +				   int regnum, int *optimizedp,
> +				   enum lval_type *lvalp, CORE_ADDR *addrp,
> +				   int *realnump, void *valuep)
> +{
> +  /* Make sure we've initialized the cache.  */
> +  i386_sigtramp_frame_cache (next_frame, this_cache);
> +
> +  i386_frame_prev_register (next_frame, this_cache, regnum,
> +			    optimizedp, lvalp, addrp, realnump, valuep);
> +}
> +
> +static const struct frame_unwind i386_sigtramp_frame_unwind =
> +{
> +  SIGTRAMP_FRAME,
> +  i386_sigtramp_frame_this_id,
> +  i386_sigtramp_frame_prev_register
> +};
> +\f
> +
> +const struct frame_unwind *
> +i386_frame_p (CORE_ADDR pc)
> +{
> +  char *name;
> +
> +  find_pc_partial_function (pc, &name, NULL, NULL);
> +  if (PC_IN_SIGTRAMP (pc, name))
> +    return &i386_sigtramp_frame_unwind;

The intent was for there to be one predicate function per unwinder.  So 
the below would be in a separate unwinder, registered separatly.

> +  return &i386_frame_unwind;
> +}

Have you tried adding just the sigtramp unwinder?  I should get just 
that addition debugged regardless - it should make migrating other ISAs 
easier.

Andrew



  reply	other threads:[~2003-04-28 22:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-19 16:51 Mark Kettenis
2003-04-29  1:50 ` Andrew Cagney [this message]
2003-05-01 20:54   ` Mark Kettenis
2003-05-01 21:21     ` Andrew Cagney
2003-05-02  9:29       ` Mark Kettenis
2003-05-03 19:36         ` Andrew Cagney
2003-05-03 20:53           ` Mark Kettenis
2003-05-03 22:27             ` Daniel Jacobowitz
2003-05-04  0:28               ` Andrew Cagney

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=3EADA9AC.8030607@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@chello.nl \
    /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