On Tue, Oct 24, 2006 at 04:27:26PM +0200, Claus Fischer wrote:
> $ pr -n main.c
> 1 int main(int argc, char *argv[])
> 2 {
> 3 int c;
> 4
> 5 if (0)
> 6 goto failure;
> 7
> 8 c = 1;
> 9
> 10 failure:
> 11 return 0;
> 12 }
>
> $ gcc -O0 -g -o main main.c
> $ gdb main
> GNU gdb 6.4.90-debian
> ...
>
> (gdb) b main.c:6
> Breakpoint 1 at 0x8048354: file main.c, line 6.
> (gdb) r
> Starting program: /home/cfischer/tmp/main
>
> Breakpoint 1, main (argc=1, argv=0xafb3bfa4) at main.c:8
> 8 c = 1;
> (gdb) quit
Have you looked at the assembly code for this function? GCC 3
and GCC 4 do not include the "if (0)" block in their output, even with
optimization disabled. GDB is setting the breakpoint at the closest
possible location.
I do not consider this a bug.
--
Daniel Jacobowitz
CodeSourcery
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]