Changes to make 29k function calls work better at Adobe.
authorJohn Gilmore <gnu@cygnus>
Sat, 3 Oct 1992 05:28:42 +0000 (05:28 +0000)
committerJohn Gilmore <gnu@cygnus>
Sat, 3 Oct 1992 05:28:42 +0000 (05:28 +0000)
* am29k-tdep.c (_initialize_29k):  Make it possible for the
user to set and query the address where function calls into the
inferior write a small scratch routine.  `set call_scratch_address'
* inferior.h (PC_IN_CALL_DUMMY):  Fix fencepost error.
* remote.c (remote_prepare_to_store): Only fetch regs if they are
not already cached validly.

gdb/ChangeLog
gdb/am29k-tdep.c
gdb/inferior.h
gdb/remote.c

index 1024126e5b3d448de497166c56625542747eb8f2..d142e62699b54cff087568a25501ecb784391c1c 100644 (file)
@@ -1,3 +1,12 @@
+Fri Oct  2 22:04:42 1992  John Gilmore  (gnu@cygnus.com)
+
+       * am29k-tdep.c (_initialize_29k):  Make it possible for the
+       user to set and query the address where function calls into the
+       inferior write a small scratch routine.  `set call_scratch_address'
+       * inferior.h (PC_IN_CALL_DUMMY):  Fix fencepost error.
+       * remote.c (remote_prepare_to_store): Only fetch regs if they are
+       not already cached validly.
+
 Thu Oct  1 14:36:42 1992  K. Richard Pixley  (rich@sendai.cygnus.com)
 
        Rs6000 native support.
index d5399b7460287a76edbd473ebdd0934c90e101c5..13aca9a2cb252566684934b9757017f8227e8950 100644 (file)
@@ -810,6 +810,8 @@ reginv_com (args, fromtty)
 void
 _initialize_29k()
 {
+  extern CORE_ADDR text_end;
+
   add_com ("reginv ", class_obscure, reginv_com, 
         "Invalidate gdb's internal register cache.");
 
@@ -821,4 +823,12 @@ _initialize_29k()
 Attempts to access registers saved above this address will be ignored\n\
 or will produce the value -1.", &setlist),
      &showlist);
+
+  /* FIXME, there should be a way to make a CORE_ADDR variable settable. */
+  add_show_from_set
+    (add_set_cmd ("call_scratch_address", class_support, var_uinteger,
+                 (char *)&text_end,
+"Set address in memory where small amounts of RAM can be used when\n\
+making function calls into the inferior.", &setlist),
+     &showlist);
 }
index c893f349a7529f3484ffc020ff8b4db4c9514c50..5db853eaca451dd45d5d3307cd2033b7b04d689a 100644 (file)
@@ -153,7 +153,7 @@ terminal_inferior PARAMS ((void));
 extern void
 terminal_init_inferior PARAMS ((void));
 
-/* From infptrace.c or procfs.c */
+/* From infptrace.c */
 
 extern int
 attach PARAMS ((int));
@@ -173,24 +173,18 @@ call_ptrace PARAMS ((int, int, PTRACE_ARG3_TYPE, int));
 
 /* From procfs.c */
 
-#ifdef USE_PROC_FS
-
 extern int
 proc_iterate_over_mappings PARAMS ((int (*) (int, CORE_ADDR)));
 
-extern int
-proc_wait PARAMS ((int *));
-
-extern void
-inferior_proc_init PARAMS ((int));
-
 extern void
 proc_signal_handling_change PARAMS ((void));
 
-extern void
-proc_set_exec_trap PARAMS ((void));
+/* From fork-child.c */
 
-#endif
+extern void
+fork_inferior PARAMS ((char *, char *, char **,
+                      void (*) (void),
+                      void (*) (int)));
 
 /* From inflow.c */
 
@@ -326,13 +320,13 @@ extern int attach_flag;
 extern CORE_ADDR text_end;
 #define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
   ((pc) >= text_end - CALL_DUMMY_LENGTH         \
-   && (pc) < text_end + DECR_PC_AFTER_BREAK)
+   && (pc) <= text_end + DECR_PC_AFTER_BREAK)
 #else /* Not before text_end.  */
 #if CALL_DUMMY_LOCATION == AFTER_TEXT_END
 extern CORE_ADDR text_end;
 #define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
   ((pc) >= text_end   \
-   && (pc) < text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK)
+   && (pc) <= text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK)
 #else /* On stack.  */
 #define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
   ((sp) INNER_THAN (pc) && (pc) INNER_THAN (frame_address))
index 86df56a8e48947d00106a8513d9bad9eeafd0697..e7f249968ba9a5d52bad1ad893e3bd5b69475e4a 100644 (file)
@@ -417,7 +417,7 @@ remote_wait (status)
   unsigned char *p;
   int i;
   long regno;
-  unsigned char regs[MAX_REGISTER_RAW_SIZE];
+  char regs[MAX_REGISTER_RAW_SIZE];
 
   WSETEXIT ((*status), 0);
 
@@ -505,7 +505,8 @@ remote_fetch_registers (regno)
 static void 
 remote_prepare_to_store ()
 {
-  remote_fetch_registers (-1);
+  /* Make sure the entire registers array is valid.  */
+  read_register_bytes (0, (char *)NULL, REGISTER_BYTES);
 }
 
 /* Store the remote registers from the contents of the block REGISTERS. 
@@ -1068,6 +1069,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",  /* to_doc */
   NULL,                                /* to_lookup_symbol */
   NULL,                                /* to_create_inferior */
   NULL,                                /* to_mourn_inferior */
+  0,                           /* to_can_run */
   process_stratum,             /* to_stratum */
   NULL,                                /* to_next */
   1,                           /* to_has_all_memory */