From: Tom Tromey <tromey@redhat.com>
To: pmuldoon@redhat.com
Cc: Pedro Alves <pedro@codesourcery.com>,
gdb-patches@sourceware.org, dan@codesourcery.com
Subject: Re: [patch] Add visible flag to breakpoints.
Date: Fri, 08 Oct 2010 18:40:00 -0000 [thread overview]
Message-ID: <m3aamottoi.fsf@fleche.redhat.com> (raw)
In-Reply-To: <m3lj68svad.fsf@redhat.com> (Phil Muldoon's message of "Fri, 08 Oct 2010 13:50:34 +0100")
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> +/* Top and bottom of the breakpoint chain. We store bottom so we do
Phil> + not have to constantly iterate through the chain when we add a new
Phil> + breakpoint. */
Phil> +struct breakpoint_object *top;
Phil> +struct breakpoint_object *bottom;
These should be static.
Phil> + if (Breakpoint == NULL)
Pedro pointed out the problem here. I suspect you want ((Breakpoint)->bp)
instead.
There are 2 instances of this.
Phil> +/* Python function to get the visibility of the breakpoint. */
Phil> +static PyObject *
Phil> +bppy_get_visibility (PyObject *self, void *closure)
Blank line between the comment & function.
We're trying to enforce this now.
Phil> + if (internal)
Phil> + {
Phil> + if (! PyBool_Check (internal))
Phil> + {
Phil> + PyErr_SetString (PyExc_TypeError,
Phil> + _("The value of `internal' keyword must be a boolean."));
Use PyObject_IsTrue, don't type-check for a boolean.
Phil> + int i = 0;
Phil> + ALL_PY_BREAKPOINTS (b)
Phil> + {
Phil> + Py_INCREF (b);
Phil> + PyTuple_SetItem (result, i, (PyObject *) b);
Phil> + ++i;
I know this is copied code, as it were, but I think this needs an error
check on PyTuple_SetItem.
Phil> + PyErr_SetString (PyExc_RuntimeError,
Phil> + _("Error while creating breakpoint from GDB."));
Phil> + return;
Phil> + }
I don't think it is ok to do this here. I think it will just confuse
some future call into Python.
I am not sure what is the best thing to do here. We can't throw a gdb
exception, because we are in an observer.
Maybe setting the python error, as above, then immediately calling
gdbpy_print_stack. This is sort of weird, but at least it properly
handles the user's settings.
Tom
next prev parent reply other threads:[~2010-10-08 18:40 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-30 16:28 Phil Muldoon
2010-09-30 16:41 ` Daniel Jacobowitz
2010-09-30 17:51 ` Phil Muldoon
2010-09-30 17:55 ` Pedro Alves
2010-09-30 18:12 ` Phil Muldoon
2010-10-08 12:51 ` Phil Muldoon
2010-10-08 13:35 ` Pedro Alves
2010-10-08 14:04 ` Phil Muldoon
2010-10-08 18:44 ` Tom Tromey
2010-10-12 20:25 ` Phil Muldoon
2010-10-12 21:34 ` Tom Tromey
2010-10-13 12:45 ` Phil Muldoon
2010-10-13 13:06 ` Phil Muldoon
2010-10-13 15:36 ` Tom Tromey
2010-10-16 18:42 ` Pedro Alves
2010-10-16 19:03 ` Pedro Alves
2010-10-18 16:09 ` Tom Tromey
2010-10-22 21:05 ` Phil Muldoon
2010-10-22 21:31 ` Eli Zaretskii
2010-10-22 21:37 ` Phil Muldoon
2010-10-23 9:07 ` Eli Zaretskii
2010-10-31 21:07 ` Pedro Alves
2010-11-11 14:36 ` Phil Muldoon
2010-11-12 12:43 ` Ken Werner
2010-11-12 12:49 ` Pedro Alves
2010-11-12 12:58 ` Ken Werner
2010-10-08 18:40 ` Tom Tromey [this message]
2010-09-30 17:04 ` Pedro Alves
2010-09-30 17:55 ` Phil Muldoon
2010-09-30 17:51 ` Eli Zaretskii
2010-10-05 22:28 ` 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=m3aamottoi.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
--cc=pmuldoon@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