]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: switch bytes object helpers to Python limited API equivalents
authorMatthieu Longo <matthieu.longo@arm.com>
Wed, 28 Jan 2026 15:39:11 +0000 (15:39 +0000)
committerMatthieu Longo <matthieu.longo@arm.com>
Wed, 4 Mar 2026 15:38:28 +0000 (15:38 +0000)
* PyBytes_AS_STRING -> PyBytes_AsString
* PyBytes_GET_SIZE -> PyBytes_Size

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23830
Approved-By: Tom Tromey <tom@tromey.com>
gdb/python/py-prettyprint.c

index eb7ac2c048f47755d9ca50fd9e677c837e835a4a..3dcb4fba1e483cd77f5f4d34a4e4bcb0a5236e7d 100644 (file)
@@ -318,8 +318,9 @@ print_string_repr (PyObject *printer, const char *hint,
              long length;
              struct type *type;
 
-             output = PyBytes_AS_STRING (string.get ());
-             length = PyBytes_GET_SIZE (string.get ());
+             output = PyBytes_AsString (string.get ());
+             gdb_assert (output != nullptr);
+             length = PyBytes_Size (string.get ());
              type = builtin_type (gdbarch)->builtin_char;
 
              if (hint && !strcmp (hint, "string"))