GDB debugger problem

M

mohi

hello everyone,
i was debugging a simple program using gdb debugger and when in
function display
on the simple line
cout<<"this is the out put";
.........
........
......
there was no output from the program and the gdb promp(gdb>)
also disappered from here on and after sometime it showed something
like
"the program recived signal SIGINT" or something like that
and also while running the program this few lines were not displayed
(im using fedora core 8 and was on g++ on command line)
can anyone please tell what was wrong with that.

mohan
 
V

Victor Bazarov

mohi said:
i was debugging a simple program using gdb debugger and when in
function display
on the simple line
cout<<"this is the out put";
........
.......
.....
there was no output from the program and the gdb promp(gdb>)
also disappered from here on and after sometime it showed something
like
"the program recived signal SIGINT" or something like that
and also while running the program this few lines were not displayed
(im using fedora core 8 and was on g++ on command line)
can anyone please tell what was wrong with that.

Whatever is wrong with that, it has nothing to do with C++ language.
Consider asking in an appropriate gnu.* newsgroup or the newsgroup
for your platform.

V
 
C

Christopher

hello everyone,
i was debugging a simple program using gdb debugger and when in
function display
on the simple line
cout<<"this is the out put";
........
.......
.....
there was no output from the program and the gdb promp(gdb>)
also disappered from here on and after sometime it showed something
like
"the program recived signal SIGINT" or something like that
and also while running the program this few lines were not displayed
(im using fedora core 8 and was on g++ on command line)
can anyone please tell what was wrong with that.

mohan

Show more source. You have a segmentation fault in your code.
 
J

James Kanze

Whatever is wrong with that, it has nothing to do with C++ language.

The fact that nothing was displayed probably does. At the very
least, his output isn't significant without a flush.
Consider asking in an appropriate gnu.* newsgroup or the
newsgroup for your platform.

While that's true too, I doubt that he'll get much help anywhere
with such a vague description.

FWIW: under Unix, SIGINT is normally what the program gets when
you enter control-C. Program errors more often result in
SIGSEGV or SIGBUS, or maybe SIGILL, SIGFPE or SIGSYS. But of
course, given an error wierd enough, just about anything can
happen.
 
J

James Kanze

Show more source. You have a segmentation fault in your code.

That would be SIGSEGV. Normally, SIGINT is generated by
control-C on the keyboard.

Since the poster didn't indicate what gdb commands he'd used
(not that that would be on topic here), it's impossible to say
what might be happening. One thing is clear, however: he didn't
ask for any output from the program, so it's not surprising that
he didn't get any. And of course, the gdb prompt only appears
when the program has stopped for some reason; if the program is
executing, gdb doesn't output a prompt.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top