From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8590 invoked by alias); 27 Nov 2009 10:20:15 -0000 Received: (qmail 8566 invoked by uid 22791); 27 Nov 2009 10:20:11 -0000 X-SWARE-Spam-Status: No, hits=0.4 required=5.0 tests=AWL,BAYES_00,KAM_STOCKTIP X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Nov 2009 10:20:04 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 41D3C29006E for ; Fri, 27 Nov 2009 11:20:02 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P+UtHs4XcwSL for ; Fri, 27 Nov 2009 11:20:01 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 863A5290061 for ; Fri, 27 Nov 2009 11:20:01 +0100 (CET) From: Tristan Gingold Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [RFA] clean-up of sym_read mainline flag (1/2) Date: Fri, 27 Nov 2009 10:20:00 -0000 Message-Id: <41F206A6-E60C-4A55-B4F1-CC1C00626188@adacore.com> To: gdb-patches ml Mime-Version: 1.0 (Apple Message framework v1077) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-11/txt/msg00583.txt.bz2 Hi, this is preliminary work to make dsym files working better on Darwin. The mainline flag from sym_read routines was passed as argument to functions that doesn't use it. To clean-up a little bit and to make the code more readable, this patch removes this unused parameter. No regression on linux x86-64. Tristan. 2009-11-26 Tristan Gingold * dwarf2read.c (dwarf2_build_psymtabs_easy): Remove mainline parameter. (dwarf2_build_psymtabs_hard): Ditto. (dwarf2_build_psymtabs): Ajust calls. * stabsread.h (elfstab_build_psymtabs): Remove mainline parameter on the prototype. (coffstab_build_psymtabs): Ditto. (stabsect_build_psymtabs): Ditto. * dbxread.c (coffstab_build_psymtabs): Remove mainline parameter on the definition. (elfstab_build_psymtabs): Ditto. (stabsect_build_psymtabs): Ditto. * coffread.c (coff_symfile_read): Adjust call. * elfread.c (elf_symfile_read): Ditto. * somread.c (som_symfile_read): Ditto. --- diff --git a/gdb/coffread.c b/gdb/coffread.c index 98c563a..d66312b 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -634,7 +634,6 @@ coff_symfile_read (struct objfile *objfile, int mainlin= e) stabstrsize =3D bfd_section_size (abfd, info->stabstrsect); =20 coffstab_build_psymtabs (objfile, - mainline, info->textaddr, info->textsize, info->stabsects, info->stabstrsect->filepos, stabstrsize); diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 6d4c893..aad25b7 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -3332,7 +3332,7 @@ no enclosing block")); adjusted for coff details. */ =20 void -coffstab_build_psymtabs (struct objfile *objfile, int mainline, +coffstab_build_psymtabs (struct objfile *objfile, CORE_ADDR textaddr, unsigned int textsize, struct stab_section_list *stabsects, file_ptr stabstroffset, unsigned int stabstrsize) @@ -3425,8 +3425,7 @@ coffstab_build_psymtabs (struct objfile *objfile, int= mainline, adjusted for elf details. */ =20 void -elfstab_build_psymtabs (struct objfile *objfile, int mainline, - asection *stabsect, +elfstab_build_psymtabs (struct objfile *objfile, asection *stabsect, file_ptr stabstroffset, unsigned int stabstrsize) { int val; @@ -3509,7 +3508,7 @@ elfstab_build_psymtabs (struct objfile *objfile, int = mainline, This routine is mostly copied from dbx_symfile_init and dbx_symfile_rea= d. */ =20 void -stabsect_build_psymtabs (struct objfile *objfile, int mainline, char *stab= _name, +stabsect_build_psymtabs (struct objfile *objfile, char *stab_name, char *stabstr_name, char *text_name) { int val; diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 906bbfc..0fa63a5 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -769,7 +769,7 @@ dwarf2_invalid_attrib_class_complaint (const char *arg1= , const char *arg2) static void dwarf2_locate_sections (bfd *, asection *, void *); =20 #if 0 -static void dwarf2_build_psymtabs_easy (struct objfile *, int); +static void dwarf2_build_psymtabs_easy (struct objfile *); #endif =20 static void dwarf2_create_include_psymtab (char *, struct partial_symtab *, @@ -779,7 +779,7 @@ static void dwarf2_build_include_psymtabs (struct dwarf= 2_cu *, struct die_info *, struct partial_symtab *); =20 -static void dwarf2_build_psymtabs_hard (struct objfile *, int); +static void dwarf2_build_psymtabs_hard (struct objfile *); =20 static void scan_partial_symbols (struct partial_die_info *, CORE_ADDR *, CORE_ADDR *, @@ -1474,14 +1474,14 @@ dwarf2_build_psymtabs (struct objfile *objfile, int= mainline) /* Things are significantly easier if we have .debug_aranges and .debug_pubnames sections */ =20 - dwarf2_build_psymtabs_easy (objfile, mainline); + dwarf2_build_psymtabs_easy (objfile); } else #endif /* only test this case for now */ { /* In this case we have to work a bit harder */ - dwarf2_build_psymtabs_hard (objfile, mainline); + dwarf2_build_psymtabs_hard (objfile); } } =20 @@ -1490,7 +1490,7 @@ dwarf2_build_psymtabs (struct objfile *objfile, int m= ainline) .debug_pubnames and .debug_aranges sections. */ =20 static void -dwarf2_build_psymtabs_easy (struct objfile *objfile, int mainline) +dwarf2_build_psymtabs_easy (struct objfile *objfile) { bfd *abfd =3D objfile->obfd; char *aranges_buffer, *pubnames_buffer; @@ -2075,7 +2075,7 @@ build_type_psymtabs (struct objfile *objfile) .debug_info and .debug_abbrev sections. */ =20 static void -dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline) +dwarf2_build_psymtabs_hard (struct objfile *objfile) { /* Instead of reading this into a big buffer, we should probably use mmap() on architectures that support it. (FIXME) */ diff --git a/gdb/elfread.c b/gdb/elfread.c index 0885240..b9e1568 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -736,7 +736,6 @@ elf_symfile_read (struct objfile *objfile, int mainline) /* FIXME should probably warn about a stab section without a stabstr= . */ if (str_sect) elfstab_build_psymtabs (objfile, - mainline, ei.stabsect, str_sect->filepos, bfd_section_size (abfd, str_sect)); diff --git a/gdb/somread.c b/gdb/somread.c index 36a2b28..d519d2c 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -340,7 +340,7 @@ som_symfile_read (struct objfile *objfile, int mainline) =20 /* Now read information from the stabs debug sections. This is emitted by gcc. */ - stabsect_build_psymtabs (objfile, mainline, + stabsect_build_psymtabs (objfile, "$GDB_SYMBOLS$", "$GDB_STRINGS$", "$TEXT$"); } =20 diff --git a/gdb/stabsread.h b/gdb/stabsread.h index 83458d1..19cc863 100644 --- a/gdb/stabsread.h +++ b/gdb/stabsread.h @@ -175,21 +175,18 @@ extern void process_one_symbol (int, int, CORE_ADDR, = char *, struct section_offsets *, struct objfile *); =20 extern void elfstab_build_psymtabs (struct objfile *objfile, - int mainline, asection *stabsect, file_ptr stabstroffset, unsigned int stabstrsize); =20 extern void coffstab_build_psymtabs (struct objfile *objfile, - int mainline, CORE_ADDR textaddr, unsigned int textsize, struct stab_section_list *stabs, file_ptr stabstroffset, unsigned int stabstrsize); =20 -extern void stabsect_build_psymtabs - (struct objfile *objfile, - int mainline, char *stab_name, char *stabstr_name, char *text_name); +extern void stabsect_build_psymtabs (struct objfile *objfile, char *stab_n= ame, + char *stabstr_name, char *text_name); =20 extern void elfstab_offset_sections (struct objfile *, struct partial_symtab *); --=20 1.6.2