This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] [python] Fix Python 3 build and testsuite issues


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]