public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/13018] New: Can't set Break point after C loop
@ 2011-07-22 22:17 mostafa_alshrief at yahoo dot com
  2011-08-03 20:49 ` [Bug breakpoints/13018] " tromey at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mostafa_alshrief at yahoo dot com @ 2011-07-22 22:17 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13018

           Summary: Can't set Break point after C loop
           Product: gdb
           Version: 7.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
        AssignedTo: unassigned@sourceware.org
        ReportedBy: mostafa_alshrief@yahoo.com


Created attachment 5856
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5856
the program that i'm trying to debug using gdb

hello every one ..

i'm having a problem debugging a c program using GDB

the problem is i can't set a break point in source code after a for loop for
example the following code

1 //simple programe that counts from 1 to 3 and print Finished then Exit
2 //it's written to test a problem in GDB
3  
4 #include <stdio.h>
5 
6 void main()
7 {
8        int i = 0;
9        printf("Count from 1 to 3\n");
10 
11        for(i=0;i<3;i++)
12        {
13                printf("%i\n",i);
14        }
15 
16        printf("Finished\n");
17        printf("Now to Exit\n");
18 }


when i try to set a break point at line 16 printf("Finished\n"); (or any after
line 11) ,i get the following message :

No line 16 in file "loops_and_gdb.c".

i compile using gcc like that:
gcc loops_and_gdb.c -g -o loops_and_gdb.exe


info line 16 says : Line number 16 is out of range for "loops_and_gdb.c".

info source: (after break main and run) says :
Current source file is loops_and_gdb.c
Compilation directory is /home/mostafa/Documents/problem/loops_and_gdb
Located in /home/mostafa/Documents/problem/loops_and_gdb/loops_and_gdb.c
Contains 18 lines.
Source language is c.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.

a screen-shot for Insight debugger it shows the same problem
http://i53.tinypic.com/2l89c8g.jpg

i have built the Insight Debugger from source so it might indeed
missed up the GDB pakages...
i got it from
http://www.tech.dmu.ac.uk/~glapworth/src/insight/insight-6.8-1-gl.tar.gz

when i set a break point at line 11 for(i=0;i<3;i++) ,then run then step the
code continues to the end and i get :
0xb7724c2e in __libc_start_main () from /lib/libc.so.6

when i do step again i get :
Single stepping until exit from function __libc_start_main, 
which has no line number information.

Program exited with code 014.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug breakpoints/13018] Can't set Break point after C loop
  2011-07-22 22:17 [Bug breakpoints/13018] New: Can't set Break point after C loop mostafa_alshrief at yahoo dot com
@ 2011-08-03 20:49 ` tromey at redhat dot com
  2012-01-14 22:40 ` sergiodj at redhat dot com
  2014-09-12 23:03 ` sergiodj at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at redhat dot com @ 2011-08-03 20:49 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13018

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
                 CC|                            |tromey at redhat dot com

--- Comment #1 from Tom Tromey <tromey at redhat dot com> 2011-08-03 20:49:08 UTC ---
This works fine for me.

Insight 6.8 is based on gdb 6.8, which is rather old.
Are you sure you tried the most recent gdb?
It prints the version when it starts up.

If you are trying a recent gdb then I suspect it is your compiler.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug breakpoints/13018] Can't set Break point after C loop
  2011-07-22 22:17 [Bug breakpoints/13018] New: Can't set Break point after C loop mostafa_alshrief at yahoo dot com
  2011-08-03 20:49 ` [Bug breakpoints/13018] " tromey at redhat dot com
@ 2012-01-14 22:40 ` sergiodj at redhat dot com
  2014-09-12 23:03 ` sergiodj at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: sergiodj at redhat dot com @ 2012-01-14 22:40 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13018

Sergio Durigan Junior <sergiodj at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sergiodj at redhat dot com

--- Comment #2 from Sergio Durigan Junior <sergiodj at redhat dot com> 2012-01-14 22:40:20 UTC ---
Is this problem still happening?  Tom did not manage to reproduce it, so I am
pinging one more time to see if any info is provided.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug breakpoints/13018] Can't set Break point after C loop
  2011-07-22 22:17 [Bug breakpoints/13018] New: Can't set Break point after C loop mostafa_alshrief at yahoo dot com
  2011-08-03 20:49 ` [Bug breakpoints/13018] " tromey at redhat dot com
  2012-01-14 22:40 ` sergiodj at redhat dot com
@ 2014-09-12 23:03 ` sergiodj at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: sergiodj at redhat dot com @ 2014-09-12 23:03 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=13018

Sergio Durigan Junior <sergiodj at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |OBSOLETE

--- Comment #3 from Sergio Durigan Junior <sergiodj at redhat dot com> ---
Closing as OBSOLETE due to inactivity.  Feel free to reopen if still valid.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-12 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-22 22:17 [Bug breakpoints/13018] New: Can't set Break point after C loop mostafa_alshrief at yahoo dot com
2011-08-03 20:49 ` [Bug breakpoints/13018] " tromey at redhat dot com
2012-01-14 22:40 ` sergiodj at redhat dot com
2014-09-12 23:03 ` sergiodj at redhat dot com

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).