* [PING^2] [PATCH] Also compare frame_id_is_next in frapy_richcompare
[not found] <1047212246.240973.1610206562548.ref@mail.yahoo.com>
@ 2021-01-09 15:36 ` Hannes Domani
0 siblings, 0 replies; only message in thread
From: Hannes Domani @ 2021-01-09 15:36 UTC (permalink / raw)
To: gdb-patches
Ping.
Am Samstag, 2. Januar 2021, 14:19:07 MEZ hat Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> Folgendes geschrieben:
> Ping.
>
>
> Am Freitag, 18. Dezember 2020, 18:25:41 MEZ hat Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> Folgendes geschrieben:
>
> > The last frame in a corrupt stack stores the frame_id of the next frame,
> > so these two frames currently compare as equal.
> >
> > So if you have a backtrace where the oldest frame is corrupt, this happens:
> >
> > (gdb) py
> > >f = gdb.selected_frame()
> > >while f.older():
> > > f = f.older()
> > >print(f == f.newer())
> > >end
> > True
> >
> > With this change, that same example returns False.
> >
> > gdb/ChangeLog:
> >
> > 2020-12-18 Hannes Domani <ssbssa@yahoo.de>
> >
> > * python/py-frame.c (frapy_richcompare): Compare frame_id_is_next.
> > ---
> > gdb/python/py-frame.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
> > index 6b2b29d786..f3086f4bd2 100644
> > --- a/gdb/python/py-frame.c
> > +++ b/gdb/python/py-frame.c
> > @@ -658,8 +658,11 @@ frapy_richcompare (PyObject *self, PyObject *other, int op)
> > return Py_NotImplemented;
> > }
> >
> > - if (frame_id_eq (((frame_object *) self)->frame_id,
> > - ((frame_object *) other)->frame_id))
> > + frame_object *self_frame = (frame_object *) self;
> > + frame_object *other_frame = (frame_object *) other;
> > +
> > + if (self_frame->frame_id_is_next == other_frame->frame_id_is_next
> > + && frame_id_eq (self_frame->frame_id, other_frame->frame_id))
> > result = Py_EQ;
> > else
> > result = Py_NE;
> > --
> > 2.29.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-09 15:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1047212246.240973.1610206562548.ref@mail.yahoo.com>
2021-01-09 15:36 ` [PING^2] [PATCH] Also compare frame_id_is_next in frapy_richcompare Hannes Domani
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).