This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] cleanup: Wunused dwarf2-frame, symtab
- From: Aleksandar Ristovski <aristovski at qnx dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 30 Jan 2013 23:38:13 -0500
- Subject: [patch] cleanup: Wunused dwarf2-frame, symtab
- Newsgroups: gmane.comp.gdb.patches
Hello,
This is removing unused variables and allows compiling with -Wunused.
Thanks,
Aleksandar Ristovski
QNX Software Systems
ChangeLog:
Aleksandar Ristovski <aristovski@qnx.com>
* dwarf2-frame.c (dwarf2_compile_cfa_to_ax): Remove unused
NUM_REGS.
* symtab.c (iterate_over_symtabs): Remove unused S.
(find_pc_sect_symtab): Remove unused PSPACE.
(find_pc_sect_line): Remove unused ALT_SYMTAB.
(find_pcs_for_symtab_line): Remove unused IX, PREVIOUS_FUNCTION.
(completion_list_add_name): Remove unused NEWSIZE.
Index: gdb/dwarf2-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
retrieving revision 1.142
diff -u -p -r1.142 dwarf2-frame.c
--- gdb/dwarf2-frame.c 1 Jan 2013 06:32:41 -0000 1.142
+++ gdb/dwarf2-frame.c 31 Jan 2013 04:35:29 -0000
@@ -888,8 +888,6 @@ dwarf2_compile_cfa_to_ax (struct agent_e
CORE_ADDR pc,
struct dwarf2_per_cu_data *data)
{
- const int num_regs = gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
struct dwarf2_fde *fde;
CORE_ADDR text_offset;
struct dwarf2_frame_state fs;
Index: gdb/symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.341
diff -u -p -r1.341 symtab.c
--- gdb/symtab.c 24 Jan 2013 20:36:01 -0000 1.341
+++ gdb/symtab.c 31 Jan 2013 04:35:31 -0000
@@ -285,7 +285,6 @@ iterate_over_symtabs (const char *name,
void *data),
void *data)
{
- struct symtab *s = NULL;
struct objfile *objfile;
char *real_path = NULL;
char *full_path = NULL;
@@ -2103,12 +2102,9 @@ find_pc_sect_symtab (CORE_ADDR pc, struc
struct symtab *s = NULL;
struct symtab *best_s = NULL;
struct objfile *objfile;
- struct program_space *pspace;
CORE_ADDR distance = 0;
struct minimal_symbol *msymbol;
- pspace = current_program_space;
-
/* If we know that this is not a text address, return failure. This is
necessary because we loop based on the block's high and low code
addresses, which do not include the data ranges, and because
@@ -2261,7 +2257,6 @@ find_pc_sect_line (CORE_ADDR pc, struct
we will use a line one less than this,
with a range from the start of that file to the first line's pc. */
struct linetable_entry *alt = NULL;
- struct symtab *alt_symtab = 0;
/* Info on best line seen in this file. */
@@ -2406,10 +2401,7 @@ find_pc_sect_line (CORE_ADDR pc, struct
/* Is this file's first line closer than the first lines of other files?
If so, record this file, and its first line, as best alternate. */
if (item->pc > pc && (!alt || item->pc < alt->pc))
- {
- alt = item;
- alt_symtab = s;
- }
+ alt = item;
for (i = 0; i < len; i++, item++)
{
@@ -2600,8 +2592,7 @@ VEC (CORE_ADDR) *
find_pcs_for_symtab_line (struct symtab *symtab, int line,
struct linetable_entry **best_item)
{
- int start = 0, ix;
- struct symbol *previous_function = NULL;
+ int start = 0;
VEC (CORE_ADDR) *result = NULL;
/* First, collect all the PCs that are at this line. */
@@ -4041,8 +4032,6 @@ completion_list_add_name (const char *sy
const char *sym_text, int sym_text_len,
const char *text, const char *word)
{
- int newsize;
-
/* Clip symbols that cannot match. */
if (!compare_symbol_name (symname, sym_text, sym_text_len))
return;