public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17156] New: completion needs to handle parse errors better
@ 2014-07-14 18:02 dje at google dot com
  2014-07-14 18:25 ` [Bug gdb/17156] " dje at google dot com
  0 siblings, 1 reply; 2+ messages in thread
From: dje at google dot com @ 2014-07-14 18:02 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17156

            Bug ID: 17156
           Summary: completion needs to handle parse errors better
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: minor
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

Testcase:

struct a
{
  int x, y;
  short s, t;
};

int
main ()
{
  struct a foo = { 1, 2, 3, 4 };

  return 0;
}

(gdb) pty struct a.x
A syntax error in expression, near `.x'.
(gdb) complete pty struct a.x
pty struct a.x
pty struct a.x_destroy
pty struct a.x_getpostn
pty struct a.x_inline
pty struct a.x_putbytes
pty struct a.x_putint32
[... every global symbol that starts with "x" ...]

With "set debug parse 1", I see parsing stopping at the ".", but then the
completer just keeps going, ignoring the error.

Both expression_completer and parse_expression_for_completion watch for errors,
but it doesn't seem right to (essentially) ignore them.  At least not in this
case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug gdb/17156] completion needs to handle parse errors better
  2014-07-14 18:02 [Bug gdb/17156] New: completion needs to handle parse errors better dje at google dot com
@ 2014-07-14 18:25 ` dje at google dot com
  0 siblings, 0 replies; 2+ messages in thread
From: dje at google dot com @ 2014-07-14 18:25 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17156

--- Comment #1 from dje at google dot com ---
Related issue, not sure it warrants a separate PR.

I don't see how the "return COMPLETE;" in

  else if (saw_structop)
    return COMPLETE;

in c-exp.y:lex_one_token can ever happen.
e.g. "struct foo ." or "struct ->" is a syntax error.

Presumably I'm missing something.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-14 18:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-14 18:02 [Bug gdb/17156] New: completion needs to handle parse errors better dje at google dot com
2014-07-14 18:25 ` [Bug gdb/17156] " dje at google dot com

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).