Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Williams <mark@myosotissp.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Fix assertion fi->level
Date: Sat, 18 Jan 2020 23:04:00 -0000	[thread overview]
Message-ID: <CAN0QdPVcg7_tewDDRXU+1cRJZqQvA4yG7y4i4rZjXbCmpMjXww@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

This is a fix for https://sourceware.org/bugzilla/show_bug.cgi?id=22748.

It avoids calling value_of_register_lazy, since that requires a frame
id, and there may not be one yet for inlined frames.

Mark

[-- Attachment #2: 0001-gdb-Fix-Assertion-fi-level-0-failed.patch --]
[-- Type: application/octet-stream, Size: 1610 bytes --]

From 28221e7158acb4b3129e57fcb8bbf262b8d4ab3d Mon Sep 17 00:00:00 2001
From: mwilliams <mwilliams@fb.com>
Date: Tue, 7 Jan 2020 07:02:31 -0800
Subject: [PATCH] gdb: Fix "Assertion 'fi->level == 0' failed."

At the point that python unwinders are called, to determine if they
want to handle a frame, calling value_of_register_lazy can fail
because the next frame's id has not yet been computed (if its inline).

Rather than calling value_of_register_lazy, then immediately calling
value_fetch_lazy, just call get_frame_register_value directly.

gdb/Changelog
2020-01-18 Mark Williams <mark@myosotissp.com>

	PR gdb/22748
	* findvar.c call get_frame_register_value instead of
	value_of_register_lazy/value_fetch_lazy so it works
	without a frame id.
---
 gdb/findvar.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gdb/findvar.c b/gdb/findvar.c
index 5cf1cd4137..0cddebc12b 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -263,16 +263,13 @@ struct value *
 value_of_register (int regnum, struct frame_info *frame)
 {
   struct gdbarch *gdbarch = get_frame_arch (frame);
-  struct value *reg_val;
 
   /* User registers lie completely outside of the range of normal
      registers.  Catch them early so that the target never sees them.  */
   if (regnum >= gdbarch_num_cooked_regs (gdbarch))
     return value_of_user_reg (regnum, frame);
 
-  reg_val = value_of_register_lazy (frame, regnum);
-  value_fetch_lazy (reg_val);
-  return reg_val;
+  return get_frame_register_value (frame, regnum);
 }
 
 /* Return a `value' with the contents of (virtual or cooked) register
-- 
2.17.1


             reply	other threads:[~2020-01-18 18:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-18 23:04 Mark Williams [this message]
2020-01-19 17:27 ` Mark Williams
2020-02-03  3:05   ` Mark Williams
2020-02-07 21:04     ` Tom Tromey
2020-02-07 21:09       ` Mark Williams
2020-02-09 18:57         ` Mark Williams

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=CAN0QdPVcg7_tewDDRXU+1cRJZqQvA4yG7y4i4rZjXbCmpMjXww@mail.gmail.com \
    --to=mark@myosotissp.com \
    --cc=gdb-patches@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