From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5228 invoked by alias); 14 Sep 2003 17:32:10 -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 5221 invoked from network); 14 Sep 2003 17:32:04 -0000 Received: from unknown (HELO localhost.redhat.com) (65.49.0.121) by sources.redhat.com with SMTP; 14 Sep 2003 17:32:04 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id A07EA2B89 for ; Sun, 14 Sep 2003 13:31:58 -0400 (EDT) Message-ID: <3F64A60E.6030001@redhat.com> Date: Sun, 14 Sep 2003 17:32:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [patch/rfc, rfa:doco] Deprecate NEED_TEXT_START_END Content-Type: multipart/mixed; boundary="------------000704070803080906030607" X-SW-Source: 2003-09/txt/msg00308.txt.bz2 This is a multi-part message in MIME format. --------------000704070803080906030607 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 298 Hello, This patch boots the NEED_TEXT_START_END code out of "exec.c" and into HP/UX native. "exec.c" now calls DEPRECATED_HPUX_TEXT_END() when defined. Note that I've not built this on HP/UX. Eli, is the removal of the now defunct NEED_TEXT_START_END ok? It should go in in a few days, Andrew --------------000704070803080906030607 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 5218 2003-09-14 Andrew Cagney * config/pa/nm-hppah.h (NEED_TEXT_START_END): Delete. (DEPRECATED_HPUX_TEXT_END): Define. (deprecated_hpux_text_end): Declare. (struct target_ops): Declare opaque. * hppah-nat.c (text_end): Make static. (deprecated_hpux_text_end): New function. * exec.c (text_end): Delete global variable. (NEED_TEXT_START_END): Do not define. (exec_file_attach): Replace code computing "text_end" code with call to DEPRECATED_HPUX_TEXT_END. Index: doc/ChangeLog 2003-09-14 Andrew Cagney * gdbint.texinfo (Target Architecture Definition): Delete documentation for NEED_TEXT_START_END. ndex: exec.c =================================================================== RCS file: /cvs/src/src/gdb/exec.c,v retrieving revision 1.29 diff -u -r1.29 exec.c --- exec.c 3 Sep 2003 21:01:44 -0000 1.29 +++ exec.c 14 Sep 2003 17:19:19 -0000 @@ -85,13 +85,6 @@ int write_files = 0; -/* Text start and end addresses (KLUDGE) if needed */ - -#ifndef NEED_TEXT_START_END -#define NEED_TEXT_START_END (0) -#endif -CORE_ADDR text_end = 0; - struct vmap *vmap; void @@ -266,30 +259,9 @@ scratch_pathname, bfd_errmsg (bfd_get_error ())); } - /* text_end is sometimes used for where to put call dummies. A - few ports use these for other purposes too. */ - if (NEED_TEXT_START_END) - { - struct section_table *p; - - /* Set text_start to the lowest address of the start of any - readonly code section and set text_end to the highest - address of the end of any readonly code section. */ - /* FIXME: The comment above does not match the code. The - code checks for sections with are either code *or* - readonly. */ - CORE_ADDR text_start = ~(CORE_ADDR) 0; - text_end = (CORE_ADDR) 0; - for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++) - if (bfd_get_section_flags (p->bfd, p->the_bfd_section) - & (SEC_CODE | SEC_READONLY)) - { - if (text_start > p->addr) - text_start = p->addr; - if (text_end < p->endaddr) - text_end = p->endaddr; - } - } +#ifdef DEPRECATED_HPUX_TEXT_END + DEPRECATED_HPUX_TEXT_END (&exec_ops); +#endif validate_files (); Index: hppah-nat.c =================================================================== RCS file: /cvs/src/src/gdb/hppah-nat.c,v retrieving revision 1.26 diff -u -r1.26 hppah-nat.c --- hppah-nat.c 14 Sep 2003 16:32:12 -0000 1.26 +++ hppah-nat.c 14 Sep 2003 17:19:52 -0000 @@ -34,13 +34,33 @@ #include "gdb_string.h" #include -extern CORE_ADDR text_end; - extern int hpux_has_forked (int pid, int *childpid); extern int hpux_has_vforked (int pid, int *childpid); extern int hpux_has_execd (int pid, char **execd_pathname); extern int hpux_has_syscall_event (int pid, enum target_waitkind *kind, int *syscall_id); + +static CORE_ADDR text_end; + +void +deprecated_hpux_text_end (struct target_ops *exec_ops) +{ + struct section_table *p; + + /* Set text_end to the highest address of the end of any readonly + code section. */ + /* FIXME: The comment above does not match the code. The code + checks for sections with are either code *or* readonly. */ + text_end = (CORE_ADDR) 0; + for (p = exec_ops->to_sections; p < exec_ops->to_sections_end; p++) + if (bfd_get_section_flags (p->bfd, p->the_bfd_section) + & (SEC_CODE | SEC_READONLY)) + { + if (text_end < p->endaddr) + text_end = p->endaddr; + } +} + static void fetch_register (int); Index: config/pa/nm-hppah.h =================================================================== RCS file: /cvs/src/src/gdb/config/pa/nm-hppah.h,v retrieving revision 1.16 diff -u -r1.16 nm-hppah.h --- config/pa/nm-hppah.h 4 Sep 2003 18:04:25 -0000 1.16 +++ config/pa/nm-hppah.h 14 Sep 2003 17:19:52 -0000 @@ -19,6 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +struct target_ops; + #define U_REGS_OFFSET 0 #define KERNEL_U_ADDR 0 @@ -44,9 +46,10 @@ #define FIVE_ARG_PTRACE /* We need to figure out where the text region is so that we use the - appropriate ptrace operator to manipulate text. Simply reading/writing - user space will crap out HPUX. */ -#define NEED_TEXT_START_END 1 + appropriate ptrace operator to manipulate text. Simply + reading/writing user space will crap out HPUX. */ +#define DEPRECATED_HPUX_TEXT_END deprecated_hpux_text_end +extern void deprecated_hpux_text_end (struct target_ops *exec_ops); /* In hppah-nat.c: */ #define FETCH_INFERIOR_REGISTERS Index: doc/gdbint.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v retrieving revision 1.161 diff -u -r1.161 gdbint.texinfo --- doc/gdbint.texinfo 13 Sep 2003 14:12:41 -0000 1.161 +++ doc/gdbint.texinfo 14 Sep 2003 17:21:19 -0000 @@ -3483,11 +3483,6 @@ @xref{Target Architecture Definition, , Pointers Are Not Always Addresses}. -@item NEED_TEXT_START_END -@findex NEED_TEXT_START_END -Define this if @value{GDBN} should determine the start and end addresses of the -text section. (Seems dubious.) - @item NO_HIF_SUPPORT @findex NO_HIF_SUPPORT (Specific to the a29k.) --------------000704070803080906030607--