🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #10187

gdb 'bugs' (enhancement requests?) and a patch...

#10187
From: Mike Newton
Date: Mon, 19 Feb 1990 06:31
55 lines
2550 bytes
Here are three gdb-3.4 comments/bugs/enhancements.  I know 3.5 is out,
but I cant use that yet.  MANY thanks for gdb....

[1] A lot of my 'C' code is machine generated.  I write a file, 
say 'foo.d' and a translator takes that into 'foo.c', putting
	# line 626 "list.d"
this throws off gdb considerably.  (this may really be a 'gcc' bug...??)

[2] When debuging fasl loaders, 'undump', and that kind of program, I have
found the following change to gdb 3.4 _very_ useful:

[note: changes are from  coffread.c  in dg's 3.4]

   static void
   enter_linenos (file_offset, first_line, last_line)
       long file_offset;
       register int first_line;
       register int last_line;
   {
     register struct lineno *rawptr;
   
>>    /* Next if statement is mine.... 	 -- MON */
>>   if (file_offset < linetab_offset) { 	/* newton@vlsi.caltech.edu */
>>     fprintf(stderr,"\nBOTCH : file_offset < linetab_offset. Bad 'ld' file.\n");
>>     fprintf(stderr," COFF-ENTRY -> aux.x_sym.x_misc.x_lnsz.x_lnno BAD\n");
>>     return;
>>   }
   
     rawptr = (struct lineno *) &linetab[file_offset - linetab_offset];
   
     /* skip first line entry for each function */
     rawptr++;
     /* line numbers start at one for the first line of the function */
     first_line--;
   
     while (rawptr->l_lnno && rawptr->l_lnno <= last_line)
       {
         rawptr++;
         record_line (first_line + rawptr->l_lnno, rawptr->l_addr.l_paddr);
       }
   }
   

[3] Finally, (related to #1 above, but more general and more important), it
would be real nice if:
	if there  were a .i newer than the corresponding .c file
	have 'gdb' use that for line numbers. 
This would allow _much_ easier debugging of include files...

Anyway, thanks again...
- mike

ps: i've used gdb to debug a new version of AKCL which will be freely
available soon....
Technical Details
Message-ID: <9002190631.AA19149@csvax.caltech.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!CSVAX.CALTECH.EDU!newton

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,19e5a48bb0f81350,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1990-02-19 10:00:59 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!CSVAX.CALTECH.EDU!newton
From: newton@CSVAX.CALTECH.EDU (Mike Newton)
Newsgroups: gnu.gdb.bug
Subject: gdb 'bugs'  (enhancement requests?) and a patch...
Message-ID: <9002190631.AA19149@csvax.caltech.edu>
Date: 19 Feb 90 06:31:04 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 55
Posted: Mon Feb 19 07:31:04 1990