Both aarch64-tdep.c and arm-tdep.c defines a class instruction_reader, which
violates ODR, but linker doesn't an emit error. I fix this issue by wrapping
them by anonymous namespace, but I think it is better to apply this for all
locally used classes.
If it is a good idea to put locally used class into anonymous namespace, we
should document this rule into GDB coding convention, or even GCC coding
convention. Note that anonymous namespace has been used in GCC but GCC
coding convention doesn't mention the it.
gdb:
2017-03-22 Yao Qi <yao.qi@linaro.org>
* aarch64-tdep.c: Wrap locally used classes in anonymous
namespace.
* arm-tdep.c: Likewise.
* linespec.c: Likewise.
* ui-out.c: Likewise.
+2017-03-22 Yao Qi <yao.qi@linaro.org>
+
+ * aarch64-tdep.c: Wrap locally used classes in anonymous
+ namespace.
+ * arm-tdep.c: Likewise.
+ * linespec.c: Likewise.
+ * ui-out.c: Likewise.
+
2017-03-22 Jonah Graham <jonah@kichwacoders.com>
PR gdb/19637
2017-03-22 Jonah Graham <jonah@kichwacoders.com>
PR gdb/19637
fprintf_filtered (file, _("AArch64 debugging is %s.\n"), value);
}
fprintf_filtered (file, _("AArch64 debugging is %s.\n"), value);
}
/* Abstract instruction reader. */
class abstract_instruction_reader
/* Abstract instruction reader. */
class abstract_instruction_reader
/* Analyze a prologue, looking for a recognizable stack frame
and frame pointer. Scan until we encounter a store that could
clobber the stack frame unexpectedly, or an unknown instruction. */
/* Analyze a prologue, looking for a recognizable stack frame
and frame pointer. Scan until we encounter a store that could
clobber the stack frame unexpectedly, or an unknown instruction. */
/* Abstract memory reader. */
class abstract_memory_reader
/* Abstract memory reader. */
class abstract_memory_reader
/* Extracts arm/thumb/thumb2 insn depending on the size, and returns 0 on success
and positive val on fauilure. */
/* Extracts arm/thumb/thumb2 insn depending on the size, and returns 0 on success
and positive val on fauilure. */
/* A function object that serves as symbol_found_callback_ftype
callback for iterate_over_symbols. This is used by
lookup_prefix_sym to collect type symbols. */
/* A function object that serves as symbol_found_callback_ftype
callback for iterate_over_symbols. This is used by
lookup_prefix_sym to collect type symbols. */
return true; /* Continue iterating. */
}
return true; /* Continue iterating. */
}
/* Return any symbols corresponding to CLASS_NAME in FILE_SYMTABS. */
static VEC (symbolp) *
/* Return any symbols corresponding to CLASS_NAME in FILE_SYMTABS. */
static VEC (symbolp) *
/* This function object is a callback for iterate_over_symtabs, used
when collecting all matching symtabs. */
/* This function object is a callback for iterate_over_symtabs, used
when collecting all matching symtabs. */
/* Given a file name, return a VEC of all matching symtabs. If
SEARCH_PSPACE is not NULL, the search is restricted to just that
program space. */
/* Given a file name, return a VEC of all matching symtabs. If
SEARCH_PSPACE is not NULL, the search is restricted to just that
program space. */
#include <string>
#include <memory>
#include <string>
#include <memory>
/* A header of a ui_out_table. */
class ui_out_hdr
/* A header of a ui_out_table. */
class ui_out_hdr
/* A level of nesting (either a list or a tuple) in a ui_out output. */
class ui_out_level
/* A level of nesting (either a list or a tuple) in a ui_out output. */
class ui_out_level