Newsgroups: comp.sys.apollo From: troy@cbme.unsw.EDU.AU (Troy Rollo) Subject: gdb-4.12 works on Apollo, with a small patch Organization: University of New South Wales Date: Fri, 18 Mar 1994 23:51:50 GMT GDB 4.12 will work on Apollos as delivered, with the small patch included at the end of this article. This version of gdb reads Apollo native debugging information, so you do not need to compile your programs with gcc and gas to use it. GDB is massively faster in all respects than the Apollo debuggers, dde and dbx. I have tested the compilation on sr10.4 under bsd4.3. To compile: 1. You must have gcc 2.x installed. GDB will not compile with the Apollo compiler. 2. Apply to patch below to gdb-4.12/gdb/dstread.c 3. Type "configure" from the gdb-4.12 directory. Configure can now automatically detect apollos. 4. Type "make". This will build gdb. The patch follows. *** ../../old/gdb-4.12/gdb/dstread.c Fri Feb 4 03:41:10 1994 --- dstread.c Fri Mar 18 22:39:34 1994 *************** *** 92,97 **** --- 92,99 ---- static void dst_record_line PARAMS ((int, CORE_ADDR)); + static struct objfile *dstobjfile; + static struct blockvector * make_blockvector (objfile) struct objfile *objfile; *************** *** 243,249 **** { prim_record_minimal_symbol (savestring (name, strlen (name)), address, ! type); } /* dst_symfile_init () --- 245,252 ---- { prim_record_minimal_symbol (savestring (name, strlen (name)), address, ! type, ! dstobjfile); } /* dst_symfile_init () *************** *** 261,269 **** { asection *section; bfd *abfd = objfile->obfd; init_entry_point_info (objfile); ! } /* This function is called for every section; it finds the outer limits --- 264,275 ---- { asection *section; bfd *abfd = objfile->obfd; + struct objfile *objold; + objold = dstobjfile; + dstobjfile = objfile; init_entry_point_info (objfile); ! dstobjfile = objold; } /* This function is called for every section; it finds the outer limits *************** *** 1711,1717 **** static struct sym_fns dst_sym_fns = { /* FIXME: Can this be integrated with coffread.c? If not, should it be ! a separate flavour like ecoff? */ (enum bfd_flavour)-2, dst_new_init, /* sym_new_init: init anything gbl to entire symtab */ --- 1717,1732 ---- static struct sym_fns dst_sym_fns = { /* FIXME: Can this be integrated with coffread.c? If not, should it be ! a separate flavour like ecoff? ! ! I don't think it can - DST is a totally unique debugging format. ! While some of the COFF format debugging info is written, it isn't ! used for debugging, and isn't sufficiently complete to be used ! for anything practical at all. ! ! Troy Rollo (troy@cbme.unsw.edu.au) ! */ ! (enum bfd_flavour)-2, dst_new_init, /* sym_new_init: init anything gbl to entire symtab */