Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!coolidge From: coolidge@clitus.cs.uiuc.edu (John Coolidge) Newsgroups: comp.unix.aux Subject: Patch for GCC 1.37.1 under A/UX Summary: Minor fix, unhoses SDB Message-ID: <1990Mar12.200932.6901@brutus.cs.uiuc.edu> Date: 12 Mar 90 20:09:32 GMT Sender: news@brutus.cs.uiuc.edu Reply-To: coolidge@cs.uiuc.edu Organization: U of Illinois, CS Dept., Systems Research Group Lines: 56 I've been getting error messages for some time when debugging code compiled with gcc (currently using 1.37.1, but the errors are consistent since 1.36) and David Berry's patches (the apple.com set). I finally got tired of the error messages and found the problem. The patches add the following to final_start_function: #if defined(SDB_DEBUGGING_INFO) && defined(AUX) next_block_index = 1; if (write_symbols == SDB_DEBUG) sdbout_begin_function (NOTE_LINE_NUMBER(first)); #endif which is good, since this fixes some SDB line numbering problems under AUX. The problem is that these lines in final_scan_insn: #ifdef SDB_DEBUGGING_INFO if (write_symbols == SDB_DEBUG) sdbout_begin_function (last_linenum); #endif are left along. sdbout_begin_function is thus being called twice, which is causing two bf (begin function) directives to be emitted. This makes SDB marginally unhappy. The fix is simple: *** ../gcc-1.37.1/final.c Sat Dec 9 08:17:52 1989 --- final.c Mon Mar 12 00:47:20 1990 *************** *** 558,564 **** break; f (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG) { ! #ifdef SDB_DEBUGGING_INFO if (write_symbols == SDB_DEBUG) sdbout_begin_function (last_linenum); #endif --- 566,572 ---- break; if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG) { ! #if defined(SDB_DEBUGGING_INFO) && !defined(AUX) if (write_symbols == SDB_DEBUG) sdbout_begin_function (last_linenum); #endif which simply makes the final_scan_insn outputting dependent on AUX. I've compiled several things (including GCC) with this version of the code, and it seems to make SDB much happier. --John -------------------------------------------------------------------------- John L. Coolidge Internet:coolidge@cs.uiuc.edu UUCP:uiucdcs!coolidge Of course I don't speak for the U of I (or anyone else except myself) Copyright 1990 John L. Coolidge. Copying allowed if (and only if) attributed. You may redistribute this article if and only if your recipients may as well.