diff options
author | Tom Tromey <tom@tromey.com> | 2018-04-26 22:46:54 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-04-27 12:53:14 -0600 |
commit | 632e107b32c0fe8aede62e070b00756e9fdd2c01 (patch) | |
tree | 33106f00d62048ea028bdad94f0df1c21a463f3b /gdb/dwarf2-frame.c | |
parent | 197b262f98ff01516921b3d3056d86a9577535be (diff) | |
download | gdb-632e107b32c0fe8aede62e070b00756e9fdd2c01.zip gdb-632e107b32c0fe8aede62e070b00756e9fdd2c01.tar.gz gdb-632e107b32c0fe8aede62e070b00756e9fdd2c01.tar.bz2 |
Enable -Wsuggest-override
I noticed the existence of -Wsuggest-override and so this patch
enables it for gdb. It found a few spots that could use "override".
Also I went ahead and removed all uses of the "OVERRIDE" macro.
Using override is beneficial because it makes it harder to change a
base class and then forget to change a derived class.
Tested by the buildbot.
ChangeLog
2018-04-27 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* warning.m4 (AM_GDB_WARNINGS): Add -Wsuggest-override.
* dwarf2loc.c (class dwarf_evaluate_loc_desc): Use "override", not
"OVERRIDE".
(class symbol_needs_eval_context): Likewise.
* dwarf2read.c (mock_mapped_index::symbol_name_count)
(mock_mapped_index::symbol_name_at): Use "override". Remove
"virtual".
* dwarf2-frame.c (dwarf_expr_executor::get_addr_index): Use
"override".
(class dwarf_expr_executor): Use "override", not "OVERRIDE".
* aarch64-tdep.c (instruction_reader::read): Use "override".
(instruction_reader_test::read): Likewise.
* arm-tdep.c (instruction_reader::read): Use "override".
(instruction_reader_thumb::read): Likewise.
gdbserver/ChangeLog
2018-04-27 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
Diffstat (limited to 'gdb/dwarf2-frame.c')
-rw-r--r-- | gdb/dwarf2-frame.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index 753ce1f..38367f7 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -230,12 +230,12 @@ class dwarf_expr_executor : public dwarf_expr_context struct frame_info *this_frame; - CORE_ADDR read_addr_from_reg (int reg) OVERRIDE + CORE_ADDR read_addr_from_reg (int reg) override { return ::read_addr_from_reg (this_frame, reg); } - struct value *get_reg_value (struct type *type, int reg) OVERRIDE + struct value *get_reg_value (struct type *type, int reg) override { struct gdbarch *gdbarch = get_frame_arch (this_frame); int regnum = dwarf_reg_to_regnum_or_error (gdbarch, reg); @@ -243,44 +243,44 @@ class dwarf_expr_executor : public dwarf_expr_context return value_from_register (type, regnum, this_frame); } - void read_mem (gdb_byte *buf, CORE_ADDR addr, size_t len) OVERRIDE + void read_mem (gdb_byte *buf, CORE_ADDR addr, size_t len) override { read_memory (addr, buf, len); } - void get_frame_base (const gdb_byte **start, size_t *length) OVERRIDE + void get_frame_base (const gdb_byte **start, size_t *length) override { invalid ("DW_OP_fbreg"); } void push_dwarf_reg_entry_value (enum call_site_parameter_kind kind, union call_site_parameter_u kind_u, - int deref_size) OVERRIDE + int deref_size) override { invalid ("DW_OP_entry_value"); } - CORE_ADDR get_object_address () OVERRIDE + CORE_ADDR get_object_address () override { invalid ("DW_OP_push_object_address"); } - CORE_ADDR get_frame_cfa () OVERRIDE + CORE_ADDR get_frame_cfa () override { invalid ("DW_OP_call_frame_cfa"); } - CORE_ADDR get_tls_address (CORE_ADDR offset) OVERRIDE + CORE_ADDR get_tls_address (CORE_ADDR offset) override { invalid ("DW_OP_form_tls_address"); } - void dwarf_call (cu_offset die_offset) OVERRIDE + void dwarf_call (cu_offset die_offset) override { invalid ("DW_OP_call*"); } - CORE_ADDR get_addr_index (unsigned int index) + CORE_ADDR get_addr_index (unsigned int index) override { invalid ("DW_OP_GNU_addr_index"); } |