Also compare frame_id_is_next in frapy_richcompare
authorHannes Domani <ssbssa@yahoo.de>
Fri, 18 Dec 2020 17:23:41 +0000 (18:23 +0100)
committerHannes Domani <ssbssa@yahoo.de>
Sun, 7 Feb 2021 18:08:23 +0000 (19:08 +0100)
commit83962f8340726373e0d174dcf688818eb7faea6b
tree78a229831c029e1721224978f48066bf1515a308
parentde8d4203109ae04c05a716c1afb2d5a487e9b1fe
Also compare frame_id_is_next in frapy_richcompare

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:

2021-02-07  Hannes Domani  <ssbssa@yahoo.de>

* python/py-frame.c (frapy_richcompare): Compare frame_id_is_next.
gdb/ChangeLog
gdb/python/py-frame.c