Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix assertion fi->level
@ 2020-01-18 23:04 Mark Williams
  2020-01-19 17:27 ` Mark Williams
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Williams @ 2020-01-18 23:04 UTC (permalink / raw)
  To: gdb-patches

[-- 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-09 18:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-18 23:04 [PATCH] Fix assertion fi->level Mark Williams
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox