mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-20 15:03:31 +08:00
gdb
* macroexp.c (get_pp_number): Require digit after leading ".". Correctly handle suffixes. gdb/testsuite * gdb.base/macscp.exp: New regression test.
This commit is contained in:
parent
cc704ebecf
commit
17c8aaf507
@ -1,3 +1,8 @@
|
||||
2008-12-11 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* macroexp.c (get_pp_number): Require digit after leading ".".
|
||||
Correctly handle suffixes.
|
||||
|
||||
2008-12-11 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* macrocmd.c (macro_define_command): Skip whitespace after
|
||||
|
@ -278,20 +278,22 @@ get_pp_number (struct macro_buffer *tok, char *p, char *end)
|
||||
{
|
||||
if (p < end
|
||||
&& (macro_is_digit (*p)
|
||||
|| *p == '.'))
|
||||
|| (*p == '.'
|
||||
&& p + 2 <= end
|
||||
&& macro_is_digit (p[1]))))
|
||||
{
|
||||
char *tok_start = p;
|
||||
|
||||
while (p < end)
|
||||
{
|
||||
if (macro_is_digit (*p)
|
||||
|| macro_is_identifier_nondigit (*p)
|
||||
|| *p == '.')
|
||||
p++;
|
||||
else if (p + 2 <= end
|
||||
&& strchr ("eEpP.", *p)
|
||||
&& (p[1] == '+' || p[1] == '-'))
|
||||
if (p + 2 <= end
|
||||
&& strchr ("eEpP", *p)
|
||||
&& (p[1] == '+' || p[1] == '-'))
|
||||
p += 2;
|
||||
else if (macro_is_digit (*p)
|
||||
|| macro_is_identifier_nondigit (*p)
|
||||
|| *p == '.')
|
||||
p++;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
2008-12-11 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* gdb.base/macscp.exp: New regression test.
|
||||
|
||||
2008-12-11 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* gdb.base/macscp.exp: Print "address.addr".
|
||||
|
@ -656,3 +656,11 @@ gdb_test "print str(maude)" \
|
||||
gdb_test "print xstr(maude)" \
|
||||
" = \"5\"" \
|
||||
"stringify with substitution"
|
||||
|
||||
# Regression test for pp-number bug.
|
||||
gdb_test "macro define si_addr fields.fault.si_addr" \
|
||||
"" \
|
||||
"define si_addr macro"
|
||||
gdb_test "macro expand siginfo.si_addr" \
|
||||
"expands to: siginfo.fields.fault.si_addr" \
|
||||
"macro expand siginfo.si_addr"
|
||||
|
Loading…
Reference in New Issue
Block a user