aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorHannes Domani <ssbssa@yahoo.de>2020-12-18 18:23:41 +0100
committerHannes Domani <ssbssa@yahoo.de>2021-02-07 19:08:23 +0100
commit83962f8340726373e0d174dcf688818eb7faea6b (patch)
tree78a229831c029e1721224978f48066bf1515a308 /gdb/python
parentde8d4203109ae04c05a716c1afb2d5a487e9b1fe (diff)
downloadgdb-83962f8340726373e0d174dcf688818eb7faea6b.zip
gdb-83962f8340726373e0d174dcf688818eb7faea6b.tar.gz
gdb-83962f8340726373e0d174dcf688818eb7faea6b.tar.bz2
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.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-frame.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index 5c02754..8e32ba5 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;