diff options
author | Joel Brobecker <brobecker@gnat.com> | 2008-01-04 21:36:25 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2008-01-04 21:36:25 +0000 |
commit | babe1480e8f35a2e5cd8394e2d990863387a9347 (patch) | |
tree | 9e54d8c0056247f37630fc673c97c8c817a39361 /gdb | |
parent | c18d3d891b8cc1c6686a10b8686e982430492488 (diff) | |
download | gdb-babe1480e8f35a2e5cd8394e2d990863387a9347.zip gdb-babe1480e8f35a2e5cd8394e2d990863387a9347.tar.gz gdb-babe1480e8f35a2e5cd8394e2d990863387a9347.tar.bz2 |
* ada-lang.c (is_name_suffix): Handle middle-name numeric suffixes
that are used to differentiate homonyms.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/ada-lang.c | 33 |
2 files changed, 24 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 699a553..acdbc1e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-01-04 Joel Brobecker <brobecker@adacore.com> + + * ada-lang.c (is_name_suffix): Handle middle-name numeric suffixes + that are used to differentiate homonyms. + 2008-01-04 Jerome Guitton <guitton@adacore.com> * ada-lang.c (decode_packed_array_type): Avoid a seg fault diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 198ef62..6e3e6a3 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -4934,12 +4934,14 @@ ada_lookup_symbol_nonlocal (const char *name, names (e.g., XVE) are not included here. Currently, the possible suffixes are given by either of the regular expression: - (__[0-9]+)?[.$][0-9]+ [nested subprogram suffix, on platforms such - as GNU/Linux] - ___[0-9]+ [nested subprogram suffix, on platforms such as HP/UX] - _E[0-9]+[bs]$ [protected object entry suffixes] + [.$][0-9]+ [nested subprogram suffix, on platforms such as GNU/Linux] + ___[0-9]+ [nested subprogram suffix, on platforms such as HP/UX] + _E[0-9]+[bs]$ [protected object entry suffixes] (X[nb]*)?((\$|__)[0-9](_?[0-9]+)|___(JM|LJM|X([FDBUP].*|R[^T]?)))?$ - */ + + Also, any leading "__[0-9]+" sequence is skipped before the suffix + match is performed. This sequence is used to differentiate homonyms, + is an optional part of a valid name suffix. */ static int is_name_suffix (const char *str) @@ -4948,20 +4950,20 @@ is_name_suffix (const char *str) const char *matching; const int len = strlen (str); - /* (__[0-9]+)?\.[0-9]+ */ - matching = str; + /* Skip optional leading __[0-9]+. */ + if (len > 3 && str[0] == '_' && str[1] == '_' && isdigit (str[2])) { - matching += 3; - while (isdigit (matching[0])) - matching += 1; - if (matching[0] == '\0') - return 1; + str += 3; + while (isdigit (str[0])) + str += 1; } + + /* [.$][0-9]+ */ - if (matching[0] == '.' || matching[0] == '$') + if (str[0] == '.' || str[0] == '$') { - matching += 1; + matching = str + 1; while (isdigit (matching[0])) matching += 1; if (matching[0] == '\0') @@ -4969,6 +4971,7 @@ is_name_suffix (const char *str) } /* ___[0-9]+ */ + if (len > 3 && str[0] == '_' && str[1] == '_' && str[2] == '_') { matching = str + 3; @@ -5021,8 +5024,10 @@ is_name_suffix (const char *str) str += 1; } } + if (str[0] == '\000') return 1; + if (str[0] == '_') { if (str[1] != '_' || str[2] == '\000') |