LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-12-2011, 05:29 PM   #1
smudge
LQ Newbie
 
Registered: Oct 2003
Distribution: Slackware 9.1
Posts: 22

Rep: Reputation: 0
gdb Control-C not working


Hi,

I've just started using gdb at my new job, and I'm having a small issue debugging C++ with it. After I execute "continue" or "run" through gdb, I'm not able to return control to gdb.

Based on the documentation I read, I should be able to use Control-C to interrupt the program, and have control return to gdb.

This does not work on my setup. Not sure if it's related, but I'm debugging on a remote machine. I tried through PuTTY and xterm using Exceed XServer. In both cases, gdb does not respond to Control-C.

This is quite annoying because I have to restart my program every time I want to set a breakpoint. Any help would be appreciated.

Thanks!
 
Old 05-12-2011, 09:55 PM   #2
plpl303a
Member
 
Registered: May 2011
Posts: 52

Rep: Reputation: 3
To see if it's a problem with the terminal settings: Can you do this:

-start gdb
-run your program
-in another terminal window, use: kill -TERM pid (where pid is the process id of the program you're debugging).

This *should* result in GDB regaining control. If it does, then that means that the terminal isn't properly issuing a signal in response to control-c. If it doesn't then it means gdb isn't intercepting the interrupt signal.
 
Old 05-13-2011, 07:55 AM   #3
smudge
LQ Newbie
 
Registered: Oct 2003
Distribution: Slackware 9.1
Posts: 22

Original Poster
Rep: Reputation: 0
Thanks... Actually, I just created a simple C++ program that goes into an infinite loop. I'm able to pause this program in debug mode. I guess the issue is caused by how my program is handling signals.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GDB control-C delivers SIGHUP to multi-threaded processes under Debian Lenny Drew Eckhardt Debian 0 05-09-2011 10:05 PM
gdb not working in xemacs in Gentoo Linux 2006 dvpqew Linux - Software 1 01-06-2007 11:11 PM
normal gdb and spec gdb for kgdb Igor007 Programming 1 09-23-2005 04:15 PM
normal gdb and spec gdb for kgdb Igor007 Linux - Newbie 1 09-23-2005 01:41 PM
gdb .. looking for 32 bit gdb.. for ia64 suse.. nkshirsagar SUSE / openSUSE 0 12-09-2004 03:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration