From: Andrew Cagney Date: Fri, 19 Sep 2003 20:09:45 +0000 (+0000) Subject: 2003-09-19 Andrew Cagney X-Git-Tag: carlton-dictionary-20031111-merge~512 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=83a65a1878c0b21865a1092e209429e4d20f0722;p=pf3gnuchains%2Fpf3gnuchains4x.git 2003-09-19 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. 2003-09-19 Andrew Cagney * gdbint.texinfo (Target Architecture Definition): Delete documentation for NEED_TEXT_START_END. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 734c8ae35f..6e5885451b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,18 @@ 2003-09-19 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. + +2003-09-19 Andrew Cagney + * utils.c (align_up, align_down): New functions. * defs.h (align_up, align_down): Declare. * ppc-sysv-tdep.c (align_up, align_down): Delete functions. diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h index 29a52dfcf7..bf4fd3c475 100644 --- a/gdb/config/pa/nm-hppah.h +++ b/gdb/config/pa/nm-hppah.h @@ -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 diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index b471806c2a..18b31b87cf 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2003-09-19 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Delete + documentation for NEED_TEXT_START_END. + 2003-09-18 Andrew Cagney * gdbint.texinfo (Target Architecture Definition): Delete diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 45b7f75d71..b974927090 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -38,7 +38,7 @@ Free Documentation License''. @page @tex \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{\$Revision: 1.162 $} % For use in headers, footers too +\xdef\manvers{\$Revision: 1.163 $} % For use in headers, footers too {\parskip=0pt \hfill Cygnus Solutions\par \hfill \manvers\par @@ -3483,11 +3483,6 @@ method like @code{INTEGER_TO_ADDRESS} certainly makes it possible for @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.) diff --git a/gdb/exec.c b/gdb/exec.c index 468b0ea299..b48c6c04d9 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -85,13 +85,6 @@ bfd *exec_bfd = NULL; 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 @@ exec_file_attach (char *filename, int from_tty) 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 (); diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c index 53599499c2..28ec350f17 100644 --- a/gdb/hppah-nat.c +++ b/gdb/hppah-nat.c @@ -34,14 +34,34 @@ #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); void