Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Matt Rice <ratmice@gmail.com>
Cc: "gdb-patches@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: Re: [RFA 7/9] Explicit locations v2 - CLI for explicit locations
Date: Fri, 09 May 2014 16:37:00 -0000	[thread overview]
Message-ID: <536D0446.9060500@redhat.com> (raw)
In-Reply-To: <CACTLOFpYDEv0T_QQgXgLRpXk9TnwYTyfZvvda1E+uAfZdYE_4A@mail.gmail.com>

On 05/08/2014 05:48 PM, Matt Rice wrote:
> Just curious if we need this quote handling in explicit linespec's

Good question! I did this so long ago, I'm not 100% certain /why/ I 
chose to include quoting, but I can have a guess...

UI consistency. It is allowed in linespecs, largely -- but not entirely 
-- to work around (old) parser problems. Users are, sadly, quite used to 
quoting things. In order to maintain some sort of parallelism, I *think* 
that I added the ability to quote stuff, but it is not necessary (see 
below).

> I thought (though i'm not terribly familiar with c++ linespecs)
> that the quotes were for operator+, clashing with foo+offset
> and 'something::foo' clashing with file:line stuff,

With the "new" linespec parser, I've tried to minimize the need to quote 
anything. Alas, as you point out, the need still arises.

One of the tests that I have added for dprintfs seems to indicate that I 
had similar concerns about permissive quoting:

(gdb) dprintf -func A::operator,,"hello\n"

Believe it or not, that actually does do what it is supposed to do. [Ok, 
maybe I am the only one surprised to (re)discover that.]

> where it isn't obvious to me the need for it arises when using
> explicit locations.
> I suppose break -source '/path with spaces/foo.c' -line +42

I tried this on my working copy:

(gdb)  b -source /dir with spaces/file with spaces.c -line 3
No source file named /dir with spaces/file with spaces.c.
Make breakpoint pending on future shared library load? (y or [n]) n

So it seems I already had something in mind to handle spaces in a 
relatively sane way. [Not that there aren't any lurking bugs -- I'll be 
the first to admit I am seldom capable of writing bug-free code with a 
patch this large.]

> my main curiosity here is for languages which allow the ' character,
> particularly the ML family's usage of type variables[1]. to
> discriminate polymorphic functions of the variety break -function
> foo('a) vs break -function foo(string).

The parser seems to already permit this syntax, but again, I'm sure 
there are latent bugs in there somewhere:

(gdb) b -func foo('a)
Function "foo('a)" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n

So, in the end, it certainly seems that we could whack this quoting 
stuff altogether if it was so desired. Other than the parallelism 
`argument' that I think I used to justify this to myself when I 
originally wrote it, there isn't really a compelling reason to keep it. 
At least, not that I know of/remember right now.

Keith


  reply	other threads:[~2014-05-09 16:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 18:03 Keith Seitz
2014-05-09  0:48 ` Matt Rice
2014-05-09 16:37   ` Keith Seitz [this message]
2014-05-10  0:25     ` Matt Rice
2014-05-10  2:03       ` Keith Seitz
2014-05-30 18:19 ` Keith Seitz
2014-08-06  4:46   ` Doug Evans
2014-09-03 19:33     ` Keith Seitz

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=536D0446.9060500@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ratmice@gmail.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