Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Rename gdbpy_new_list
@ 2026-09-12 14:31 Tom Tromey
  2026-09-14 13:26 ` Simon Marchi
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2026-09-12 14:31 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

gdbpy_new_list did not follow the naming convention documented at the
top of py-wrappers.h.  This patch corrects the error.
---
 gdb/python/py-symbol.c   | 2 +-
 gdb/python/py-wrappers.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
index 39970c6dcdf..3be1d933493 100644
--- a/gdb/python/py-symbol.c
+++ b/gdb/python/py-symbol.c
@@ -489,7 +489,7 @@ gdbpy_lookup_static_symbols (gdbpy_borrowed_ref<> args,
   gdbpy_arg_parse_tuple_and_keywords (args, kw, "s|i", keywords, &name,
 				      &domain);
 
-  gdbpy_ref<> return_list = gdbpy_new_list (0);
+  gdbpy_ref<> return_list = gdbpy_list_new (0);
 
   domain_search_flags flags = from_scripting_domain (domain);
 
diff --git a/gdb/python/py-wrappers.h b/gdb/python/py-wrappers.h
index 6c2b5e4d41e..47be160ed04 100644
--- a/gdb/python/py-wrappers.h
+++ b/gdb/python/py-wrappers.h
@@ -127,7 +127,7 @@ gdbpy_bytes_size (gdbpy_borrowed_ref<> ref)
 
 /* Wrapper for PyList_New.  */
 static inline gdbpy_ref<>
-gdbpy_new_list (Py_ssize_t len)
+gdbpy_list_new (Py_ssize_t len)
 {
   gdbpy_ref<> result (PyList_New (len));
   if (result == nullptr)
-- 
2.49.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Rename gdbpy_new_list
  2026-09-12 14:31 [PATCH] Rename gdbpy_new_list Tom Tromey
@ 2026-09-14 13:26 ` Simon Marchi
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2026-09-14 13:26 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 9/12/26 10:31 AM, Tom Tromey wrote:
> gdbpy_new_list did not follow the naming convention documented at the
> top of py-wrappers.h.  This patch corrects the error.

Looks obvious to me.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

In case you want to fix more, Claude also spotted this one:

 - gdbpy_new_dict, should be gdbpy_dict_new (it has no callers)

And minor, but could be fixed at the same time:

 - the doc for gdbpy_unicode_from_format says PyUnicode_FromFormatV, but
   the implementation calls PyUnicode_FromFormat, the comment could be
   fixed

I think that can all go in a "py-wrappers.h cleanups" obvious patch.

Simon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-14 13:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-12 14:31 [PATCH] Rename gdbpy_new_list Tom Tromey
2026-09-14 13:26 ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox