aboutsummaryrefslogtreecommitdiff
path: root/gdb/macroexp.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2010-05-16 00:18:02 +0000
committerMichael Snyder <msnyder@vmware.com>2010-05-16 00:18:02 +0000
commitb8d56208c522b6a27efe7790770ef65a3031da7b (patch)
treebb5517e441b30a41ff80bf566f33988cd98630d1 /gdb/macroexp.c
parent54534c15fe4c4642034894c7d99c5d945c9c3792 (diff)
downloadgdb-b8d56208c522b6a27efe7790770ef65a3031da7b.zip
gdb-b8d56208c522b6a27efe7790770ef65a3031da7b.tar.gz
gdb-b8d56208c522b6a27efe7790770ef65a3031da7b.tar.bz2
2010-05-15 Michael Snyder <msnyder@vmware.com>
* 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.
Diffstat (limited to 'gdb/macroexp.c')
-rw-r--r--gdb/macroexp.c6
1 files changed, 6 insertions, 0 deletions
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;