aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ada-lex.l15
2 files changed, 18 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c6a6d8f..621da5b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2012-02-29 Joel Brobecker <brobecker@adacore.com>
+ * ada-lex.p (processId): Do not modify already encoded IDs.
+ Update function documentation.
+
+2012-02-29 Joel Brobecker <brobecker@adacore.com>
+
* ada-lang.h (ada_find_renaming_symbol): Replace parameter
"name" with "struct symbol *name_sym".
* ada-exp.y (write_var_or_type): Update call to
diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index 48667d0..5102ff4 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -410,7 +410,9 @@ processReal (const char *num0)
/* Store a canonicalized version of NAME0[0..LEN-1] in yylval.ssym. The
- resulting string is valid until the next call to ada_parse. It differs
+ resulting string is valid until the next call to ada_parse. If
+ NAME0 contains the substring "___", it is assumed to be already
+ encoded and the resulting name is equal to it. Otherwise, it differs
from NAME0 in that:
+ Characters between '...' or <...> are transfered verbatim to
yylval.ssym.
@@ -430,8 +432,18 @@ processId (const char *name0, int len)
int i0, i;
struct stoken result;
+ result.ptr = name;
while (len > 0 && isspace (name0[len-1]))
len -= 1;
+
+ if (strstr (name0, "___") != NULL)
+ {
+ strncpy (name, name0, len);
+ name[len] = '\000';
+ result.length = len;
+ return result;
+ }
+
i = i0 = 0;
while (i0 < len)
{
@@ -471,7 +483,6 @@ processId (const char *name0, int len)
}
name[i] = '\000';
- result.ptr = name;
result.length = i;
return result;
}