Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Phil Muldoon <pmuldoon@redhat.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [python] Allow explicit locations in breakpoints.
Date: Wed, 23 Aug 2017 17:51:00 -0000	[thread overview]
Message-ID: <d1899991-db61-b663-7601-86dfa38449a2@redhat.com> (raw)
In-Reply-To: <04ccc2c4-7827-eedc-d8db-a83a0167acb6@redhat.com>

On 08/23/2017 06:58 AM, Phil Muldoon wrote:

> diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
> index 6156eb6179..8431bed939 100644
> --- a/gdb/python/py-breakpoint.c
> +++ b/gdb/python/py-breakpoint.c
> @@ -681,7 +681,7 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
>  	case bp_breakpoint:
>  	  {
>  	    event_location_up location
> -	      = string_to_event_location_basic (&copy, current_language);
> +	      = string_to_event_location (&copy, current_language);
>  	    create_breakpoint (python_gdbarch,
>  			       location.get (), NULL, -1, NULL,
>  			       0,

This binds python interfaces to the CLI, and I don't think we want that. I would have expected (perhaps naively) to see explicit locations supported using a more natural python convention, such as using PyArg_ParseTupleAndKeywords.

For example, in MI (mi_cmd_break_insert_1) , we do not use string_to_event_location. We support MI-centric calling conventions by using mi_getopt for argument processing. While MI does use the same option names, they don't (or didn't) have to be. The comments for string_to_event_location should be clearer that this is a CLI-specific implementation. [Perhaps that entire function could be moved to somewhere in cli/?]

I admit, like the MI case, it is almost busywork, but it does (at least) isolate those interfaces from any internal API churn that GDB might undergo.

WDYT?

Keith


       reply	other threads:[~2017-08-23 17:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <04ccc2c4-7827-eedc-d8db-a83a0167acb6@redhat.com>
2017-08-23 17:51 ` Keith Seitz [this message]
2017-08-23 18:31   ` Phil Muldoon
2017-10-16 18:23     ` Simon Marchi
2017-10-16 18:33       ` Simon Marchi
2017-10-16 20:24       ` Phil Muldoon
2017-10-16 21:26         ` Simon Marchi
2017-10-16 22:01           ` Phil Muldoon
2017-10-16 22:26             ` Simon Marchi
2017-11-17 11:02               ` Phil Muldoon
2017-11-17 13:31                 ` Eli Zaretskii
2017-11-17 14:02                   ` Phil Muldoon
2017-11-23 22:17                 ` Simon Marchi
2017-11-24 14:07                   ` Phil Muldoon
2017-12-07 10:02                   ` Phil Muldoon
2017-12-07 12:16                     ` Phil Muldoon
2017-12-07 14:54                       ` Simon Marchi
2017-12-07 15:12                         ` Phil Muldoon
2017-12-07 16:41                           ` Simon Marchi
2017-12-08 13:50                     ` Eli Zaretskii
2017-09-12 10:03 ` Phil Muldoon
2017-10-02 15:18   ` Phil Muldoon
2017-10-16 11:14     ` Phil Muldoon
2017-10-16 18:31 ` Simon Marchi

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=d1899991-db61-b663-7601-86dfa38449a2@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --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