]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: make value::allocate_register_lazy store id of next non-inline frame
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 21 Dec 2023 16:51:38 +0000 (16:51 +0000)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sun, 24 Dec 2023 16:16:58 +0000 (11:16 -0500)
commit32a5d479d2325545ad5829b7716ad962db3b323c
treef0bd3f2ac909396be8d4c007ffd63d8784b90cfc
parent78f2fd84e832c49a496ab712512be058c0c2912b
gdb: make value::allocate_register_lazy store id of next non-inline frame

Some spots loop on the frame chain to find the first next non-inline
frame, and pass that as the "next frame" to
value::allocate_register_lazy / value::allocate_register.  This is
necessary if the value is used in the process of computing the id of
"this frame".  If the frame next to "this frame" is inlined into "this
frame", then you that next frame won't have a computed id yet.  You have
to go past that to find the next non-inline frame, which will have a
computed id.

In other cases, it's fine to store the id of an inline frame as the
"next frame id" in a register struct value.  When trying to unwind a
register from it, it will just call inline_frame_prev_register, which
will forward the request to the next next frame, until we hit the next
physical frame.

I think it would make things simpler to just never store the id of an
inline frame as the next frame id of register struct values, and go with
the first next non-inline frame directly.  This way, we don't have to
wonder which code paths have to skip inline frames when creating
register values and which don't.

So, change value::allocate_register_lazy to do that work, and remove the
loops for the callers that did it.

Change-Id: Ic88115dac49dc14e3053c95f92050062b24b7310
gdb/findvar.c
gdb/rs6000-tdep.c
gdb/value.c
gdb/value.h