rfg@ICS.UCI.EDU (12/16/89)
/* Could somebody please try to verify that the following is a generic COFF bug? I have a very hacked up version of GCC 1.36, so I can't really be sure if this problem is due to the hacks or to the presence of a real bug. I somebody else with a different kind of COFF system could check this out and send me E-mail (rfg@ics.uci.edu), I would appreciate it. If it is a real bug, it looks serious. Here is the problem. If within a given function, I call an inline function, and if within that same (calling) function I later have nested blocks with their own local variable declarations, the debugging information for the subsequent nested blocks (specifically the information about the local variable declarations) gets goofed up. Here is the (short) example code: */ inline void my_inline () { } static void save_def_or_dec () { my_inline (); { int nested_1 = 99; } { int nested_2 = 77; } } /* The problem is that COFF symbol definitions for `nested_1' and `nested_2' get `offset' by one block per call to an inline function that preceedes them. (That number is one in the example above.) Thus, the COFF symbol definition for `nested_1' gets associated with the block which actually contains the declaration for `nested_2'. The COFF symbol definition for `nested_2' drops off the end of the world, and never even makes it into the output (.s) file. This makes debugging very difficult. You can check to see if this happes on your favorite COFF system very easily. Just compile with gcc using -g and -s options. Then grep the resulting .s file for the string "nested_2". If it doesn't appear in the .s file, then you have verified the bug. Either way, I would appreciate knowing if this can or cannot be reproduced by others. It is not really important to the content of this bug report, but just in case anybody cares, I'm using a DG AViiON, and I will gladly send a copy of the assmebly output that I get for the above example. // rfg */