From: simon.marchi@polymtl.ca
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH] gdb/python: remove some unreachable Py_RETURN_NONE
Date: Fri, 20 Feb 2026 21:40:54 -0500 [thread overview]
Message-ID: <20260221024058.2573546-1-simon.marchi@polymtl.ca> (raw)
From: Simon Marchi <simon.marchi@polymtl.ca>
They are unreachable because there is a return statement in all possible code
paths before.
Change-Id: I9db2f41f8017380c0c79f97af9bbf8734038ba9a
---
gdb/python/py-frame.c | 4 ----
gdb/python/py-objfile.c | 4 ----
gdb/python/py-unwind.c | 2 --
3 files changed, 10 deletions(-)
diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index ab7883b4e73b..99a902f76684 100644
--- a/gdb/python/py-frame.c
+++ b/gdb/python/py-frame.c
@@ -611,8 +611,6 @@ frapy_level (PyObject *self, PyObject *args)
{
return gdbpy_handle_gdb_exception (nullptr, except);
}
-
- Py_RETURN_NONE;
}
/* The language for this frame. */
@@ -634,8 +632,6 @@ frapy_language (PyObject *self, PyObject *args)
{
return gdbpy_handle_gdb_exception (nullptr, except);
}
-
- Py_RETURN_NONE;
}
/* The static link for this frame. */
diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
index 36acdb06a25c..ed9f4d6bd968 100644
--- a/gdb/python/py-objfile.c
+++ b/gdb/python/py-objfile.c
@@ -483,8 +483,6 @@ objfpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
{
return gdbpy_handle_gdb_exception (nullptr, except);
}
-
- Py_RETURN_NONE;
}
/* Implementation of
@@ -518,8 +516,6 @@ objfpy_lookup_static_symbol (PyObject *self, PyObject *args, PyObject *kw)
{
return gdbpy_handle_gdb_exception (nullptr, except);
}
-
- Py_RETURN_NONE;
}
/* Implement repr() for gdb.Objfile. */
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c
index d4c35e17f145..36ebf97be06b 100644
--- a/gdb/python/py-unwind.c
+++ b/gdb/python/py-unwind.c
@@ -599,8 +599,6 @@ pending_framepy_language (PyObject *self, PyObject *args)
{
return gdbpy_handle_gdb_exception (nullptr, except);
}
-
- Py_RETURN_NONE;
}
/* Implement PendingFrame.find_sal(). Return the PendingFrame's symtab and
base-commit: 646982f4295bf0a1e64867606d496c34c9a15a0c
--
2.53.0
next reply other threads:[~2026-02-21 2:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-21 2:40 simon.marchi [this message]
2026-02-23 12:50 ` Tom Tromey
2026-02-23 13:22 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260221024058.2573546-1-simon.marchi@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox