aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-06-06 14:18:23 -0600
committerTom Tromey <tom@tromey.com>2016-07-14 10:35:40 -0600
commitac29888840f025448225e600d4cf99e126386878 (patch)
tree8c92ab02d4267d9a81cff5b770f24fb6f222b231 /gdb
parent764c99c18adcdf658b390f25940aed7713a6a769 (diff)
downloadfsf-binutils-gdb-ac29888840f025448225e600d4cf99e126386878.zip
fsf-binutils-gdb-ac29888840f025448225e600d4cf99e126386878.tar.gz
fsf-binutils-gdb-ac29888840f025448225e600d4cf99e126386878.tar.bz2
Remove some variables but call functions for side effects
This patch consolidates the (possibly-questionable) spots where we remove a declaration but continue to call some function for side effects. In a couple of cases it wasn't entirely clear to me that this mattered; and in some other cases it might be more aesthetically pleasing to use ATTRIBUTE_UNUSED. So, I broke this out into a separate patch for simpler review. 2016-07-14 Tom Tromey <tom@tromey.com> * arch-utils.c (default_skip_permanent_breakpoint): Remove "bp_insn". * disasm.c (do_assembly_only): Remove "num_displayed". * dwarf2read.c (read_abbrev_offset): Remove "length". (dwarf_decode_macro_bytes) <DW_MACINFO_vendor_ext>: Remove "constant". * m32c-tdep.c (make_regs): Remove "r2hl", "r3hl", and "intbhl". * microblaze-tdep.c (microblaze_frame_cache): Remove "func". * tracefile.c (trace_save): Remove "status".
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/arch-utils.c3
-rw-r--r--gdb/disasm.c4
-rw-r--r--gdb/dwarf2read.c9
-rw-r--r--gdb/m32c-tdep.c9
-rw-r--r--gdb/microblaze-tdep.c4
-rw-r--r--gdb/tracefile.c7
7 files changed, 28 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f70a2bf..affce52 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,17 @@
2016-07-14 Tom Tromey <tom@tromey.com>
+ * arch-utils.c (default_skip_permanent_breakpoint): Remove
+ "bp_insn".
+ * disasm.c (do_assembly_only): Remove "num_displayed".
+ * dwarf2read.c (read_abbrev_offset): Remove "length".
+ (dwarf_decode_macro_bytes) <DW_MACINFO_vendor_ext>: Remove
+ "constant".
+ * m32c-tdep.c (make_regs): Remove "r2hl", "r3hl", and "intbhl".
+ * microblaze-tdep.c (microblaze_frame_cache): Remove "func".
+ * tracefile.c (trace_save): Remove "status".
+
+2016-07-14 Tom Tromey <tom@tromey.com>
+
* symfile.c (simple_overlay_update_1): Remove initialization
of "size", and commented-out code.
(simple_overlay_update): Likewise.
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 604042f..53121bc 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -857,10 +857,9 @@ default_skip_permanent_breakpoint (struct regcache *regcache)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
CORE_ADDR current_pc = regcache_read_pc (regcache);
- const gdb_byte *bp_insn;
int bp_len;
- bp_insn = gdbarch_breakpoint_from_pc (gdbarch, &current_pc, &bp_len);
+ gdbarch_breakpoint_from_pc (gdbarch, &current_pc, &bp_len);
current_pc += bp_len;
regcache_write_pc (regcache, current_pc);
}
diff --git a/gdb/disasm.c b/gdb/disasm.c
index f611721..bd1f760 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -737,13 +737,11 @@ do_assembly_only (struct gdbarch *gdbarch, struct ui_out *uiout,
CORE_ADDR low, CORE_ADDR high,
int how_many, int flags, struct ui_file *stb)
{
- int num_displayed = 0;
struct cleanup *ui_out_chain;
ui_out_chain = make_cleanup_ui_out_list_begin_end (uiout, "asm_insns");
- num_displayed = dump_insns (gdbarch, uiout, di, low, high, how_many,
- flags, stb, NULL);
+ dump_insns (gdbarch, uiout, di, low, high, how_many, flags, stb, NULL);
do_cleanups (ui_out_chain);
}
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 6658a38..58b502b 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -4497,12 +4497,12 @@ read_abbrev_offset (struct dwarf2_section_info *section,
{
bfd *abfd = get_section_bfd_owner (section);
const gdb_byte *info_ptr;
- unsigned int length, initial_length_size, offset_size;
+ unsigned int initial_length_size, offset_size;
sect_offset abbrev_offset;
dwarf2_read_section (dwarf2_per_objfile->objfile, section);
info_ptr = section->buffer + offset.sect_off;
- length = read_initial_length (abfd, info_ptr, &initial_length_size);
+ read_initial_length (abfd, info_ptr, &initial_length_size);
offset_size = initial_length_size == 4 ? 4 : 8;
info_ptr += initial_length_size + 2 /*version*/;
abbrev_offset.sect_off = read_offset_1 (abfd, info_ptr, offset_size);
@@ -21578,9 +21578,10 @@ dwarf_decode_macro_bytes (bfd *abfd,
if (!section_is_gnu)
{
unsigned int bytes_read;
- int constant;
- constant = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
+ /* This reads the constant, but since we don't recognize
+ any vendor extensions, we ignore it. */
+ read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
mac_ptr += bytes_read;
read_direct_string (abfd, mac_ptr, &bytes_read);
mac_ptr += bytes_read;
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 59927a6..1e98f73 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -823,9 +823,6 @@ make_regs (struct gdbarch *arch)
struct m32c_reg *sp;
struct m32c_reg *r0hl;
struct m32c_reg *r1hl;
- struct m32c_reg *r2hl;
- struct m32c_reg *r3hl;
- struct m32c_reg *intbhl;
struct m32c_reg *r2r0;
struct m32c_reg *r3r1;
struct m32c_reg *r3r1r2r0;
@@ -889,9 +886,9 @@ make_regs (struct gdbarch *arch)
r0hl = CHL (r0, tdep->int8);
r1hl = CHL (r1, tdep->int8);
- r2hl = CHL (r2, tdep->int8);
- r3hl = CHL (r3, tdep->int8);
- intbhl = CHL (intb, tdep->int16);
+ CHL (r2, tdep->int8);
+ CHL (r3, tdep->int8);
+ CHL (intb, tdep->int16);
r2r0 = CCAT (r2, r0, tdep->int32);
r3r1 = CCAT (r3, r1, tdep->int32);
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index 9cfe3fe..665ec0c 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -437,7 +437,6 @@ microblaze_frame_cache (struct frame_info *next_frame, void **this_cache)
{
struct microblaze_frame_cache *cache;
struct gdbarch *gdbarch = get_frame_arch (next_frame);
- CORE_ADDR func;
int rn;
if (*this_cache)
@@ -451,7 +450,8 @@ microblaze_frame_cache (struct frame_info *next_frame, void **this_cache)
for (rn = 0; rn < gdbarch_num_regs (gdbarch); rn++)
cache->register_offsets[rn] = -1;
- func = get_frame_func (next_frame);
+ /* Call for side effects. */
+ get_frame_func (next_frame);
cache->pc = get_frame_address_in_block (next_frame);
diff --git a/gdb/tracefile.c b/gdb/tracefile.c
index c32bcf4..56fb0d2 100644
--- a/gdb/tracefile.c
+++ b/gdb/tracefile.c
@@ -57,7 +57,6 @@ trace_save (const char *filename, struct trace_file_writer *writer,
int target_does_save)
{
struct trace_status *ts = current_trace_status ();
- int status;
struct uploaded_tp *uploaded_tps = NULL, *utp;
struct uploaded_tsv *uploaded_tsvs = NULL, *utsv;
@@ -77,8 +76,10 @@ trace_save (const char *filename, struct trace_file_writer *writer,
}
/* Get the trace status first before opening the file, so if the
- target is losing, we can get out without touching files. */
- status = target_get_trace_status (ts);
+ target is losing, we can get out without touching files. Since
+ we're just calling this for side effects, we ignore the
+ result. */
+ target_get_trace_status (ts);
writer->ops->start (writer, filename);