Package: gcc
Version 4.1.1-11

In the following sample code, gcc does not create enough
debugging information to let gdb break in lines 27, 30, 33, 36.

This makes debugging the main() function extremely painful.
This is a regression from gcc 2.95 and gcc 3.3, both of which
let gdb set a breakpoint on those lines.

The ability to debug such code is very important to me, since
I usually write my C functions with some cleanup code
after a 'failure' label in the style below.




    1   int f1(void)                    /* this "succeeds", i.e. returns 1 */
    2   {
    3       return 1;
    4   }
    5   
    6   int f2(void)                    /* this "succeeds", i.e. returns 1 */
    7   {
    8       return 1;
    9   }
   10   
   11   int f3(void)                    /* this "fails", i.e. returns 0 */
   12   {
   13       return 0;
   14   }
   15   
   16   int f4(void)                    /* this "succeeds", i.e. returns 1 */
   17   {
   18       return 1;
   19   }
   20   
   21   
   22   int main(int argc, char *argv[])
   23   {
   24       int c;
   25   
   26       if (!f1())
   27           goto failure;
   28   
   29       if (!f2())
   30           goto failure;
   31   
   32       if (!f3())
   33           goto failure;
   34   
   35       if (!f4())
   36           goto failure;
   37   
   38    success:
   39       return 0;
   40   
   41    failure:
   42       return 1;
   43   }


-- 
Claus Fischer <[EMAIL PROTECTED]>
http://www.clausfischer.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to