public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Keith Seitz <keiths@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] python/19506 -- gdb.Breakpoint address location regression
Date: Mon, 01 Feb 2016 03:33:00 -0000	[thread overview]
Message-ID: <20160201033247.GI4008@adacore.com> (raw)
In-Reply-To: <56A81951.2030105@redhat.com>

> [Apologies for waxing a little philosophical here...]
[Apologies for triggering the discussion ;-)...]

> For me, #1 really boils down to UI writers "passing the buck" down to
> gdb's internals (via CLI generalisms). With the location API work, I
> tried to make this layer a little more distinct/separate. UIs are
> responsible for implementing their own representations of locations in a
> way most consistent with their implementation specifics. [Example: using
> 'gdb.Breakpoint("-source foo.c -line 3")' seems downright wrong to me.]

Agreed.

> In light of this, I am suggesting that instead of requiring
> python/mi/guile/whatever to implement their own string_to_event_location
> functions, that the current string_to_event_location be split into a
> "legacy" portion (that deals with address, probe, and linespec
> locations) and a newer (and separate) explicit-handling form (for the
> CLI only).
> 
> This leaves python/guile to implement an explicit location specification
> in a manner more consistent with those interpreters, e.g., python could
> use named arguments to gdb.Breakpoint:
> 
>   gdb.Breakpoint(source="foo.c", line="3")

I agree that each extension language should have their own clean API
for creating breakpoints using explicit locations. That's a lot
cleaner.

> This way we wouldn't "force" these languages to use the CLI's
> argument/value paradigm. I've already done something similar for MI. [MI
> is currently using string_to_event_location, which means it will
> erroneously support the CLI's explicit syntax in addition to its own!
> Bug! My bad! Have patch.]
> 
> In short:
> 1) Remove explicit locations from string_to_event_location.
>    Use this "new" function /everywhere/ legacy linespec support is
>    desired. In my working tree, I call this
>    string_to_event_location_basic.
> 2) string_to_event_locations can now be refactored to do two things:
>    check for an explicit location OR call the _basic version to deal
>    with linespec, address, and probe locations.
> 
> WDYT? [I can send a small patch series to address/clean up all of these,
> if you think this is a reasonable resolution.]

It sounds like a good idea, as I think it'll factorize the code.
In the grand scheme of things, the current situation is not all
that bad, though, so I wouldn't say that this absolutely needs
to be done ahead of everything else.

So, what I would suggest is first push the current patch if
people agree with it. That way, we are covered for the release
branch. And then, if you have some time to look at this
enhancement before we release 7.11, then we can look at
possibly backporting it.

Did anyone review the patch? Typically, Doug is the one reviewing
those patches, but I can take a look as well.

Thanks, Keith!
-- 
Joel

  reply	other threads:[~2016-02-01  3:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 22:05 Keith Seitz
2016-01-26 12:23 ` Joel Brobecker
2016-01-27  1:11   ` Keith Seitz
2016-02-01  3:33     ` Joel Brobecker [this message]
2016-02-01 20:26       ` Keith Seitz
2016-01-27 15:36 ` Phil Muldoon

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=20160201033247.GI4008@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).