* [PING^4] [PATCH] Also compare frame_id_is_next in frapy_richcompare [not found] <648862269.5845140.1612016162852.ref@mail.yahoo.com> @ 2021-01-30 14:16 ` Hannes Domani 2021-02-06 22:38 ` Tom Tromey 0 siblings, 1 reply; 5+ messages in thread From: Hannes Domani @ 2021-01-30 14:16 UTC (permalink / raw) To: gdb-patches Ping. Am Donnerstag, 21. Januar 2021, 19:07:33 MEZ hat Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> Folgendes geschrieben: > Ping. > > > Am Samstag, 9. Januar 2021, 16:36:13 MEZ hat Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> Folgendes geschrieben: > > > 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] 5+ messages in thread
* Re: [PING^4] [PATCH] Also compare frame_id_is_next in frapy_richcompare 2021-01-30 14:16 ` [PING^4] [PATCH] Also compare frame_id_is_next in frapy_richcompare Hannes Domani @ 2021-02-06 22:38 ` Tom Tromey 2021-02-06 22:41 ` Hannes Domani 0 siblings, 1 reply; 5+ messages in thread From: Tom Tromey @ 2021-02-06 22:38 UTC (permalink / raw) To: Hannes Domani via Gdb-patches >> > > > 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. This seems reasonable, but is it possible to add a test case for it? Tom ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PING^4] [PATCH] Also compare frame_id_is_next in frapy_richcompare 2021-02-06 22:38 ` Tom Tromey @ 2021-02-06 22:41 ` Hannes Domani 2021-02-07 14:22 ` Tom Tromey 0 siblings, 1 reply; 5+ messages in thread From: Hannes Domani @ 2021-02-06 22:41 UTC (permalink / raw) To: Hannes Domani via Gdb-patches, Tom Tromey Am Samstag, 6. Februar 2021, 23:38:18 MEZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben: > >> > > > 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. > > > This seems reasonable, but is it possible to add a test case for it? I thought about it, but I couldn't figure out how to intentionally create a corrupt frame. Hannes ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PING^4] [PATCH] Also compare frame_id_is_next in frapy_richcompare 2021-02-06 22:41 ` Hannes Domani @ 2021-02-07 14:22 ` Tom Tromey 2021-02-07 18:17 ` Hannes Domani 0 siblings, 1 reply; 5+ messages in thread From: Tom Tromey @ 2021-02-07 14:22 UTC (permalink / raw) To: Hannes Domani via Gdb-patches; +Cc: Tom Tromey, Hannes Domani >>>>> "Hannes" == Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> writes: Hannes> Am Samstag, 6. Februar 2021, 23:38:18 MEZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben: >> >> > > > 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. >> >> >> This seems reasonable, but is it possible to add a test case for it? Hannes> I thought about it, but I couldn't figure out how to intentionally create Hannes> a corrupt frame. Yeah, that makes sense. The patch is ok. Thank you. Tom ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PING^4] [PATCH] Also compare frame_id_is_next in frapy_richcompare 2021-02-07 14:22 ` Tom Tromey @ 2021-02-07 18:17 ` Hannes Domani 0 siblings, 0 replies; 5+ messages in thread From: Hannes Domani @ 2021-02-07 18:17 UTC (permalink / raw) To: Hannes Domani via Gdb-patches, Tom Tromey Am Sonntag, 7. Februar 2021, 15:22:48 MEZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben: > >>>>> "Hannes" == Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> writes: > > Hannes> Am Samstag, 6. Februar 2021, 23:38:18 MEZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben: > >> >> > > > 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. > >> > >> > >> This seems reasonable, but is it possible to add a test case for it? > > Hannes> I thought about it, but I couldn't figure out how to intentionally create > Hannes> a corrupt frame. > > Yeah, that makes sense. The patch is ok. Thank you. Pushed, thanks. Hannes ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-02-07 18:17 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <648862269.5845140.1612016162852.ref@mail.yahoo.com> 2021-01-30 14:16 ` [PING^4] [PATCH] Also compare frame_id_is_next in frapy_richcompare Hannes Domani 2021-02-06 22:38 ` Tom Tromey 2021-02-06 22:41 ` Hannes Domani 2021-02-07 14:22 ` Tom Tromey 2021-02-07 18:17 ` 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).