From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31414 invoked by alias); 13 Jun 2003 14:13:59 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 31382 invoked from network); 13 Jun 2003 14:13:57 -0000 Received: from unknown (HELO cam-admin0.cambridge.arm.com) (193.131.176.54) by sources.redhat.com with SMTP; 13 Jun 2003 14:13:57 -0000 Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [10.1.205.4]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id PAA01503; Fri, 13 Jun 2003 15:13:56 +0100 (BST) Received: from pc960.cambridge.arm.com (rearnsha@localhost) by pc960.cambridge.arm.com (8.11.6/8.9.3) with ESMTP id h5DEDuQ01304; Fri, 13 Jun 2003 15:13:56 +0100 Message-Id: <200306131413.h5DEDuQ01304@pc960.cambridge.arm.com> X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha owned process doing -bs To: Andrew Cagney cc: Richard.Earnshaw@arm.com, gdb-patches@sources.redhat.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. X-Url: http://www.arm.com/ Subject: Re: [patch rfc] -Wmissing-prototypes round #3 In-reply-to: Your message of "Thu, 12 Jun 2003 13:08:58 EDT." <3EE8B3AA.9020902@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="==_Exmh_2911529980" Date: Fri, 13 Jun 2003 14:13:00 -0000 From: Richard Earnshaw X-SW-Source: 2003-06/txt/msg00466.txt.bz2 This is a multipart MIME message. --==_Exmh_2911529980 Content-Type: text/plain; charset=us-ascii Content-length: 988 > > ac131313@redhat.com said: > > > >> * config/arm/tm-linux.h (arm_linux_svr4_fetch_link_map_offsets): > >> Delete declaration, moved to "arm-tdep.h". Include "arm-tdep.h". > >> * arm-tdep.h: Add ARM_TDEP_H wrapper. > >> (arm_linux_svr4_fetch_link_map_offsets): Declare. > > > > > > arm_linux_svr4_fetch_link_map_offsets should be moved from arm-tdep.c to > > armlinux-tdep.c. Then it can be made private to that file; it doesn't > > belong in the generic ARM code. > > Please be my guest, it will simplify my -Wmissing-prototypes patch. > Done. 2003-06-13 Richard Earnshaw * arm-tdep.c (solib-svr4.h): Dont' include it. (arm_linux_svr4_fetch_link_map_offsets): Move to ... * arm-linux-tdep.c: ... here. Make static. (arm_linux_init_abi): Register it. (solib-svr4.h): Include it. * Makefile.in: Update dependencies. * config/arm/tm-linux.h (SVR4_FETCH_LINK_MAP_OFFSETS): Delete. (arm_linux_svr4_fetch_link_map_offsets): Delete declaration. --==_Exmh_2911529980 Content-Type: text/plain ; name="linux-svr4.patch"; charset=us-ascii Content-Description: linux-svr4.patch Content-Disposition: attachment; filename="linux-svr4.patch" Content-length: 6631 Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.402 diff -p -r1.402 Makefile.in *** Makefile.in 12 Jun 2003 18:01:28 -0000 1.402 --- Makefile.in 13 Jun 2003 13:16:24 -0000 *************** arm-linux-nat.o: arm-linux-nat.c $(defs_ *** 1552,1561 **** arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \ $(gdbtypes_h) $(floatformat_h) $(gdbcore_h) $(frame_h) $(regcache_h) \ $(doublest_h) $(arm_tdep_h) $(symtab_h) $(symfile_h) $(objfiles_h) \ ! $(osabi_h) arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \ $(gdbcore_h) $(symfile_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) \ ! $(doublest_h) $(value_h) $(arch_utils_h) $(solib_svr4_h) $(osabi_h) \ $(arm_tdep_h) $(sim_arm_h) $(elf_bfd_h) $(coff_internal_h) \ $(elf_arm_h) $(gdb_assert_h) armnbsd-nat.o: armnbsd-nat.c $(defs_h) $(arm_tdep_h) $(inferior_h) \ --- 1552,1561 ---- arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \ $(gdbtypes_h) $(floatformat_h) $(gdbcore_h) $(frame_h) $(regcache_h) \ $(doublest_h) $(arm_tdep_h) $(symtab_h) $(symfile_h) $(objfiles_h) \ ! $(solib_svr4_h) $(osabi_h) arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \ $(gdbcore_h) $(symfile_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) \ ! $(doublest_h) $(value_h) $(arch_utils_h) $(osabi_h) \ $(arm_tdep_h) $(sim_arm_h) $(elf_bfd_h) $(coff_internal_h) \ $(elf_arm_h) $(gdb_assert_h) armnbsd-nat.o: armnbsd-nat.c $(defs_h) $(arm_tdep_h) $(inferior_h) \ Index: arm-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/arm-linux-tdep.c,v retrieving revision 1.34 diff -p -r1.34 arm-linux-tdep.c *** arm-linux-tdep.c 2 Jun 2003 02:09:39 -0000 1.34 --- arm-linux-tdep.c 13 Jun 2003 13:16:24 -0000 *************** *** 27,32 **** --- 27,33 ---- #include "frame.h" #include "regcache.h" #include "doublest.h" + #include "solib-svr4.h" #include "osabi.h" #include "arm-tdep.h" *************** find_minsym_and_objfile (char *name, str *** 376,381 **** --- 377,425 ---- } + /* Fetch, and possibly build, an appropriate link_map_offsets structure + for ARM linux targets using the struct offsets defined in . + Note, however, that link.h is not actually referred to in this file. + Instead, the relevant structs offsets were obtained from examining + link.h. (We can't refer to link.h from this file because the host + system won't necessarily have it, or if it does, the structs which + it defines will refer to the host system, not the target). */ + + static struct link_map_offsets * + arm_linux_svr4_fetch_link_map_offsets (void) + { + static struct link_map_offsets lmo; + static struct link_map_offsets *lmp = 0; + + if (lmp == 0) + { + lmp = &lmo; + + lmo.r_debug_size = 8; /* Actual size is 20, but this is all we + need. */ + + lmo.r_map_offset = 4; + lmo.r_map_size = 4; + + lmo.link_map_size = 20; /* Actual size is 552, but this is all we + need. */ + + lmo.l_addr_offset = 0; + lmo.l_addr_size = 4; + + lmo.l_name_offset = 4; + lmo.l_name_size = 4; + + lmo.l_next_offset = 12; + lmo.l_next_size = 4; + + lmo.l_prev_offset = 16; + lmo.l_prev_size = 4; + } + + return lmp; + } + static CORE_ADDR skip_hurd_resolver (CORE_ADDR pc) { *************** arm_linux_init_abi (struct gdbarch_info *** 529,534 **** --- 573,581 ---- tdep->jb_pc = ARM_LINUX_JB_PC; tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE; + + set_solib_svr4_fetch_link_map_offsets + (gdbarch, arm_linux_svr4_fetch_link_map_offsets); set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_linux_call_dummy_words); set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (arm_linux_call_dummy_words)); Index: arm-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/arm-tdep.c,v retrieving revision 1.141 diff -p -r1.141 arm-tdep.c *** arm-tdep.c 13 Jun 2003 04:40:30 -0000 1.141 --- arm-tdep.c 13 Jun 2003 13:16:25 -0000 *************** arm_othernames (char *names, int n) *** 2668,2716 **** set_disassembly_style (); } - /* Fetch, and possibly build, an appropriate link_map_offsets structure - for ARM linux targets using the struct offsets defined in . - Note, however, that link.h is not actually referred to in this file. - Instead, the relevant structs offsets were obtained from examining - link.h. (We can't refer to link.h from this file because the host - system won't necessarily have it, or if it does, the structs which - it defines will refer to the host system, not the target). */ - - struct link_map_offsets * - arm_linux_svr4_fetch_link_map_offsets (void) - { - static struct link_map_offsets lmo; - static struct link_map_offsets *lmp = 0; - - if (lmp == 0) - { - lmp = &lmo; - - lmo.r_debug_size = 8; /* Actual size is 20, but this is all we - need. */ - - lmo.r_map_offset = 4; - lmo.r_map_size = 4; - - lmo.link_map_size = 20; /* Actual size is 552, but this is all we - need. */ - - lmo.l_addr_offset = 0; - lmo.l_addr_size = 4; - - lmo.l_name_offset = 4; - lmo.l_name_size = 4; - - lmo.l_next_offset = 12; - lmo.l_next_size = 4; - - lmo.l_prev_offset = 16; - lmo.l_prev_size = 4; - } - - return lmp; - } - /* Test whether the coff symbol specific value corresponds to a Thumb function. */ --- 2668,2673 ---- Index: config/arm/tm-linux.h =================================================================== RCS file: /cvs/src/src/gdb/config/arm/tm-linux.h,v retrieving revision 1.17 diff -p -r1.17 tm-linux.h *** config/arm/tm-linux.h 5 Jun 2002 19:18:16 -0000 1.17 --- config/arm/tm-linux.h 13 Jun 2003 13:16:25 -0000 *************** *** 30,39 **** #include "config/tm-linux.h" - /* Use target-specific function to define link map offsets. */ - extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void); - #define SVR4_FETCH_LINK_MAP_OFFSETS() arm_linux_svr4_fetch_link_map_offsets () - /* Offset to saved PC in sigcontext structure, from */ #define SIGCONTEXT_PC_OFFSET (sizeof(unsigned long) * 18) --- 30,35 ---- --==_Exmh_2911529980--