home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / gdb / bug / 1329 next >
Encoding:
Text File  |  1992-12-21  |  4.3 KB  |  137 lines

  1. Newsgroups: gnu.gdb.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!andrew.cmu.edu!rr2b+
  3. From: rr2b+@andrew.cmu.edu (Robert Andrew Ryan)
  4. Subject: rs6000 dynamic loading patch
  5. Message-ID: <MfBEuxi00WoiFOW1AI@andrew.cmu.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Sun, 20 Dec 1992 14:24:29 GMT
  10. Approved: bug-gdb@prep.ai.mit.edu
  11. Lines: 124
  12.  
  13. The changes below let the user load symbols for objects load(2)ed after
  14. startup.  (The current gdb-4.7 only allows symbols to be loaded for
  15. shared libraries present when the exec finished.)  For this to be useful
  16. you should apply the patch I posted previously for xcoffexec.c.  (It's a
  17. small patch I can send on request if necessary.)
  18.  
  19. -Rob Ryan
  20.  
  21. Sun Dec 20 16:01:59 EST 1992  Rob Ryan  (robr@cmu.edu)
  22.  
  23.     * inftarg.c:  Added CHILD_TO_LOAD macro, indicating a
  24.     function to call to dynamically load a file into the child.
  25.     * rs6000-tdep.c:  Bumped MAX_LOAD_SEGS to 256 from 64.
  26.     Added rs6000_child_to_load, a partial implementation for
  27.     use with the CHILD_TO_LOAD macro referenced in inftarg.c.
  28.     * tm-rs6000.h:  Added extern decl for rs6000_child_to_load.
  29.     Added #define of CHILD_TO_LOAD.
  30.  
  31.  
  32. diff -c ./inftarg.c ../changed/inftarg.c
  33. *** ./inftarg.c    Sun Dec 20 16:37:08 1992
  34. --- ../changed/inftarg.c    Sun Dec 20 16:38:27 1992
  35. ***************
  36. *** 247,252 ****
  37. --- 247,255 ----
  38.     return(1);
  39.   }
  40.   
  41. + #ifndef CHILD_TO_LOAD
  42. + #define CHILD_TO_LOAD 0
  43. + #endif
  44.   struct target_ops child_ops = {
  45.     "child",            /* to_shortname */
  46.     "Unix child process",        /* to_longname */
  47. ***************
  48. *** 270,276 ****
  49.     terminal_ours,        /* to_terminal_ours */
  50.     child_terminal_info,        /* to_terminal_info */
  51.     kill_inferior,        /* to_kill */
  52. !   0,                /* to_load */
  53.     0,                /* to_lookup_symbol */
  54.     child_create_inferior,    /* to_create_inferior */
  55.     child_mourn_inferior,        /* to_mourn_inferior */
  56. --- 273,279 ----
  57.     terminal_ours,        /* to_terminal_ours */
  58.     child_terminal_info,        /* to_terminal_info */
  59.     kill_inferior,        /* to_kill */
  60. !   CHILD_TO_LOAD,        /* to_load */
  61.     0,                /* to_lookup_symbol */
  62.     child_create_inferior,    /* to_create_inferior */
  63.     child_mourn_inferior,        /* to_mourn_inferior */
  64. diff -c ./rs6000-tdep.c ../changed/rs6000-tdep.c
  65. *** ./rs6000-tdep.c    Sun Dec 20 16:37:09 1992
  66. --- ../changed/rs6000-tdep.c    Sun Dec 20 16:38:27 1992
  67. ***************
  68. *** 1052,1058 ****
  69.   xcoff_relocate_symtab (pid)
  70.   unsigned int pid;
  71.   {
  72. ! #define    MAX_LOAD_SEGS 64        /* maximum number of load segments */
  73.   
  74.       struct ld_info *ldi;
  75.       int temp;
  76. --- 1052,1058 ----
  77.   xcoff_relocate_symtab (pid)
  78.   unsigned int pid;
  79.   {
  80. ! #define    MAX_LOAD_SEGS 256        /* maximum number of load segments, bumped
  81. from 64 to 256 Rob Ryan Dec 7, 1992 */
  82.   
  83.       struct ld_info *ldi;
  84.       int temp;
  85. ***************
  86. *** 1164,1170 ****
  87.     ++loadinfotextindex;
  88.   }
  89.   
  90.   /* FIXME:  This assumes that the "textorg" and "dataorg" elements
  91.      of a member of this array are correlated with the "toc_offset"
  92.      element of the same member.  But they are sequentially assigned in wildly
  93. --- 1164,1187 ----
  94.     ++loadinfotextindex;
  95.   }
  96.   
  97. ! /* FIXME: this enables loading of symbols
  98. !  for objects which have already been read
  99. !  in, but does not actually dynamically load
  100. !  FILE into the running child as the
  101. !  docs say. -Rob Ryan Dec 7,1992*/
  102. ! void
  103. ! rs6000_child_to_load (arg, from_tty)
  104. !     char *arg;
  105. !     int from_tty;
  106. ! {
  107. !   if(inferior_pid > 0) {
  108. !     xcoff_relocate_symtab (inferior_pid);
  109. !   }
  110. !   else {
  111. !     error ("Must have an inferior process to use the load command.");
  112. !   }
  113. !   solib_add (arg, from_tty, (struct target_ops *)0);
  114. ! } 
  115.   /* FIXME:  This assumes that the "textorg" and "dataorg" elements
  116.      of a member of this array are correlated with the "toc_offset"
  117.      element of the same member.  But they are sequentially assigned in wildly
  118. diff -c ./tm-rs6000.h ../changed/tm-rs6000.h
  119. *** ./tm-rs6000.h    Sun Dec 20 16:37:10 1992
  120. --- ../changed/tm-rs6000.h    Sun Dec 20 16:38:28 1992
  121. ***************
  122. *** 613,618 ****
  123. --- 613,623 ----
  124.     }                        \
  125.   }
  126.   
  127. + extern void rs6000_child_to_load PARAMS((char *arg, int from_tty));
  128. + /* CHILD_TO_LOAD should be defined to the name
  129. +  of a function to be called for the child target
  130. +  to dynamically load a file into the inferior process */
  131. + #define CHILD_TO_LOAD rs6000_child_to_load
  132.   
  133.   /* Flag for machine-specific stuff in shared files.  FIXME */
  134.   #define IBM6000_TARGET
  135.  
  136.