This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] [python] Fix Python 3 build and testsuite issues
- From: Tom Tromey <tromey at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: "gdb-patches\ at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 20 Aug 2013 13:59:15 -0600
- Subject: Re: [patch] [python] Fix Python 3 build and testsuite issues
- References: <521230C8 dot 2040803 at redhat dot com> <878uzxlkl1 dot fsf at fleche dot redhat dot com> <52124B8D dot 6010609 at redhat dot com> <87ppt9jzrl dot fsf at fleche dot redhat dot com> <5213C6BA dot 7030703 at redhat dot com>
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> @@ -236,7 +236,7 @@ class FrameVars(object):
Phil> # SYM may be a string instead of a symbol in the case of
Phil> # synthetic local arguments or locals. If that is the case,
Phil> # always fetch.
Phil> - if isinstance(sym, basestring):
Phil> + if isinstance(sym, str):
Phil> return True
Does this work in all versions?
I thought perhaps hasattr would be more robust here.
Phil> if (py_func != NULL)
Phil> {
Phil> - const char *function = NULL;
Phil> + char *function_to_free = NULL;
Phil> + const char *function;
Phil> if (gdbpy_is_string (py_func))
Phil> {
Phil> - function = PyString_AsString (py_func);
Phil> + function = function_to_free =
Phil> + python_string_to_host_string (py_func);
I think it's preferable to declare function_to_free in the innermost
scope.
Tom