From: Joel Brobecker Date: Wed, 21 Dec 2011 07:24:40 +0000 (+0000) Subject: Add handling for unqualified Ada operators in linespecs X-Git-Tag: sid-snapshot-20120101~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53907c915d3736e1859c3c0af66d713baf6fe6bd;p=platform%2Fupstream%2Fbinutils.git Add handling for unqualified Ada operators in linespecs This patch enhances the linespec parser to recognize unqualified operator names in linespecs. This allows the user to insert a breakpoint on operator "+" as follow, for instance: (gdb) break "+" Previously, it was possible to insert such a breakpoint, but one had to fully qualify the function name. For instance: (gdb) break ops."+" gdb/ChangeLog: * linespec.c (locate_first_half): Add handling of Ada operators when the current language is Ada. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2ef8598..b56e4e2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2011-12-21 Joel Brobecker + * linespec.c (locate_first_half): Add handling of Ada operators + when the current language is Ada. + +2011-12-21 Joel Brobecker + * objfiles.c (insert_section_p): Do not detect overlay sections if overlay debugging is off. diff --git a/gdb/linespec.c b/gdb/linespec.c index 4d44478..5ad3253 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1331,6 +1331,24 @@ locate_first_half (char **argptr, int *is_quote_enclosed) char *p, *p1; int has_comma; + /* Check if the linespec starts with an Ada operator (such as "+", + or ">", for instance). */ + p = *argptr; + if (p[0] == '"' + && current_language->la_language == language_ada) + { + const struct ada_opname_map *op; + + for (op = ada_opname_table; op->encoded != NULL; op++) + if (strncmp (op->decoded, p, strlen (op->decoded)) == 0) + break; + if (op->encoded != NULL) + { + *is_quote_enclosed = 0; + return p + strlen (op->decoded); + } + } + /* Maybe we were called with a line range FILENAME:LINENUM,FILENAME:LINENUM and we must isolate the first half. Outer layers will call again later for the second half.