home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / bsd / 4160 < prev    next >
Encoding:
Text File  |  1992-08-14  |  10.9 KB  |  348 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!regent!pes
  3. From: pes@regent.e-technik.tu-muenchen.dbp.de (Peter Schauer)
  4. Subject: gdb-4.6 patches for 386BSD 0.1
  5. Message-ID: <pes.713825651@regent.e-technik.tu-muenchen.de>
  6. Sender: news@regent.e-technik.tu-muenchen.de (News System)
  7. Organization: Technical University of Munich, Germany
  8. Date: Fri, 14 Aug 1992 20:54:11 GMT
  9. Lines: 337
  10.  
  11.  
  12. Here are the patches to gdb-4.6 to make it run under 386BSD 0.1.
  13. Appply them with patch -p <this_message
  14. Configure with i386-none-bsd386.
  15. They make gdb-4.6 run under 386BSD 0.1.
  16. They do not include kernel debugging facilities and floating point support.
  17.  
  18. Peter Schauer            pes@regent.e-technik.tu-muenchen.de
  19.  
  20. *** ./bfd/config/i386-bsd.mt.orig    Mon Aug 10 16:23:39 1992
  21. --- ./bfd/config/i386-bsd.mt    Mon Aug 10 16:25:09 1992
  22. ***************
  23. *** 0 ****
  24. --- 1,3 ----
  25. + # Target:  Intel 386 running 386bsd using a.out
  26. + TDEFAULTS = -DDEFAULT_VECTOR=i386bsd_vec
  27. + TDEPFILES= i386bsd.o
  28. *** ./bfd/config/i386bsd.mh.orig    Mon Aug 10 16:22:20 1992
  29. --- ./bfd/config/i386bsd.mh    Mon Aug 10 16:22:12 1992
  30. ***************
  31. *** 0 ****
  32. --- 1,2 ----
  33. + HDEFINES=-DTRAD_CORE
  34. + HDEPFILES=trad-core.o
  35. *** ./bfd/configure.in.orig    Wed Jul  8 10:01:12 1992
  36. --- ./bfd/configure.in    Wed Aug 12 18:05:09 1992
  37. ***************
  38. *** 84,89 ****
  39. --- 84,90 ----
  40.           mach*)    my_host=i386mach ;;
  41.           msdos*)    my_host=dose ;;
  42.           linux)    my_host=i386linux ;;
  43. +         bsd386)    my_host=i386bsd ;;
  44.           esac
  45.           ;;
  46.       esac
  47. ***************
  48. *** 205,210 ****
  49. --- 206,212 ----
  50.   *-*-solaris2*        ) bfd_target=${target_cpu}-elf ;;
  51.   *-*-go32        ) bfd_target=${target_cpu}-aout ;;        
  52.   *-*-linux*        ) bfd_target=${target_cpu}-linux ;;
  53. + *-*-bsd386        ) bfd_target=${target_cpu}-bsd ;;
  54.   *-*-sysv*        ) bfd_target=${target_cpu}-coff ;;
  55.   *-*-scosysv*        ) bfd_target=${target_cpu}-coff ;;
  56.   tahoe-*-none        ) bfd_target=${target_cpu} ;;
  57. *** ./bfd/hosts/i386bsd.h.orig    Mon Aug 10 16:30:10 1992
  58. --- ./bfd/hosts/i386bsd.h    Wed Aug 12 10:31:04 1992
  59. ***************
  60. *** 0 ****
  61. --- 1,47 ----
  62. + #include <fcntl.h>
  63. + #include <errno.h>
  64. + #include <stdio.h>
  65. + #include <sys/types.h>
  66. + #include <sys/stat.h>
  67. + #include <ctype.h>
  68. + #include <string.h>
  69. + #include <sys/file.h>
  70. + #include <stdlib.h>
  71. + #ifndef O_ACCMODE
  72. + #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
  73. + #endif
  74. + #define SEEK_SET 0
  75. + #define SEEK_CUR 1
  76. + /* fdopen() won't let you open read-only files for update */
  77. + #define    FASCIST_FDOPEN
  78. + #include <machine/param.h>
  79. + #include <machine/vmparam.h>
  80. + #define    HOST_PAGE_SIZE        NBPG
  81. + #define    HOST_MACHINE_ARCH    bfd_arch_i386
  82. + #define    HOST_TEXT_START_ADDR        USRTEXT
  83. + #define    HOST_STACK_END_ADDR (u.u_kproc.kp_eproc.e_vm.vm_maxsaddr + MAXSSIZ)
  84. + #define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(core_bfd) \
  85. +   ((core_bfd)->tdata.trad_core_data->u.u_sig)
  86. + #define u_comm u_kproc.kp_proc.p_comm
  87. + /* EXACT TYPES */
  88. + typedef char int8e_type;
  89. + typedef unsigned char uint8e_type;
  90. + typedef short int16e_type;
  91. + typedef unsigned short uint16e_type;
  92. + typedef int int32e_type;
  93. + typedef unsigned int uint32e_type;
  94. + /* CORRECT SIZE OR GREATER */
  95. + typedef char int8_type;
  96. + typedef unsigned char uint8_type;
  97. + typedef short int16_type;
  98. + typedef unsigned short uint16_type;
  99. + typedef int int32_type;
  100. + typedef unsigned int uint32_type;
  101. + #include "fopen-same.h"
  102. *** ./bfd/i386bsd.c.orig    Mon Aug 10 16:26:59 1992
  103. --- ./bfd/i386bsd.c    Mon Aug 10 16:26:52 1992
  104. ***************
  105. *** 0 ****
  106. --- 1,40 ----
  107. + /* BFD back-end for bsd386 a.out binaries.
  108. +    Copyright (C) 1990, 1991 Free Software Foundation, Inc.
  109. + This file is part of BFD, the Binary File Descriptor library.
  110. + This program is free software; you can redistribute it and/or modify
  111. + it under the terms of the GNU General Public License as published by
  112. + the Free Software Foundation; either version 2 of the License, or
  113. + (at your option) any later version.
  114. + This program is distributed in the hope that it will be useful,
  115. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  116. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  117. + GNU General Public License for more details.
  118. + You should have received a copy of the GNU General Public License
  119. + along with this program; if not, write to the Free Software
  120. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  121. + #define    PAGE_SIZE    4096
  122. + #define    SEGMENT_SIZE    PAGE_SIZE
  123. + #define TEXT_START_ADDR    0
  124. + #define N_SHARED_LIB(n) 0
  125. + #define N_HEADER_IN_TEXT(n) 0
  126. + #define ARCH 32
  127. + #define BYTES_IN_WORD 4
  128. + #include "bfd.h"
  129. + #include "sysdep.h"
  130. + #include "libbfd.h"
  131. + #include "aout/aout64.h"
  132. + #include "aout/stab_gnu.h"
  133. + #include "aout/ar.h"
  134. + #include "libaout.h"           /* BFD a.out internal data structures */
  135. + #define DEFAULT_ARCH bfd_arch_i386
  136. + #define MY(OP) CAT(i386bsd_,OP)
  137. + #define TARGETNAME "a.out-bsd386"
  138. + #include "aout-target.h"
  139. *** ./gdb/bsd386-xdep.c.orig    Mon Aug 10 20:28:33 1992
  140. --- ./gdb/bsd386-xdep.c    Wed Aug 12 15:52:30 1992
  141. ***************
  142. *** 0 ****
  143. --- 1,59 ----
  144. + /* 386BSD host interface.
  145. +    Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
  146. + This file is part of GDB.
  147. + This program is free software; you can redistribute it and/or modify
  148. + it under the terms of the GNU General Public License as published by
  149. + the Free Software Foundation; either version 2 of the License, or
  150. + (at your option) any later version.
  151. + This program is distributed in the hope that it will be useful,
  152. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  153. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  154. + GNU General Public License for more details.
  155. + You should have received a copy of the GNU General Public License
  156. + along with this program; if not, write to the Free Software
  157. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  158. + #include "defs.h"
  159. + #include <machine/reg.h>
  160. + /* this table must line up with REGISTER_NAMES in tm-i386.h */
  161. + /* symbols like 'tEAX' come from <machine/reg.h> */
  162. + static int tregmap[] = 
  163. + {
  164. +   tEAX, tECX, tEDX, tEBX,
  165. +   tESP, tEBP, tESI, tEDI,
  166. +   tEIP, tEFLAGS, tCS, tSS
  167. + };
  168. + static int sregmap[] = 
  169. + {
  170. +   sEAX, sECX, sEDX, sEBX,
  171. +   sESP, sEBP, sESI, sEDI,
  172. +   sEIP, sEFLAGS, sCS, sSS
  173. + };
  174. + /* blockend is the value of u.u_ar0, and points to the
  175. +    place where ES is stored.  */
  176. + int
  177. + i386_register_u_addr (blockend, regnum)
  178. +      int blockend;
  179. +      int regnum;
  180. + {
  181. +   /* The following condition is a kludge to get at the proper register map
  182. +      depending upon the state of pcb_flag.
  183. +      The proper condition would be
  184. +      if (u.u_pcb.pcb_flag & FM_TRAP)
  185. +      but that would require a ptrace call here and wouldn't work
  186. +      for corefiles.  */
  187. +   if (blockend < 0x1fcc)
  188. +     return (blockend + 4 * tregmap[regnum]);
  189. +   else
  190. +     return (blockend + 4 * sregmap[regnum]);
  191. + }
  192. *** ./gdb/config/i386bsd.mh.orig    Mon Aug 10 20:48:42 1992
  193. --- ./gdb/config/i386bsd.mh    Wed Aug 12 10:31:49 1992
  194. ***************
  195. *** 0 ****
  196. --- 1,5 ----
  197. + # Host: Intel 386 running 386BSD
  198. + XDEPFILES= infptrace.o coredep.o bsd386-xdep.o
  199. + XM_FILE= xm-386bsd.h
  200. + REGEX=regex.o
  201. + REGEX1=regex.o
  202. *** ./gdb/config/i386bsd.mt.orig    Mon Aug 10 20:47:00 1992
  203. --- ./gdb/config/i386bsd.mt    Wed Aug 12 18:44:43 1992
  204. ***************
  205. *** 0 ****
  206. --- 1,4 ----
  207. + # Target: Intel 386 with 386BSD
  208. +  
  209. + TDEPFILES= exec.o i386-tdep.o i386-pinsn.o
  210. + TM_FILE= tm-386bsd.h
  211. *** ./gdb/configure.in.orig    Wed Jul  8 10:01:38 1992
  212. --- ./gdb/configure.in    Wed Aug 12 18:06:39 1992
  213. ***************
  214. *** 109,114 ****
  215. --- 109,115 ----
  216.           scosysv*) gdb_host=i386sco ;;
  217.           mach)    gdb_host=i386mach ;;
  218.           linux)    gdb_host=linux ;;
  219. +         bsd386)    gdb_host=i386bsd ;;
  220.           esac
  221.           ;;
  222.       esac
  223. ***************
  224. *** 319,324 ****
  225. --- 320,326 ----
  226.           coff)    gdb_target=i386v ;;
  227.           aout)    gdb_target=i386aout ;;
  228.           linux)    gdb_target=linux ;;
  229. +         bsd386)    gdb_target=i386bsd ;;
  230.           esac
  231.       esac
  232.       ;;
  233. *** ./gdb/tm-386bsd.h.orig    Mon Aug 10 20:32:15 1992
  234. --- ./gdb/tm-386bsd.h    Wed Aug 12 15:45:08 1992
  235. ***************
  236. *** 0 ****
  237. --- 1,34 ----
  238. + /* Macro definitions for i386 running under 386BSD.
  239. +    Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
  240. + This file is part of GDB.
  241. + This program is free software; you can redistribute it and/or modify
  242. + it under the terms of the GNU General Public License as published by
  243. + the Free Software Foundation; either version 2 of the License, or
  244. + (at your option) any later version.
  245. + This program is distributed in the hope that it will be useful,
  246. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  247. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  248. + GNU General Public License for more details.
  249. + You should have received a copy of the GNU General Public License
  250. + along with this program; if not, write to the Free Software
  251. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  252. + /* Override number of expected traps from sysv. */
  253. + #define START_INFERIOR_TRAPS_EXPECTED 2
  254. + /* Most definitions from sysv could be used. */
  255. + #include "tm-i386v.h"
  256. + /* Define this if the C compiler puts an underscore at the front
  257. +    of external names before giving them to the linker.  */
  258. + #define NAMES_HAVE_UNDERSCORE
  259. + #undef FLOAT_INFO    /* No float info yet */
  260. + /* 386BSD cannot handle the segment registers. */
  261. + #undef NUM_REGS
  262. + #define NUM_REGS 12
  263. *** ./gdb/xm-386bsd.h.orig    Mon Aug 10 20:19:28 1992
  264. --- ./gdb/xm-386bsd.h    Wed Aug 12 18:46:57 1992
  265. ***************
  266. *** 0 ****
  267. --- 1,45 ----
  268. + /* Macro definitions for 386BSD.
  269. +    Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
  270. + This file is part of GDB.
  271. + This program is free software; you can redistribute it and/or modify
  272. + it under the terms of the GNU General Public License as published by
  273. + the Free Software Foundation; either version 2 of the License, or
  274. + (at your option) any later version.
  275. + This program is distributed in the hope that it will be useful,
  276. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  277. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  278. + GNU General Public License for more details.
  279. + You should have received a copy of the GNU General Public License
  280. + along with this program; if not, write to the Free Software
  281. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  282. + #define HOST_BYTE_ORDER LITTLE_ENDIAN
  283. + #define GDB_HOST_IS_I386
  284. + /* Avoid "INT_MIN redefined" warnings -- by defining it here, exactly
  285. +    the same as in the system <machine/limits.h> file.  */
  286. + #undef    INT_MIN
  287. + #define    INT_MIN        (-0x7fffffff-1)
  288. + /* Get rid of any system-imposed stack limit if possible.  */
  289. + #define SET_STACK_LIMIT_HUGE
  290. + /* This is the amount to subtract from u.u_ar0
  291. +    to get the offset in the core file of the register values.  */
  292. + #include <machine/vmparam.h>
  293. + #define KERNEL_U_ADDR USRSTACK
  294. + #define REGISTER_U_ADDR(addr, blockend, regno) \
  295. +     (addr) = i386_register_u_addr ((blockend),(regno));
  296. + extern int
  297. + i386_register_u_addr PARAMS ((int, int));
  298. + #define PSIGNAL_IN_SIGNAL_H
  299. + #define PTRACE_ARG3_TYPE char*
  300.