Remove dead code from py-finishbreakpoint.c
authorTom Tromey <tom@tromey.com>
Sun, 5 Jun 2022 16:22:40 +0000 (10:22 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 18 Oct 2022 16:31:36 +0000 (10:31 -0600)
PR python/16324 points out that comparing a frame id to null_frame_id
can never succeed, and proposes simply removing the dead code.  That
is what this patch does.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16324

gdb/python/py-finishbreakpoint.c

index 1d25cca5c17fd5436892dfeeb550faa337104373..0255bd1fead3a046302d914d7d75443c52d7961f 100644 (file)
@@ -205,12 +205,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
                                 "be set on a dummy frame."));
            }
          else
-           {
-             frame_id = get_frame_id (prev_frame);
-             if (frame_id == null_frame_id)
-               PyErr_SetString (PyExc_ValueError,
-                                _("Invalid ID for the `frame' object."));
-           }
+           frame_id = get_frame_id (prev_frame);
        }
     }
   catch (const gdb_exception &except)