Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch][python] Fix some unguarded GDB calls.
Date: Wed, 20 Mar 2013 16:45:00 -0000	[thread overview]
Message-ID: <5149E6CF.2050900@redhat.com> (raw)
In-Reply-To: <87hak69jqg.fsf@fleche.redhat.com>

On 20/03/13 15:25, Tom Tromey wrote:
>>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
> 
> Phil> 2013-03-20  Phil Muldoon  <pmuldoon@redhat.com>
> Phil> 	* python/py-utils.c (get_addr_from_python): Use exception handler
> Phil> 	for value_as_address.
> Phil> 	* python/py-cmd.c (gdbpy_parse_command_name): Use exception
> Phil> 	handler for lookup_cmd_1..
> Phil> 	* python/python.c (execute_gdb_command): Move bpstat_do_actions
> Phil> 	into exception handler.
> 
> Phil> +  if (except.reason < 0)
> Phil> +    {
> Phil> +      gdbpy_convert_exception (except);
> Phil> +      return NULL;
> Phil> +    }
> 
> Use GDB_PY_HANDLE_EXCEPTION instead.

Can't as this function returns char *.  I did check the callers, and
they do a null check though, and deal with python exceptions. I get
this if I use that macro:

../../gdb/gdb/python/py-cmd.c: In function gdbpy_parse_command_name:
../../gdb/gdb/python/py-cmd.c:367:3: error: return from incompatible pointer type [-Werror]
 
> Phil>  get_addr_from_python (PyObject *obj, CORE_ADDR *addr)
> 
> This is documented as being able to throw gdb exceptions.
> It is fine by me if you want to fix that (it certainly looks simpler
> than fixing the one caller in infpy_search_memory), but then the intro
> comment for the function needs an update.

Yeah I can fix that.

Cheers

Phil


  reply	other threads:[~2013-03-20 16:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 14:35 Phil Muldoon
2013-03-20 15:32 ` Tom Tromey
2013-03-20 16:45   ` Phil Muldoon [this message]
2013-03-20 17:37     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5149E6CF.2050900@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox