Gdb on my system is behaving abruptly.
Say if your program has some 10 lines of code in a function in your program.
Code are simple statements with no looping or jumps.
Example:
Say you put breakpoint at fn() start.
Your breakpoint hits and then say after debugging(using next/n gdb command) till 3 lines in the function the gdb shows directly the line say 7th line which it must not. Note that gdb does not execute the statement at that line.
Press again next and it will show properly 4th line now.
Why gdb is behaving so and how to make it normal?
GDB is GNU gdb (GDB) SUSE (7.3-0.6.1)
OS is SLES 64 bit.
Last edited by rupeshkp728; 04-10-2013 at 10:45 AM..
Reason: code
The output should be like the below:
This is the behavior expected, however it is on FreeBSD7.1 and the gdb on Linux behaves exactly the same unless on the latest version of GDB linux port introducing any kind of gdb-local environmental variable masking the next default. This might be the latest feature. Without this I don't find any reason (no doubt on the GDB code unless you compiled a tweaked source of it to install the same).
Look the release note of the GDB version you are using and try to grep for next to get better insight on the environmental variable, if any.
This User Gave Thanks to Praveen_218 For This Post:
I am using just n and not "n N" and still its showing me further lines though not executing them.
This is what I want to convey. Simply using 'n' and it behaves like 'n 1' as default. In your case it's 'n 7' as default. So just try explicitly as 'n 1' and see what happens. You may also try 'n -6' , 'n -2', 'n -1' to observe what happens.
My suggestion:
Just look at the release note of the GDB version your using or the latest manual for 'stepping' and/or 'next' behavior of the latest release.
This User Gave Thanks to Praveen_218 For This Post:
Hi, all
I try to understand the output from gdb
Program received signal SIGABRT, Aborted.
*** glibc detected *** /home/sys_cbo/dev/zif/bin/Debug/zifd: free(): invalid pointer: 0x00007fffac04d3d0 ***
how should i read this?
(gdb) backtrace
#0 0x0000003015e32925 in raise () from... (1 Reply)
Hi, I got:
host machine: RedHat (RHEL6)
virtual machine: RedHat (RHEL6)
I run (on host machine):
qemu-system-x86_64 ...... -S -s
after that i run (on host machine):
gdb
target remote localhost:1234
set architecture i386:x86-64
and then i can use (on host machine) 'ctrl + c' to... (2 Replies)
Hello,
I am having problem with debugging my code. I am writing a C code and then I compile it with the Makefile. I make a target file and then copy it in my Robot(Khepera III) and then run the program over there.
I compile it ofcorse on my machine and then copy the compiled file in the... (10 Replies)
Hi All,
I am trying to execute a binary and it is giving Segmentation Fault.
Can I use gdb to debug this error?
Secondly there is no core file generated , so when I an trying to run gdb with the binary only I am not able to set any breakpoints.
When I am running the gdb and the I am... (1 Reply)
Hi All,
I wanted to know if there is a core file generated and I am not sure for which Binary it is generated .
Can I use gdb to debug the core file ?
Thanks. (1 Reply)
Can anyone give me the link to a website having gdb tutorials
(for advanaced debugging & shortcuts)
http://www.burneddowndays.com/talk/YaBBImages/rolleyes.gif (1 Reply)
Which is better??
I have always been a gdb fan.. But ppl say dbx is beter better for debugging the core.. Do all GDB lovers agree to it???
:cool: (1 Reply)