From b8d56208c522b6a27efe7790770ef65a3031da7b Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Sun, 16 May 2010 00:18:02 +0000 Subject: 2010-05-15 Michael Snyder * m2-lang.c: White space. * m2-valprint.c: White space. * macrocmd.c: White space. * macroexp.c: White space. * macroscope.c: White space. * macrotab.c: White space. * main.c: White space. * maint.c: White space. * mdebugread.c: White space. * memattr.c: White space. * minsyms.c: White space. * monitor.c: White space. --- gdb/macroexp.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gdb/macroexp.c') diff --git a/gdb/macroexp.c b/gdb/macroexp.c index 0bd65f6..73e68d7 100644 --- a/gdb/macroexp.c +++ b/gdb/macroexp.c @@ -525,6 +525,7 @@ get_token (struct macro_buffer *tok, { /* How many characters did we consume, including whitespace? */ int consumed = p - src->text + tok->len; + src->text += consumed; src->len -= consumed; return 1; @@ -767,6 +768,7 @@ gather_arguments (const char *name, struct macro_buffer *src, paren. */ { struct macro_buffer temp; + init_shared_buffer (&temp, src->text, src->len); if (! get_token (&tok, &temp) @@ -1016,6 +1018,7 @@ substitute_args (struct macro_buffer *dest, { int arg = find_parameter (&tok, is_varargs, va_arg_name, def->argc, def->argv); + if (arg != -1) appendmem (dest, argv[arg].text, argv[arg].len); else @@ -1055,6 +1058,7 @@ substitute_args (struct macro_buffer *dest, { int arg = find_parameter (&tok, is_varargs, va_arg_name, def->argc, def->argv); + if (arg != -1) appendmem (dest, argv[arg].text, argv[arg].len); else @@ -1193,6 +1197,7 @@ expand (const char *id, else { int len = strlen (def->argv[def->argc - 1]); + if (len > 3 && strcmp (def->argv[def->argc - 1] + len - 3, "...") == 0) { @@ -1297,6 +1302,7 @@ maybe_expand (struct macro_buffer *dest, lookup function expects. */ char *id = xmalloc (src_first->len + 1); struct cleanup *back_to = make_cleanup (xfree, id); + memcpy (id, src_first->text, src_first->len); id[src_first->len] = 0; -- cgit v1.1