public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "palves at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/18074] crash using "info frame"
Date: Tue, 03 Mar 2015 15:04:00 -0000	[thread overview]
Message-ID: <bug-18074-4717-8lUqcDO7l2@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-18074-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=18074

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |palves at redhat dot com

--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
Man, we _still_ haven't fixed this...  :-/

"frame ADDR" / "info frame ADDR" are very broken at several levels, IMO.  Even
though in your case, you explicitly wanted a frame at an address, the fact that
the user can typo a frame number and GDB ends up creating a new frame on the
spot is quite misleading.  It should be an explicit switch for "create frame if
you can't find it in the frame frame", IMO:

  https://sourceware.org/ml/gdb/2014-11/msg00028.html

In addition, I think I'd expect "bt" after "frame ADDR" to attempt to
backtracing starting at that created frame.

The crash in this case is a different bogosity: parse_frame_specification at
the tail end creates the new frame, but "current_frame" is not set to point at
it.  So, here:

3808          while (VALUE_LVAL (new_val) == lval_register && value_lazy
(new_val))
3809            {
3810              struct frame_id frame_id = VALUE_FRAME_ID (new_val);
3811
3812              frame = frame_find_by_id (frame_id);
3813              regnum = VALUE_REGNUM (new_val);

This looks up that frame that was created for ADDR in the frame chain, starting
at current_frame, and of course that never finds that hacked up frame...

Maybe parse_frame_specification should override current_frame.  But it isn't
that simple: we also need to handle the cases where gdb switches thread/frame
behind the user's back temporarily, and then restores them
(do_restore_current_thread_cleanup / restore_selected_frame use), in which case
we'd need to restore that cooked up frame.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


  reply	other threads:[~2015-03-02 22:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 21:24 [Bug gdb/18074] New: " tromey at sourceware dot org
2015-03-03 15:04 ` palves at redhat dot com [this message]
2015-03-03 16:21 ` [Bug gdb/18074] " tromey at sourceware dot org
2015-03-19 11:08 ` scwuaptx at gmail dot com
2015-03-19 15:52 ` tromey at sourceware dot org

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=bug-18074-4717-8lUqcDO7l2@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).