X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fmacroexp.c;h=65232bc83927cf9b85191dac1494146521299f23;hb=62e6599087efba193e0156d89ee65fb74fc99cb2;hp=1fa37d2875b8467925c5c3f654be372c2b5b5711;hpb=0354904bdacb9bf1ebdf3ebdf3723f8a550bcdab;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/macroexp.c b/gdb/macroexp.c index 1fa37d2875..65232bc839 100644 --- a/gdb/macroexp.c +++ b/gdb/macroexp.c @@ -1,5 +1,5 @@ /* C preprocessor macro expansion for GDB. - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. Contributed by Red Hat, Inc. This file is part of GDB. @@ -19,7 +19,6 @@ #include "defs.h" #include "gdb_obstack.h" -#include "bcache.h" #include "macrotab.h" #include "macroexp.h" #include "c-lang.h" @@ -112,6 +111,16 @@ struct macro_buffer shared = true; } + macro_buffer& operator= (const macro_buffer &src) + { + gdb_assert (src.shared); + gdb_assert (shared); + set_shared (src.text, src.len); + last_token = src.last_token; + is_identifier = src.is_identifier; + return *this; + } + ~macro_buffer () { if (! shared && size) @@ -120,7 +129,7 @@ struct macro_buffer /* Release the text of the buffer to the caller, which is now responsible for freeing it. */ - char *release () + ATTRIBUTE_UNUSED_RESULT char *release () { gdb_assert (! shared); gdb_assert (size); @@ -1324,7 +1333,7 @@ expand (const char *id, /* If the single token in SRC_FIRST followed by the tokens in SRC_REST - constitute a macro invokation not forbidden in NO_LOOP, append its + constitute a macro invocation not forbidden in NO_LOOP, append its expansion to DEST and return non-zero. Otherwise, return zero, and leave DEST unchanged.