* [patch] cleanup: Wunused coff-pe-read
@ 2013-01-31 4:08 Aleksandar Ristovski
2013-03-29 5:59 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Aleksandar Ristovski @ 2013-01-31 4:08 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 594 bytes --]
Hello,
This is removing unused variables and allows compiling with -Wunused.
Thanks,
Aleksandar Ristovski
QNX Software Systems
ChangeLog:
Aleksandar Ristovski <aristovski@qnx.com>
* coff-pe-read.c (add_pe_exported_sym): Remove unused DLL_NAME_LEN.
(add_pe_forwarded_sym): Remove unused SECTION, DLL_NAME_LEN.
(read_pe_exported_syms): Remove unused EXPORTIX.
(pe_text_section_offset): Remove unused OPTHDR_OFS, NUM_ENTRIES,
EXPORT_RVA, EXPORT_SIZE, EXPPTR, EXP_FUNCBASE, EXPDATA,
ERVA, NAME_RVAS, ORDINALS, NEXP, ORDBASE, DLL_NAME.
[-- Attachment #2: Wunused-coff-pe-read-201301300110.patch --]
[-- Type: text/x-patch, Size: 2772 bytes --]
Index: gdb/coff-pe-read.c
===================================================================
RCS file: /cvs/src/src/gdb/coff-pe-read.c,v
retrieving revision 1.23
diff -u -p -r1.23 coff-pe-read.c
--- gdb/coff-pe-read.c 1 Jan 2013 06:32:40 -0000 1.23
+++ gdb/coff-pe-read.c 30 Jan 2013 22:25:14 -0000
@@ -158,7 +158,6 @@ add_pe_exported_sym (const char *sym_nam
char *qualified_name, *bare_name;
/* Add the stored offset to get the loaded address of the symbol. */
CORE_ADDR vma = func_rva + section_data->vma_offset;
- int dll_name_len = strlen (dll_name);
/* Generate a (hopefully unique) qualified name using the first part
of the dll name, e.g. KERNEL32!AddAtomA. This matches the style
@@ -205,9 +204,7 @@ add_pe_forwarded_sym (const char *sym_na
CORE_ADDR vma;
struct objfile *forward_objfile;
struct minimal_symbol *msymbol;
- short section;
enum minimal_symbol_type msymtype;
- int dll_name_len = strlen (dll_name);
char *qualified_name, *bare_name;
int forward_dll_name_len = strlen (forward_dll_name);
int forward_func_name_len = strlen (forward_func_name);
@@ -247,7 +244,6 @@ add_pe_forwarded_sym (const char *sym_na
sym_name, dll_name, forward_qualified_name);
vma = SYMBOL_VALUE_ADDRESS (msymbol);
- section = SYMBOL_SECTION (msymbol);
msymtype = MSYMBOL_TYPE (msymbol);
/* Generate a (hopefully unique) qualified name using the first part
@@ -336,7 +332,6 @@ read_pe_exported_syms (struct objfile *o
unsigned long name_rvas, ordinals, nexp, ordbase;
char *dll_name = (char *) dll->filename;
int otherix = PE_SECTION_TABLE_SIZE;
- int exportix = -1;
int is_pe64 = 0;
int is_pe32 = 0;
@@ -437,7 +432,6 @@ read_pe_exported_syms (struct objfile *o
" for dll \"%s\": 0x%lx instead of 0x%lx\n"),
dll_name, export_opthdrrva, vaddr);
expptr = fptr + (export_opthdrrva - vaddr);
- exportix = i;
break;
}
}
@@ -632,12 +626,8 @@ CORE_ADDR
pe_text_section_offset (struct bfd *abfd)
{
- unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
- unsigned long export_rva, export_size, nsections, secptr, expptr;
- unsigned long exp_funcbase;
- unsigned char *expdata, *erva;
- unsigned long name_rvas, ordinals, nexp, ordbase;
- char *dll_name;
+ unsigned long pe_header_offset, i;
+ unsigned long nsections, secptr;
int is_pe64 = 0;
int is_pe32 = 0;
char const *target;
@@ -664,7 +654,6 @@ pe_text_section_offset (struct bfd *abfd
/* Get pe_header, optional header and numbers of sections. */
pe_header_offset = pe_get32 (abfd, 0x3c);
- opthdr_ofs = pe_header_offset + 4 + 20;
nsections = pe_get16 (abfd, pe_header_offset + 4 + 2);
secptr = (pe_header_offset + 4 + 20 +
pe_get16 (abfd, pe_header_offset + 4 + 16));
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] cleanup: Wunused coff-pe-read
2013-01-31 4:08 [patch] cleanup: Wunused coff-pe-read Aleksandar Ristovski
@ 2013-03-29 5:59 ` Joel Brobecker
2013-04-01 12:54 ` Aleksandar Ristovski
0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2013-03-29 5:59 UTC (permalink / raw)
To: Aleksandar Ristovski; +Cc: gdb-patches
> Aleksandar Ristovski <aristovski@qnx.com>
>
> * coff-pe-read.c (add_pe_exported_sym): Remove unused DLL_NAME_LEN.
> (add_pe_forwarded_sym): Remove unused SECTION, DLL_NAME_LEN.
> (read_pe_exported_syms): Remove unused EXPORTIX.
> (pe_text_section_offset): Remove unused OPTHDR_OFS, NUM_ENTRIES,
> EXPORT_RVA, EXPORT_SIZE, EXPPTR, EXP_FUNCBASE, EXPDATA,
> ERVA, NAME_RVAS, ORDINALS, NEXP, ORDBASE, DLL_NAME.
Approved. One nit: all-cap ENTITY_NAME means "the value of entity_name".
You are removing the entities themselves, so their name should not
be capitalized. I missed that in the two other patches I just approved.
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] cleanup: Wunused coff-pe-read
2013-03-29 5:59 ` Joel Brobecker
@ 2013-04-01 12:54 ` Aleksandar Ristovski
2013-04-01 13:29 ` Aleksandar Ristovski
0 siblings, 1 reply; 4+ messages in thread
From: Aleksandar Ristovski @ 2013-04-01 12:54 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On 13-03-28 08:29 PM, Joel Brobecker wrote:
>> Aleksandar Ristovski <aristovski@qnx.com>
>>
>> * coff-pe-read.c (add_pe_exported_sym): Remove unused DLL_NAME_LEN.
>> (add_pe_forwarded_sym): Remove unused SECTION, DLL_NAME_LEN.
>> (read_pe_exported_syms): Remove unused EXPORTIX.
>> (pe_text_section_offset): Remove unused OPTHDR_OFS, NUM_ENTRIES,
>> EXPORT_RVA, EXPORT_SIZE, EXPPTR, EXP_FUNCBASE, EXPDATA,
>> ERVA, NAME_RVAS, ORDINALS, NEXP, ORDBASE, DLL_NAME.
>
> Approved. One nit: all-cap ENTITY_NAME means "the value of entity_name".
> You are removing the entities themselves, so their name should not
> be capitalized. I missed that in the two other patches I just approved.
>
>
Committed with corrected capitalization of removed entities.
http://sourceware.org/ml/gdb-cvs/2013-04/msg00004.html
Thank you,
Aleksandar Ristovski
QNX Software Systems
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] cleanup: Wunused coff-pe-read
2013-04-01 12:54 ` Aleksandar Ristovski
@ 2013-04-01 13:29 ` Aleksandar Ristovski
0 siblings, 0 replies; 4+ messages in thread
From: Aleksandar Ristovski @ 2013-04-01 13:29 UTC (permalink / raw)
To: gdb-patches; +Cc: gdb-patches
On 13-03-28 08:29 PM, Joel Brobecker wrote:
>> Aleksandar Ristovski <aristovski@qnx.com>
>>
>> * coff-pe-read.c (add_pe_exported_sym): Remove unused DLL_NAME_LEN.
>> (add_pe_forwarded_sym): Remove unused SECTION, DLL_NAME_LEN.
>> (read_pe_exported_syms): Remove unused EXPORTIX.
>> (pe_text_section_offset): Remove unused OPTHDR_OFS, NUM_ENTRIES,
>> EXPORT_RVA, EXPORT_SIZE, EXPPTR, EXP_FUNCBASE, EXPDATA,
>> ERVA, NAME_RVAS, ORDINALS, NEXP, ORDBASE, DLL_NAME.
>
> Approved. One nit: all-cap ENTITY_NAME means "the value of entity_name".
> You are removing the entities themselves, so their name should not
> be capitalized. I missed that in the two other patches I just approved.
>
>
Committed with corrected capitalization of removed entities.
http://sourceware.org/ml/gdb-cvs/2013-04/msg00004.html
Thank you,
Aleksandar Ristovski
QNX Software Systems
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-01 12:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-31 4:08 [patch] cleanup: Wunused coff-pe-read Aleksandar Ristovski
2013-03-29 5:59 ` Joel Brobecker
2013-04-01 12:54 ` Aleksandar Ristovski
2013-04-01 13:29 ` Aleksandar Ristovski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox