* [patch] ada-lang, c-lang, f-lang, objc-lang, jv-lang, m2-lang, ada-tasks.c: delete unused variables
@ 2010-05-06 23:39 Michael Snyder
2010-05-07 3:17 ` Joel Brobecker
0 siblings, 1 reply; 5+ messages in thread
From: Michael Snyder @ 2010-05-06 23:39 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: tmp26.txt --]
[-- Type: text/plain, Size: 5915 bytes --]
2010-05-06 Michael Snyder <msnyder@vmware.com>
* ada-lang.c (add_defn_to_vec): Delete unused variable.
(decode_constrained_packed_array_type): Delete unused variable.
(add_defn_to_vec): Delete unused variable.
(symbol_completion_match): Delete unused variable.
(value_tag_from_contents_and_address): Delete unused variable.
(ada_evaluate_subexp): Delete unused variable.
* c-lang.c (classify_type): Delete unused variable.
* f-lang.c (f_printstr): Delete unused variable.
* objc-lang.c (objc_printstr): Delete unused variable.
* ada-tasks.c (get_known_tasks_addr): Delete unused variable.
* jv-lang.c (type_from_class): ifdef unused variable.
(java_class_name_from_physname): Delete unused variable.
* m2-lang.c (m2_printstr): Delete unused variable.
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.259
diff -u -p -r1.259 ada-lang.c
--- ada-lang.c 5 May 2010 17:07:39 -0000 1.259
+++ ada-lang.c 6 May 2010 23:35:37 -0000
@@ -1823,14 +1823,11 @@ constrained_packed_array_type (struct ty
static struct type *
decode_constrained_packed_array_type (struct type *type)
{
- struct symbol *sym;
- struct block **blocks;
char *raw_name = ada_type_name (ada_check_typedef (type));
char *name;
char *tail;
struct type *shadow_type;
long bits;
- int i, n;
if (!raw_name)
raw_name = ada_type_name (desc_base_type (type));
@@ -4050,7 +4047,6 @@ add_defn_to_vec (struct obstack *obstack
struct block *block)
{
int i;
- size_t tmp;
struct ada_symbol_info *prevDefns = defns_collected (obstackp, 0);
/* Do not try to complete stub types, as the debugger is probably
@@ -5018,7 +5014,6 @@ symbol_completion_match (const char *sym
const char *text, int text_len,
int wild_match, int encoded)
{
- char *result;
const int verbatim_match = (text[0] == '<');
int match = 0;
@@ -5409,7 +5404,7 @@ value_tag_from_contents_and_address (str
const gdb_byte *valaddr,
CORE_ADDR address)
{
- int tag_byte_offset, dummy1, dummy2;
+ int tag_byte_offset;
struct type *tag_type;
if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
NULL, NULL, NULL))
@@ -8575,7 +8570,7 @@ ada_evaluate_subexp (struct type *expect
int *pos, enum noside noside)
{
enum exp_opcode op;
- int tem, tem2, tem3;
+ int tem;
int pc;
struct value *arg1 = NULL, *arg2 = NULL, *arg3;
struct type *type;
Index: c-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.c,v
retrieving revision 1.83
diff -u -p -r1.83 c-lang.c
--- c-lang.c 29 Apr 2010 14:45:38 -0000 1.83
+++ c-lang.c 6 May 2010 23:35:37 -0000
@@ -76,7 +76,6 @@ static enum c_string_type
classify_type (struct type *elttype, struct gdbarch *gdbarch,
const char **encoding)
{
- struct type *saved_type;
enum c_string_type result;
/* We loop because ELTTYPE may be a typedef, and we want to
Index: f-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/f-lang.c,v
retrieving revision 1.60
diff -u -p -r1.60 f-lang.c
--- f-lang.c 20 Apr 2010 17:22:18 -0000 1.60
+++ f-lang.c 6 May 2010 23:35:37 -0000
@@ -150,7 +150,6 @@ f_printstr (struct ui_file *stream, stru
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
- int width = TYPE_LENGTH (type);
if (length == 0)
{
Index: jv-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/jv-lang.c,v
retrieving revision 1.83
diff -u -p -r1.83 jv-lang.c
--- jv-lang.c 22 Apr 2010 23:15:41 -0000 1.83
+++ jv-lang.c 6 May 2010 23:35:37 -0000
@@ -268,8 +268,10 @@ type_from_class (struct gdbarch *gdbarch
struct value *utf8_name;
char *nptr;
CORE_ADDR addr;
+#if 0
struct block *bl;
struct dict_iterator iter;
+#endif
int is_array = 0;
type = check_typedef (value_type (clas));
@@ -1053,7 +1055,6 @@ java_class_name_from_physname (const cha
{
char *ret = NULL;
const char *end;
- int depth = 0;
char *demangled_name = java_demangle (physname, DMGL_PARAMS | DMGL_ANSI);
if (demangled_name == NULL)
Index: m2-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/m2-lang.c,v
retrieving revision 1.55
diff -u -p -r1.55 m2-lang.c
--- m2-lang.c 22 Apr 2010 23:15:41 -0000 1.55
+++ m2-lang.c 6 May 2010 23:35:37 -0000
@@ -111,7 +111,6 @@ m2_printstr (struct ui_file *stream, str
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
- int width = TYPE_LENGTH (type);
if (length == 0)
{
Index: objc-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/objc-lang.c,v
retrieving revision 1.87
diff -u -p -r1.87 objc-lang.c
--- objc-lang.c 19 Apr 2010 19:51:38 -0000 1.87
+++ objc-lang.c 6 May 2010 23:35:37 -0000
@@ -350,7 +350,6 @@ objc_printstr (struct ui_file *stream, s
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
- int width = TYPE_LENGTH (type);
/* If the string was not truncated due to `set print elements', and
the last byte of it is a null, we don't print that, in
Index: ada-tasks.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-tasks.c,v
retrieving revision 1.29
diff -u -p -r1.29 ada-tasks.c
--- ada-tasks.c 16 Mar 2010 18:47:15 -0000 1.29
+++ ada-tasks.c 6 May 2010 23:35:37 -0000
@@ -293,7 +293,6 @@ get_known_tasks_addr (void)
if (ada_tasks_check_symbol_table)
{
- struct symbol *sym;
struct minimal_symbol *msym;
msym = lookup_minimal_symbol (KNOWN_TASKS_NAME, NULL, NULL);
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [patch] ada-lang, c-lang, f-lang, objc-lang, jv-lang, m2-lang, ada-tasks.c: delete unused variables
2010-05-06 23:39 [patch] ada-lang, c-lang, f-lang, objc-lang, jv-lang, m2-lang, ada-tasks.c: delete unused variables Michael Snyder
@ 2010-05-07 3:17 ` Joel Brobecker
2010-05-07 17:29 ` Tom Tromey
2010-05-07 18:23 ` Michael Snyder
0 siblings, 2 replies; 5+ messages in thread
From: Joel Brobecker @ 2010-05-07 3:17 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
> --- jv-lang.c 22 Apr 2010 23:15:41 -0000 1.83
> +++ jv-lang.c 6 May 2010 23:35:37 -0000
> @@ -268,8 +268,10 @@ type_from_class (struct gdbarch *gdbarch
> struct value *utf8_name;
> char *nptr;
> CORE_ADDR addr;
> +#if 0
> struct block *bl;
> struct dict_iterator iter;
> +#endif
Can you explain why using #if 0 instead of deleting these variables?
--
Joel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] ada-lang, c-lang, f-lang, objc-lang, jv-lang, m2-lang, ada-tasks.c: delete unused variables
2010-05-07 3:17 ` Joel Brobecker
@ 2010-05-07 17:29 ` Tom Tromey
2010-05-17 17:24 ` Joel Brobecker
2010-05-07 18:23 ` Michael Snyder
1 sibling, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2010-05-07 17:29 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Michael Snyder, gdb-patches
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
>> --- jv-lang.c 22 Apr 2010 23:15:41 -0000 1.83
>> +++ jv-lang.c 6 May 2010 23:35:37 -0000
>> @@ -268,8 +268,10 @@ type_from_class (struct gdbarch *gdbarch
>> struct value *utf8_name;
>> char *nptr;
>> CORE_ADDR addr;
>> +#if 0
>> struct block *bl;
>> struct dict_iterator iter;
>> +#endif
Joel> Can you explain why using #if 0 instead of deleting these variables?
I looked at that, too. There is (pseudo-)code that references these
variables, also in #if 0.
I think any code in jv-* that has been #if 0 for 10 years can be deleted
with no loss.
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] ada-lang, c-lang, f-lang, objc-lang, jv-lang, m2-lang, ada-tasks.c: delete unused variables
2010-05-07 17:29 ` Tom Tromey
@ 2010-05-17 17:24 ` Joel Brobecker
0 siblings, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2010-05-17 17:24 UTC (permalink / raw)
To: Tom Tromey; +Cc: Michael Snyder, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 415 bytes --]
> Joel> Can you explain why using #if 0 instead of deleting these variables?
>
> I looked at that, too. There is (pseudo-)code that references these
> variables, also in #if 0.
>
> I think any code in jv-* that has been #if 0 for 10 years can be deleted
> with no loss.
Definitely agree. Attached is what I just committed. I verified that
every one of the #if 0 was from 1999 (probably version 1.1!).
--
Joel
[-- Attachment #2: jv-lang.diff --]
[-- Type: text/x-diff, Size: 3339 bytes --]
commit 143c87d009f457090d320ab4b208447c32a32ce9
Author: Joel Brobecker <brobecker@adacore.com>
Date: Mon May 17 10:16:55 2010 -0700
Remove commented-out code in jv-lang.c
2010-05-17 Joel Brobecker <brobecker@adacore.com>
* jv-lang.c (java_lookup_class): Remove commented out code.
(type_from_class): Likewise.
(java_op_print_tab): Remove commented-out elements.
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 171527d..1797f35 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2010-05-17 Joel Brobecker <brobecker@adacore.com>
+ * jv-lang.c (java_lookup_class): Remove commented out code.
+ (type_from_class): Likewise.
+ (java_op_print_tab): Remove commented-out elements.
+
+2010-05-17 Joel Brobecker <brobecker@adacore.com>
+
* ada-lang.c (to_fixed_range_type): The the raw index type as
argument instead of the raw type name. Remove orig_type parameter.
Update calls throughout.
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index 2e700e3..53fd9a2 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -190,32 +190,8 @@ java_lookup_class (char *name)
sym = lookup_symbol (name, expression_context_block, STRUCT_DOMAIN, NULL);
if (sym != NULL)
return SYMBOL_TYPE (sym);
-#if 0
- CORE_ADDR addr;
-
- if (called from parser)
- {
- call lookup_class (or similar) in inferior;
- if not
- found:
- return NULL;
- addr = found in inferior;
- }
- else
- addr = 0;
- struct type *type;
-
- type = alloc_type (objfile);
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
- INIT_CPLUS_SPECIFIC (type);
- TYPE_TAG_NAME (type) = obsavestring (name, strlen (name), &objfile->objfile_obstack);
- TYPE_STUB (type) = 1;
- TYPE ? = addr;
- return type;
-#else
/* FIXME - should search inferior's symbol table. */
return NULL;
-#endif
}
/* Return a nul-terminated string (allocated on OBSTACK) for
@@ -276,10 +252,6 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas)
struct value *utf8_name;
char *nptr;
CORE_ADDR addr;
-#if 0
- struct block *bl;
- struct dict_iterator iter;
-#endif
int is_array = 0;
type = check_typedef (value_type (clas));
@@ -291,16 +263,6 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas)
}
addr = value_address (clas);
-#if 0
- get_java_class_symtab ();
- bl = BLOCKVECTOR_BLOCK (BLOCKVECTOR (class_symtab), GLOBAL_BLOCK);
- ALL_BLOCK_SYMBOLS (block, iter, sym)
- {
- if (SYMBOL_VALUE_ADDRESS (sym) == addr)
- return SYMBOL_TYPE (sym);
- }
-#endif
-
objfile = get_dynamics_objfile (gdbarch);
if (java_class_is_primitive (clas))
{
@@ -1114,9 +1076,6 @@ const struct op_print java_op_print_tab[] =
{"<", BINOP_LESS, PREC_ORDER, 0},
{">>", BINOP_RSH, PREC_SHIFT, 0},
{"<<", BINOP_LSH, PREC_SHIFT, 0},
-#if 0
- {">>>", BINOP_ ? ? ?, PREC_SHIFT, 0},
-#endif
{"+", BINOP_ADD, PREC_ADD, 0},
{"-", BINOP_SUB, PREC_ADD, 0},
{"*", BINOP_MUL, PREC_MUL, 0},
@@ -1126,9 +1085,6 @@ const struct op_print java_op_print_tab[] =
{"!", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
{"~", UNOP_COMPLEMENT, PREC_PREFIX, 0},
{"*", UNOP_IND, PREC_PREFIX, 0},
-#if 0
- {"instanceof", ? ? ?, ? ? ?, 0},
-#endif
{"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
{"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
{NULL, 0, 0, 0}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] ada-lang, c-lang, f-lang, objc-lang, jv-lang, m2-lang, ada-tasks.c: delete unused variables
2010-05-07 3:17 ` Joel Brobecker
2010-05-07 17:29 ` Tom Tromey
@ 2010-05-07 18:23 ` Michael Snyder
1 sibling, 0 replies; 5+ messages in thread
From: Michael Snyder @ 2010-05-07 18:23 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
Joel Brobecker wrote:
>> --- jv-lang.c 22 Apr 2010 23:15:41 -0000 1.83
>> +++ jv-lang.c 6 May 2010 23:35:37 -0000
>> @@ -268,8 +268,10 @@ type_from_class (struct gdbarch *gdbarch
>> struct value *utf8_name;
>> char *nptr;
>> CORE_ADDR addr;
>> +#if 0
>> struct block *bl;
>> struct dict_iterator iter;
>> +#endif
>
> Can you explain why using #if 0 instead of deleting these variables?
>
Because they are used in the #if 0 block just below.
Alternatively, we could remove both the variables and the #if 0 block.
Michael
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-17 17:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-06 23:39 [patch] ada-lang, c-lang, f-lang, objc-lang, jv-lang, m2-lang, ada-tasks.c: delete unused variables Michael Snyder
2010-05-07 3:17 ` Joel Brobecker
2010-05-07 17:29 ` Tom Tromey
2010-05-17 17:24 ` Joel Brobecker
2010-05-07 18:23 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox