From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22915 invoked by alias); 15 Mar 2004 22:39:22 -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 22844 invoked from network); 15 Mar 2004 22:39:19 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 15 Mar 2004 22:39:19 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i2FMdHrp000289 for ; Mon, 15 Mar 2004 23:39:17 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i2FMdHSL000355 for ; Mon, 15 Mar 2004 23:39:17 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i2FMdHXl000352; Mon, 15 Mar 2004 23:39:17 +0100 (CET) Date: Fri, 19 Mar 2004 00:09:00 -0000 Message-Id: <200403152239.i2FMdHXl000352@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [PATCH] A i386-linux-tdep.c cleanup X-SW-Source: 2004-03/txt/msg00342.txt.bz2 This makes us use the generic SVR4 link map offsets on GNU/Linux i386. Committed, Mark Index: ChangeLog from Mark Kettenis * i386-linux-tdep.c: Update copyright year. (i386_linux_svr4_fetch_link_map_offsets): Remove function. (i386_linux_init_abi): Set solib_svr4_fetch_link_maop_offsets to svr4_ilp32_link_map_offsets instead of i386_linux_svr4_fetch_link_map_offsets. Index: i386-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v retrieving revision 1.35 diff -u -p -r1.35 i386-linux-tdep.c --- i386-linux-tdep.c 6 Feb 2004 20:24:50 -0000 1.35 +++ i386-linux-tdep.c 15 Mar 2004 22:34:00 -0000 @@ -1,6 +1,6 @@ -/* Target-dependent code for GNU/Linux running on i386's, for GDB. +/* Target-dependent code for GNU/Linux i386. - Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -27,13 +27,13 @@ #include "inferior.h" #include "osabi.h" #include "reggroups.h" -#include "solib-svr4.h" #include "gdb_string.h" #include "i386-tdep.h" #include "i386-linux-tdep.h" #include "glibc-tdep.h" +#include "solib-svr4.h" /* Return the name of register REG. */ @@ -306,47 +306,6 @@ i386_linux_write_pc (CORE_ADDR pc, ptid_ write_register_pid (I386_LINUX_ORIG_EAX_REGNUM, -1, ptid); } -/* Fetch (and possibly build) an appropriate link_map_offsets - structure for native GNU/Linux x86 targets using the struct offsets - defined in link.h (but without actual reference to that file). - - This makes it possible to access GNU/Linux x86 shared libraries - from a GDB that was not built on an GNU/Linux x86 host (for cross - debugging). */ - -static struct link_map_offsets * -i386_linux_svr4_fetch_link_map_offsets (void) -{ - static struct link_map_offsets lmo; - static struct link_map_offsets *lmp = NULL; - - if (lmp == NULL) - { - lmp = &lmo; - - lmo.r_debug_size = 8; /* The actual size is 20 bytes, but - this is all we need. */ - lmo.r_map_offset = 4; - lmo.r_map_size = 4; - - lmo.link_map_size = 20; /* The actual size is 552 bytes, 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; -} - /* The register sets used in GNU/Linux ELF core-dumps are identical to the register sets in `struct user' that are used for a.out @@ -445,9 +404,12 @@ i386_linux_init_abi (struct gdbarch_info to support backtracing through calls to signal handlers. */ set_gdbarch_pc_in_sigtramp (gdbarch, i386_linux_pc_in_sigtramp); + /* GNU/Linux uses SVR4-style shared libraries. */ + set_solib_svr4_fetch_link_map_offsets + (gdbarch, svr4_ilp32_fetch_link_map_offsets); + + /* GNU/Linux uses the dynamic linker included in the GNU C Library. */ set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver); - set_solib_svr4_fetch_link_map_offsets (gdbarch, - i386_linux_svr4_fetch_link_map_offsets); } /* Provide a prototype to silence -Wmissing-prototypes. */ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22915 invoked by alias); 15 Mar 2004 22:39:22 -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 22844 invoked from network); 15 Mar 2004 22:39:19 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 15 Mar 2004 22:39:19 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i2FMdHrp000289 for ; Mon, 15 Mar 2004 23:39:17 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i2FMdHSL000355 for ; Mon, 15 Mar 2004 23:39:17 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i2FMdHXl000352; Mon, 15 Mar 2004 23:39:17 +0100 (CET) Date: Mon, 15 Mar 2004 22:39:00 -0000 Message-ID: <200403152239.i2FMdHXl000352@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [PATCH] A i386-linux-tdep.c cleanup X-SW-Source: 2004-03.o/txt/msg00342.txt Message-ID: <20040315223900.C44iTO2VyUDNEfa6j16RuMRWwW9xeUrTqveCc7Iau2c@z> This makes us use the generic SVR4 link map offsets on GNU/Linux i386. Committed, Mark Index: ChangeLog from Mark Kettenis * i386-linux-tdep.c: Update copyright year. (i386_linux_svr4_fetch_link_map_offsets): Remove function. (i386_linux_init_abi): Set solib_svr4_fetch_link_maop_offsets to svr4_ilp32_link_map_offsets instead of i386_linux_svr4_fetch_link_map_offsets. Index: i386-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v retrieving revision 1.35 diff -u -p -r1.35 i386-linux-tdep.c --- i386-linux-tdep.c 6 Feb 2004 20:24:50 -0000 1.35 +++ i386-linux-tdep.c 15 Mar 2004 22:34:00 -0000 @@ -1,6 +1,6 @@ -/* Target-dependent code for GNU/Linux running on i386's, for GDB. +/* Target-dependent code for GNU/Linux i386. - Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -27,13 +27,13 @@ #include "inferior.h" #include "osabi.h" #include "reggroups.h" -#include "solib-svr4.h" #include "gdb_string.h" #include "i386-tdep.h" #include "i386-linux-tdep.h" #include "glibc-tdep.h" +#include "solib-svr4.h" /* Return the name of register REG. */ @@ -306,47 +306,6 @@ i386_linux_write_pc (CORE_ADDR pc, ptid_ write_register_pid (I386_LINUX_ORIG_EAX_REGNUM, -1, ptid); } -/* Fetch (and possibly build) an appropriate link_map_offsets - structure for native GNU/Linux x86 targets using the struct offsets - defined in link.h (but without actual reference to that file). - - This makes it possible to access GNU/Linux x86 shared libraries - from a GDB that was not built on an GNU/Linux x86 host (for cross - debugging). */ - -static struct link_map_offsets * -i386_linux_svr4_fetch_link_map_offsets (void) -{ - static struct link_map_offsets lmo; - static struct link_map_offsets *lmp = NULL; - - if (lmp == NULL) - { - lmp = &lmo; - - lmo.r_debug_size = 8; /* The actual size is 20 bytes, but - this is all we need. */ - lmo.r_map_offset = 4; - lmo.r_map_size = 4; - - lmo.link_map_size = 20; /* The actual size is 552 bytes, 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; -} - /* The register sets used in GNU/Linux ELF core-dumps are identical to the register sets in `struct user' that are used for a.out @@ -445,9 +404,12 @@ i386_linux_init_abi (struct gdbarch_info to support backtracing through calls to signal handlers. */ set_gdbarch_pc_in_sigtramp (gdbarch, i386_linux_pc_in_sigtramp); + /* GNU/Linux uses SVR4-style shared libraries. */ + set_solib_svr4_fetch_link_map_offsets + (gdbarch, svr4_ilp32_fetch_link_map_offsets); + + /* GNU/Linux uses the dynamic linker included in the GNU C Library. */ set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver); - set_solib_svr4_fetch_link_map_offsets (gdbarch, - i386_linux_svr4_fetch_link_map_offsets); } /* Provide a prototype to silence -Wmissing-prototypes. */