public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "safinaskar at mail dot ru" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/52160] New: gdb ignores line "bar: if(foo)goto bar;" Date: Tue, 07 Feb 2012 21:16:00 -0000 [thread overview] Message-ID: <bug-52160-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52160 Bug #: 52160 Summary: gdb ignores line "bar: if(foo)goto bar;" Classification: Unclassified Product: gcc Version: 4.4.5 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: safinaskar@mail.ru foo.c: ----------------------------------- #include <stdio.h> int main() { int foo; printf("Enter foo: "); scanf("%d", &foo); bar: if(foo)goto bar; return 0; } ----------------------------------- 0:~# gcc -g foo.c 0:~# gdb a.out GNU gdb (GDB) 7.0.1-debian Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /root/a.out...done. (gdb) start Temporary breakpoint 1 at 0x804842d: file foo.c, line 6. Starting program: /root/a.out Temporary breakpoint 1, main () at foo.c:6 6 printf("Enter foo: "); (gdb) n 7 scanf("%d", &foo); (gdb) Enter foo: 0 9 return 0; (gdb) q A debugging session is active. Inferior 1 [process 21382] will be killed. Quit anyway? (y or n) y ----------------------------------- But gdb must say: 6 printf("Enter foo: "); (gdb) n 7 scanf("%d", &foo); (gdb) Enter foo: 0 8 bar: if(foo)goto bar; (gdb) 9 return 0; ----------------------------------- 0:~# gdb a.out GNU gdb (GDB) 7.0.1-debian Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /root/a.out...done. (gdb) start Temporary breakpoint 1 at 0x804842d: file foo.c, line 6. Starting program: /root/a.out Temporary breakpoint 1, main () at foo.c:6 6 printf("Enter foo: "); (gdb) n 7 scanf("%d", &foo); (gdb) Enter foo: 1 ^C Program received signal SIGINT, Interrupt. 0x08048458 in main () at foo.c:8 8 bar: if(foo)goto bar; (gdb) q A debugging session is active. Inferior 1 [process 21399] will be killed. Quit anyway? (y or n) y ----------------------------------- But gdb must say: 6 printf("Enter foo: "); (gdb) n 7 scanf("%d", &foo); (gdb) Enter foo: 1 8 bar: if(foo)goto bar; (gdb) ^C ----------------------------------- 0:~# uname -a Linux debian 2.6.32-5-686 #1 SMP Sat Oct 30 22:47:19 UTC 2010 i686 GNU/Linux 0:~# gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.4.5 (Debian 4.4.5-8) Bug moved from http://sourceware.org/bugzilla/show_bug.cgi?id=12257
next reply other threads:[~2012-02-07 21:16 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-02-07 21:16 safinaskar at mail dot ru [this message] 2012-02-07 21:45 ` [Bug debug/52160] " pinskia at gcc dot gnu.org 2012-09-16 7:09 ` jan.kratochvil at redhat dot com 2012-09-16 7:10 ` jan.kratochvil at redhat dot com 2013-04-12 18:59 ` palves at redhat dot com 2024-01-08 16:16 ` ssbssa at yahoo dot de
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-52160-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).