home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1285 < prev    next >
Internet Message Format  |  1990-12-28  |  11KB

  1. From: Steve.Bleazard@RoboBar.Co.UK
  2. Newsgroups: alt.sources,comp.unix.xenix
  3. Subject: GDB for Xenix 386 with GCC (part 1 of 4)
  4. Message-ID: <1990May8.111738.28570@robobar.co.uk>
  5. Date: 8 May 90 11:17:38 GMT
  6.  
  7. This is part one of a coordinated set of 4 patches for Xenix GCC, GAS and GDB.
  8. GCC and GAS will need to be ALREADY PATCHED with ALL my Xenix 386 patches.
  9. Please collect all parts before you start hacking :-)
  10.  
  11. No, I haven't made up the complete patch kit for sources.misc yet, but
  12. that's because I'd like to share gdb with you first :-)
  13.  
  14. This is a preliminary release of a port to SCO Xenix of gdb support for
  15. gcc.  The gdb work is partly based on Ron Kuris <ron@rdk386.UUCP>'s work,
  16. but I've severely mangled it.
  17.  
  18.     * It no longer attempts to be compatible with SCO's sdb.
  19.       Trying to do that seems to be like hitting your head against
  20.       a <name your favourite immovable object> because the debugging
  21.       info format is both undocumented and CHANGES FROM RELEASE TO
  22.       RELEASE of SCO's compiler, or so it would seem.  So I gave
  23.       up and used dbx debugging info instead, which is much
  24.       better supported by the GNUfolk anyway.  So you can't mix and
  25.       match cc and gcc -g compiled programs for debugging, but ...
  26.  
  27.     * The GDB port is nearly a full one, structure types, all seem
  28.       to work fine, but I haven't got a 387 (you could donate one,
  29.       of course :-) so I can't test the floating point status support.
  30.       I can't hack the emulator at the moment--it doesn't seem to use
  31.       387 format.
  32.  
  33.     * The gdb fast initial partial-symbol-table read is supported,
  34.       as is incremental symbol loading.
  35.  
  36. This is part 1 which patches GCC, say |patch -p -d /usr/local/src/gcc-1.37.1
  37. or whatever.  BTW it fixes the bug reported by bob@dhw68k.cts.com where
  38. gcc didn't give the linker -l libraries in the right place.
  39.  
  40. As usual, all bug reports concerning these hacks are gratefully received.
  41. Please send them to me, steve@robobar.co.uk or uunet!mcsun!ukc!robobar!steve.
  42.  
  43. #! /bin/sh
  44. # This is a shell archive, meaning:
  45. # 1. Remove everything above the #! /bin/sh line.
  46. # 2. Save the resulting text in a file.
  47. # 3. Execute the file with /bin/sh (not csh) to create the files:
  48. #    gcc-dbxpch.01
  49. # This archive created: Tue May  8 09:32:38 1990
  50. export PATH; PATH=/bin:$PATH
  51. echo shar: extracting "'gcc-dbxpch.01'" '(8164 characters)'
  52. if test -f 'gcc-dbxpch.01'
  53. then
  54.     echo shar: will not over-write existing file "'gcc-dbxpch.01'"
  55. else
  56. sed 's/^X//' << \SHAR_EOF > 'gcc-dbxpch.01'
  57. X*** gcc.c.old    Mon May  7 15:42:23 1990
  58. X--- gcc.c    Mon May  7 17:13:16 1990
  59. X***************
  60. X*** 96,104 ****
  61. X   %{|S:X} like %{S:X}, but if no S switch, substitute `-'.
  62. X   %{|!S:X} like %{!S:X}, but if there is an S switch, substitute `-'.
  63. X- *ifdef M_XENIX
  64. X-  %Z    substitute the names of the libraries specified with -l, each
  65. X-     name is prefixed with 'Slib'and has .a appended; the resultant
  66. X-     name is searched for in the standard list of directories.
  67. X- *endif
  68. X  
  69. X  The conditional text X in a %{S:X} or %{!S:X} construct may contain
  70. X--- 96,99 ----
  71. X***************
  72. X*** 249,256 ****
  73. X  
  74. X  #ifdef M_XENIX
  75. X  /* Microsoft C 5.1 (Beta) and earlier (and probaly latter!) do not
  76. X   * grok very long strings.  So here is the .c compilation spec
  77. X   * string in a form it does grok!  The only difference between this
  78. X!  * and the standard one is 'as' is replaced with 'gas'.
  79. X   */
  80. X  static char c_string[] = {
  81. X--- 244,253 ----
  82. X  
  83. X  #ifdef M_XENIX
  84. X+ #ifndef __GNUC__
  85. X  /* Microsoft C 5.1 (Beta) and earlier (and probaly latter!) do not
  86. X   * grok very long strings.  So here is the .c compilation spec
  87. X   * string in a form it does grok!  The only difference between this
  88. X!  * and the standard one is 'as' is replaced with 'gas' and %{gg:...}
  89. X!  * with %{g}.
  90. X   */
  91. X  static char c_string[] = {
  92. X***************
  93. X*** 325,341 ****
  94. X      0x20,0x25,0x7b,0x6a,0x7d,0x20,0x25,0x7b,0x4a,0x7d,
  95. X      0x20,0x25,0x7b,0x68,0x7d,0x20,0x25,0x7b,0x64,0x32,
  96. X!     0x7d,0x20,0x25,0x61,0x20,0x25,0x7b,0x67,0x67,0x3a,
  97. X!     0x2d,0x47,0x20,0x25,0x67,0x2e,0x73,0x79,0x6d,0x7d,
  98. X!     0x9,0x9,0x20,0x20,0x20,0x20,0x20,0x20,0x25,0x7b,
  99. X!     0x63,0x3a,0x25,0x7b,0x6f,0x2a,0x7d,0x25,0x7b,0x21,
  100. X!     0x6f,0x2a,0x3a,0x2d,0x6f,0x20,0x25,0x77,0x25,0x62,
  101. X!     0x2e,0x6f,0x7d,0x7d,0x25,0x7b,0x21,0x63,0x3a,0x2d,
  102. X!     0x6f,0x20,0x25,0x64,0x25,0x77,0x25,0x62,0x2e,0x6f,
  103. X!     0x7d,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  104. X      0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  105. X!     0x20,0x20,0x20,0x25,0x7b,0x21,0x70,0x69,0x70,0x65,
  106. X!     0x3a,0x25,0x67,0x2e,0x73,0x7d,0xa,0x20,0x7d,0x7d,
  107. X!     0x7d,0x0
  108. X  };
  109. X  #endif /* M_XENIX */
  110. X  
  111. X--- 322,338 ----
  112. X      0x20,0x25,0x7b,0x6a,0x7d,0x20,0x25,0x7b,0x4a,0x7d,
  113. X      0x20,0x25,0x7b,0x68,0x7d,0x20,0x25,0x7b,0x64,0x32,
  114. X!     0x7d,0x20,0x25,0x61,0x20,0x25,0x7b,0x67,0x7d,0x9,
  115. X!     0x9,0x20,0x20,0x20,0x20,0x20,0x20,0x25,0x7b,0x63,
  116. X!     0x3a,0x25,0x7b,0x6f,0x2a,0x7d,0x25,0x7b,0x21,0x6f,
  117. X!     0x2a,0x3a,0x2d,0x6f,0x20,0x25,0x77,0x25,0x62,0x2e,
  118. X!     0x6f,0x7d,0x7d,0x25,0x7b,0x21,0x63,0x3a,0x2d,0x6f,
  119. X!     0x20,0x25,0x64,0x25,0x77,0x25,0x62,0x2e,0x6f,0x7d,
  120. X      0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  121. X!     0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  122. X!     0x20,0x20,0x25,0x7b,0x21,0x70,0x69,0x70,0x65,0x3a,
  123. X!     0x25,0x67,0x2e,0x73,0x7d,0xa,0x20,0x7d,0x7d,0x7d,
  124. X!     0x0
  125. X  };
  126. X+ #endif /* __GNUC__ */
  127. X  #endif /* M_XENIX */
  128. X  
  129. X***************
  130. X*** 359,363 ****
  131. X--- 356,377 ----
  132. X                        %{!pipe:%g.s}\n }}}"
  133. X  #else /* M_XENIX */
  134. X+ #ifdef __GNUC__
  135. X+   "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{i*} %{trigraphs} -undef \
  136. X+         -D__GNUC__ %{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!ansi:%p} %P\
  137. X+         %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic}\
  138. X+     %{Wcomment*} %{Wtrigraphs} %{Wall} %C\
  139. X+         %i %{!M*:%{!E:%{!pipe:%g.cpp}}}%{E:%{o*}}%{M*:%{o*}} |\n\
  140. X+     %{!M*:%{!E:cc1 %{!pipe:%g.cpp} %1 \
  141. X+            %{!Q:-quiet} -dumpbase %i %{Y*} %{d*} %{m*} %{f*} %{a}\
  142. X+            %{g} %{O} %{W*} %{w} %{pedantic} %{ansi} %{traditional}\
  143. X+            %{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p}\
  144. X+            %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  145. X+            %{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  146. X+               %{!S:gas %{R} %{j} %{J} %{h} %{d2} %a %{g}\
  147. X+               %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\
  148. X+                       %{!pipe:%g.s}\n }}}"
  149. X+ #else /* __GNUC__ */
  150. X     c_string
  151. X+ #endif /* __GNUC__ */
  152. X  #endif /* not M_XENIX */
  153. X    },
  154. X***************
  155. X*** 392,396 ****
  156. X      %{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p}\
  157. X      %{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  158. X!     %{!S:gas %{R} %{j} %{J} %{h} %{d2} %a %{gg:-G %g.sym}\
  159. X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %{!pipe:%g.s}\n }"},
  160. X  #endif /* not M_XENIX */
  161. X--- 406,410 ----
  162. X      %{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p}\
  163. X      %{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  164. X!     %{!S:gas %{R} %{j} %{J} %{h} %{d2} %a %{g}\
  165. X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %{!pipe:%g.s}\n }"},
  166. X  #endif /* not M_XENIX */
  167. X***************
  168. X*** 400,404 ****
  169. X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
  170. X  #else /* M_XENIX */
  171. X!    "%{!S:gas %{R} %{j} %{J} %{h} %{d2} %a \
  172. X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
  173. X  #endif /* not M_XENIX */
  174. X--- 414,418 ----
  175. X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
  176. X  #else /* M_XENIX */
  177. X!    "%{!S:gas %{R} %{j} %{J} %{h} %{d2} %a %{g}\
  178. X              %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
  179. X  #endif /* not M_XENIX */
  180. X***************
  181. X*** 419,423 ****
  182. X      %{Wcomment*} %{Wtrigraphs} %{Wall} %C\
  183. X          %i %{!M*:%{!E:%{!pipe:%g.s}}}%{E:%{o*}}%{M*:%{o*}} |\n\
  184. X!     %{!M*:%{!E:%{!S:gas %{R} %{j} %{J} %{h} %{d2} %a \
  185. X                      %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\
  186. X              %{!pipe:%g.s}\n }}}"},
  187. X--- 433,437 ----
  188. X      %{Wcomment*} %{Wtrigraphs} %{Wall} %C\
  189. X          %i %{!M*:%{!E:%{!pipe:%g.s}}}%{E:%{o*}}%{M*:%{o*}} |\n\
  190. X!     %{!M*:%{!E:%{!S:gas %{R} %{j} %{J} %{h} %{d2} %a %{g}\
  191. X                      %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\
  192. X              %{!pipe:%g.s}\n }}}"},
  193. X***************
  194. X*** 431,435 ****
  195. X  char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l %{g:-g} \
  196. X   %{A} %{F} %{r} %{s} %{u*} \
  197. X!  %{!nostdlib:%S} %{!o:-o a.out} %o %Z %{!nostdlib:gnulib%s %L }\n }}}}";
  198. X  #else /* not M_XENIX */
  199. X  char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\
  200. X--- 445,449 ----
  201. X  char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l %{g:-g} \
  202. X   %{A} %{F} %{r} %{s} %{u*} \
  203. X!  %{!nostdlib:%S} %{!o:-o a.out} %o %{!nostdlib:gnulib%s %L }\n }}}}";
  204. X  #else /* not M_XENIX */
  205. X  char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\
  206. X***************
  207. X*** 1071,1084 ****
  208. X  char **outfiles;
  209. X  
  210. X- #ifdef M_XENIX
  211. X- 
  212. X- /* A vector of library files (from -llibrary) */
  213. X- 
  214. X- char **libraries;
  215. X- 
  216. X- int n_libraries;
  217. X- 
  218. X- #endif /* M_XENIX */
  219. X- 
  220. X  /* Create the vector `switches' and its contents.
  221. X     Store its length in `n_switches'.  */
  222. X--- 1085,1088 ----
  223. X***************
  224. X*** 1093,1099 ****
  225. X    n_switches = 0;
  226. X    n_infiles = 0;
  227. X- #ifdef M_XENIX
  228. X-   n_libraries = 0;
  229. X- #endif /* M_XENIX */
  230. X  
  231. X    env_exec_prefix = getenv ("GCC_EXEC_PREFIX");
  232. X--- 1097,1100 ----
  233. X***************
  234. X*** 1105,1113 ****
  235. X    for (i = 1; i < argc; i++)
  236. X      {
  237. X- #ifdef M_XENIX
  238. X-       if (argv[i][0] == '-' && argv[i][1] == 'l')
  239. X-     n_libraries++;
  240. X-       else
  241. X- #endif /* M_XENIX */
  242. X        if (argv[i][0] == '-' && argv[i][1] != 'l')
  243. X      {
  244. X--- 1106,1109 ----
  245. X***************
  246. X*** 1147,1154 ****
  247. X    switches = ((struct switchstr *)
  248. X            xmalloc ((n_switches + 1) * sizeof (struct switchstr)));
  249. X- #ifdef M_XENIX
  250. X-   libraries = (char **) xmalloc ((n_libraries + 1) * sizeof (char *));
  251. X-   n_libraries = 0;
  252. X- #endif /* M_XENIX */
  253. X    infiles = (char **) xmalloc ((n_infiles + 1) * sizeof (char *));
  254. X    n_switches = 0;
  255. X--- 1143,1146 ----
  256. X***************
  257. X*** 1161,1169 ****
  258. X    for (i = 1; i < argc; i++)
  259. X      {
  260. X- #ifdef M_XENIX
  261. X-       if (argv[i][0] == '-' && argv[i][1] == 'l')
  262. X-     libraries[n_libraries++] = &argv[i][2];
  263. X-       else
  264. X- #endif /* M_XENIX */
  265. X        if (argv[i][0] == '-' && argv[i][1] != 'l')
  266. X      {
  267. X--- 1153,1156 ----
  268. X***************
  269. X*** 1183,1186 ****
  270. X--- 1170,1178 ----
  271. X      }
  272. X        else
  273. X+ #ifdef M_XENIX
  274. X+       if (argv[i][0] == '-' && argv[i][1] == 'l')
  275. X+     infiles[n_infiles++] = find_lib(&argv[i][2]);
  276. X+       else
  277. X+ #endif /* M_XENIX */
  278. X      infiles[n_infiles++] = argv[i];
  279. X      }
  280. X***************
  281. X*** 1432,1445 ****
  282. X          obstack_1grow (&obstack, '%');
  283. X          break;
  284. X- 
  285. X- #ifdef M_XENIX
  286. X-       case 'Z':
  287. X-         {
  288. X-           register int f;
  289. X-           for (f = 0; f < n_libraries; f++)
  290. X-         store_arg (find_lib(libraries[f]), 0, 0);
  291. X-         }
  292. X-         break;
  293. X- #endif /* M_XENIX */
  294. X  
  295. X  
  296. X--- 1424,1427 ----
  297. SHAR_EOF
  298. if test 8164 -ne "`wc -c < 'gcc-dbxpch.01'`"
  299. then
  300.     echo shar: error transmitting "'gcc-dbxpch.01'" '(should have been 8164 characters)'
  301. fi
  302. fi # end of overwriting check
  303. #    End of shell archive
  304. exit 0
  305.