Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: Mark Kettenis <kettenis@chello.nl>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Remove zero PC check from blockframe.c:inside_main_func()
Date: Sat, 13 Dec 2003 19:02:00 -0000	[thread overview]
Message-ID: <3FDB6232.5040102@gnu.org> (raw)
In-Reply-To: <200312131509.hBDF9TLA035995@elgar.kettenis.dyndns.org>

> It really makes no sense to check for a zero PC here.  This function
> is only colled from frame.c:get_prev_frame(), and there we already
> deal with PC being zero.
> 
> The whole concept of using a zero PC as a marker for the end of the
> frame chain is somewhat flawed.  It prevents us from providing a
> meaningful backtrace when the program has called a null function
> pointer; see backtrace/1476.  At the very least we will have to treat
> a zero PC in the innermost differently.  Classifying the a zero PC as
> being inside the "main" function doesn't help.  Therefore this patch
> removes the first obstackle in fixing that PR.
> 
> Objections.  Otherwise I'll commit this within a few days.

FYI, this was made active with:

         * blockframe.c: Include "gdbcmd.h" and "command.h".
         (backtrace_below_main): New variable.
         (file_frame_chain_valid, func_frame_chain_valid)
         (nonnull_frame_chain_valid, generic_file_frame_chain_valid)
         (generic_func_frame_chain_valid): Remove functions.
         (frame_chain_valid, do_flush_frames_sfunc): New functions.
         (_initialize_blockframe): New function.
         * Makefile.in (blockframe.o): Update dependencies.
         * frame.c (frame_saved_regs_id_unwind, get_prev_frame): Remove 
FIXME
         comment.  Call frame_chain_valid ().
         * frame.h: Remove old prototypes.  Add prototype for
         frame_chain_valid and update comments to match.
         * gdbarch.sh: Change FRAME_CHAIN_VALID into a predicated function.
         Remove old comment.
         * gdbarch.h: Regenerated.
         * gdbarch.c: Regenerated.

rather than the new frame code.

I looked at the new frame code and apart from the wild-card logic, there 
weren't any obvious PC==0 tests.

Andrew



  reply	other threads:[~2003-12-13 19:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-13 15:09 Mark Kettenis
2003-12-13 19:02 ` Andrew Cagney [this message]
2003-12-13 22:07   ` Mark Kettenis
2003-12-14  0:23     ` Andrew Cagney
2003-12-14 18:22       ` Mark Kettenis
2003-12-31 19:58         ` Andrew Cagney
2003-12-21 21:20 ` Mark Kettenis

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=3FDB6232.5040102@gnu.org \
    --to=cagney@gnu.org \
    --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