* exec.c (exec_command): If NEED_TEXT_START_END, define the
authorJohn Gilmore <gnu@cygnus>
Fri, 13 Sep 1991 07:22:01 +0000 (07:22 +0000)
committerJohn Gilmore <gnu@cygnus>
Fri, 13 Sep 1991 07:22:01 +0000 (07:22 +0000)
variables and set them based on the exec file.
* am29k-tdep.c:  declare text_start.
* valops.c (call_function_by_hand):  declare text_end.

gdb/am29k-tdep.c
gdb/exec.c

index 33d16c868cb633a46b7b8da286559fe646bf6d33..ce1fa8557b53b8c6add54dc93ebba561f87d3033 100644 (file)
@@ -27,6 +27,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "symtab.h"
 #include "inferior.h"
 
+extern CORE_ADDR text_start;   /* FIXME, kludge... */
+
 /* Structure to hold cached info about function prologues.  */
 struct prologue_info
 {
index c478e9cc5d169523028d6cb806d84139ca83d459..5f8f398d83f7ea533ebdcfae19508790eb1ed312 100644 (file)
@@ -50,6 +50,13 @@ bfd *exec_bfd = NULL;
 
 int write_files = 0;
 
+/* Text start and end addresses (KLUDGE) if needed */
+
+#if NEED_TEXT_START_END
+CORE_ADDR text_start = 0;
+CORE_ADDR text_end   = 0;
+#endif
+
 /* Forward decl */
 
 extern struct target_ops exec_ops;
@@ -137,6 +144,18 @@ exec_file_command (filename, from_tty)
        error ("Can't find the file sections in `%s': %s", 
                exec_bfd->filename, bfd_errmsg (bfd_error));
 
+#if NEED_TEXT_START_END
+      /* This is a KLUDGE (FIXME) because a few places in a few ports
+        (29K springs to mind) need this info for now.  */
+      {
+       struct section_table *p;
+       for (p = exec_ops.sections; p < exec_ops.sections_end; p++)
+         if (!strcmp (".text", bfd_section_name (p->bfd, p->sec_ptr))
+           text_start = p->addr;
+           text_end   = p->endaddr;
+      }
+#endif
+
       validate_files ();
 
       push_target (&exec_ops);
This page took 0.026922 seconds and 4 git commands to generate.