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] Add solib_address and decode_line Python functionality


>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:

Phil> +static PyObject *
Phil> +gdbpy_solib_name (PyObject *self, PyObject *args)
Phil> +{
Phil> +  unsigned long long pc;

I don't think it is ok to use 'long long'.
Maybe you can use `unsigned PY_LONG_LONG', but see the Python API
manual; it seems that is not always available.  If it is not available
then I think this function could probably revert to 'unsigned long' and
the 'k' format.

Phil> +  TRY_CATCH (except, RETURN_MASK_ALL)
Phil> +    {
Phil> +      if (arg)
Phil> +	{
Phil> +	  char *copy;
Phil> +
Phil> +	  arg = strdup (arg);

Needs xstrdup and a cleanup.

I think we may want this function to also return the unparsed part of
the argument string.  For example we could return a tuple whose first
element is a string and whose second element is the return value as in
this patch.

Tom


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