From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7038 invoked by alias); 5 Oct 2007 13:28:11 -0000 Received: (qmail 7012 invoked by uid 22791); 5 Oct 2007 13:28:07 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.29.156) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 05 Oct 2007 13:28:04 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.8/8.13.8) with ESMTP id l95DS0vY283524 for ; Fri, 5 Oct 2007 13:28:00 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l95DS07m2179160 for ; Fri, 5 Oct 2007 15:28:00 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l95DRxxe018642 for ; Fri, 5 Oct 2007 15:28:00 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l95DRx9u018639; Fri, 5 Oct 2007 15:27:59 +0200 Message-Id: <200710051327.l95DRx9u018639@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 5 Oct 2007 15:27:59 +0200 Subject: [rfc/rft] Remove DEPRECATED_PC_REQUIRED_RUN_BEFORE_USE To: gdb-patches@sourceware.org, brobecker@adacore.com Date: Fri, 05 Oct 2007 13:28:00 -0000 From: "Ulrich Weigand" X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 2007-10/txt/msg00049.txt.bz2 Hello, I was trying to understand the need for DEPRECATED_PC_REQUIRED_RUN_BEFORE_USE for hppa targets. According to the most up-to-date discussion of this issue I could find in the archives: http://www.sourceware.org/ml/gdb/2004-12/msg00022.html it appears this hack was needed to work around some issues with the SOM symbol reader and treatment of shared libraries. However, as we've in the meantime removed a lot of the SOM symbol reader code (hpread.c etc) I'm wondering whether this hack is actually still necessary ... Joel, do you still have access to a HP/UX machine? It would be interesting to see whether the following patch actually shows any regressions these days. According to the above email, the gdb.base/so-indr-cl test case is supposed to specifically check for this problem. Thanks, Ulrich ChangeLog: * breakpoint.c (breakpoint_sals_to_pc): Do not check for DEPRECATED_PC_REQUIRED_RUN_BEFORE_USE. * config/pa/tm-hppa.h: Delete file. * config/pa/hppa64.mt: Do not set DEPRECATED_TM_FILE. * config/pa/hppahpux.mt: Likewise. * config/pa/hppa.mt: Likewise. * config/pa/linux.mt: Likewise. * hppa-tdep.c (hppa_pc_requires_run_before_use): Delete. diff -urNp gdb-orig/gdb/breakpoint.c gdb-head/gdb/breakpoint.c --- gdb-orig/gdb/breakpoint.c 2007-10-02 15:57:55.000000000 +0200 +++ gdb-head/gdb/breakpoint.c 2007-10-05 15:05:11.619076608 +0200 @@ -5483,33 +5483,7 @@ breakpoint_sals_to_pc (struct symtabs_an { int i; for (i = 0; i < sals->nelts; i++) - { - resolve_sal_pc (&sals->sals[i]); - - /* It's possible for the PC to be nonzero, but still an illegal - value on some targets. - - For example, on HP-UX if you start gdb, and before running the - inferior you try to set a breakpoint on a shared library function - "foo" where the inferior doesn't call "foo" directly but does - pass its address to another function call, then we do find a - minimal symbol for the "foo", but it's address is invalid. - (Appears to be an index into a table that the loader sets up - when the inferior is run.) - - Give the target a chance to bless sals.sals[i].pc before we - try to make a breakpoint for it. */ -#ifdef DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE - if (DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE (sals->sals[i].pc)) - { - if (address == NULL) - error (_("Cannot break without a running program.")); - else - error (_("Cannot break on %s without a running program."), - address); - } -#endif - } + resolve_sal_pc (&sals->sals[i]); } static void diff -urNp gdb-orig/gdb/config/pa/hppa64.mt gdb-head/gdb/config/pa/hppa64.mt --- gdb-orig/gdb/config/pa/hppa64.mt 2007-06-21 17:29:56.000000000 +0200 +++ gdb-head/gdb/config/pa/hppa64.mt 2007-10-05 15:02:41.188002076 +0200 @@ -1,3 +1,2 @@ # Target: HP PA-RISC 2.0 running HPUX 11.00 in wide mode TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o solib-som.o solib-pa64.o somread.o solib.o -DEPRECATED_TM_FILE= tm-hppa.h diff -urNp gdb-orig/gdb/config/pa/hppahpux.mt gdb-head/gdb/config/pa/hppahpux.mt --- gdb-orig/gdb/config/pa/hppahpux.mt 2007-06-21 17:29:56.000000000 +0200 +++ gdb-head/gdb/config/pa/hppahpux.mt 2007-10-05 15:02:47.319048788 +0200 @@ -1,4 +1,3 @@ # Target: HP PA-RISC running hpux MT_CFLAGS = -DPA_SOM_ONLY=1 TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o corelow.o somread.o solib-som.o solib-pa64.o solib.o -DEPRECATED_TM_FILE= tm-hppa.h diff -urNp gdb-orig/gdb/config/pa/hppa.mt gdb-head/gdb/config/pa/hppa.mt --- gdb-orig/gdb/config/pa/hppa.mt 2007-06-21 17:29:56.000000000 +0200 +++ gdb-head/gdb/config/pa/hppa.mt 2007-10-05 15:02:51.879058584 +0200 @@ -1,2 +1 @@ TDEPFILES= hppa-tdep.o -DEPRECATED_TM_FILE= tm-hppa.h diff -urNp gdb-orig/gdb/config/pa/linux.mt gdb-head/gdb/config/pa/linux.mt --- gdb-orig/gdb/config/pa/linux.mt 2007-06-21 17:29:56.000000000 +0200 +++ gdb-head/gdb/config/pa/linux.mt 2007-10-05 15:02:57.247083314 +0200 @@ -1,3 +1,2 @@ # Target: HP PA-RISC running Linux TDEPFILES= hppa-tdep.o hppa-linux-tdep.o glibc-tdep.o solib.o solib-svr4.o symfile-mem.o -DEPRECATED_TM_FILE=tm-hppa.h diff -urNp gdb-orig/gdb/config/pa/tm-hppa.h gdb-head/gdb/config/pa/tm-hppa.h --- gdb-orig/gdb/config/pa/tm-hppa.h 2007-08-27 15:47:55.000000000 +0200 +++ gdb-head/gdb/config/pa/tm-hppa.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,27 +0,0 @@ -/* Parameters for execution on any Hewlett-Packard PA-RISC machine. - - Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. - - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.edu). - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#include "regcache.h" - -extern int hppa_pc_requires_run_before_use (CORE_ADDR pc); -#define DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE(pc) hppa_pc_requires_run_before_use (pc) diff -urNp gdb-orig/gdb/hppa-tdep.c gdb-head/gdb/hppa-tdep.c --- gdb-orig/gdb/hppa-tdep.c 2007-09-10 20:36:42.000000000 +0200 +++ gdb-head/gdb/hppa-tdep.c 2007-10-05 15:04:04.091561855 +0200 @@ -68,10 +68,6 @@ const struct objfile_data *hppa_objfile_ #define UNWIND_ENTRY_SIZE 16 #define STUB_UNWIND_ENTRY_SIZE 8 -/* FIXME: brobecker 2002-11-07: We will likely be able to make the - following functions static, once we hppa is partially multiarched. */ -int hppa_pc_requires_run_before_use (CORE_ADDR pc); - /* Routines to extract various sized constants out of hppa instructions. */ @@ -2612,34 +2608,6 @@ unwind_command (char *exp, int from_tty) } } -int -hppa_pc_requires_run_before_use (CORE_ADDR pc) -{ - /* Sometimes we may pluck out a minimal symbol that has a negative address. - - An example of this occurs when an a.out is linked against a foo.sl. - The foo.sl defines a global bar(), and the a.out declares a signature - for bar(). However, the a.out doesn't directly call bar(), but passes - its address in another call. - - If you have this scenario and attempt to "break bar" before running, - gdb will find a minimal symbol for bar() in the a.out. But that - symbol's address will be negative. What this appears to denote is - an index backwards from the base of the procedure linkage table (PLT) - into the data linkage table (DLT), the end of which is contiguous - with the start of the PLT. This is clearly not a valid address for - us to set a breakpoint on. - - Note that one must be careful in how one checks for a negative address. - 0xc0000000 is a legitimate address of something in a shared text - segment, for example. Since I don't know what the possible range - is of these "really, truly negative" addresses that come from the - minimal symbols, I'm resorting to the gross hack of checking the - top byte of the address for all 1's. Sigh. */ - - return (!target_has_stack && (pc & 0xFF000000) == 0xFF000000); -} - /* Return the GDB type object for the "standard" data type of data in register REGNUM. */ -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com