LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-01-2010, 08:14 PM   #1
PJYang2009
LQ Newbie
 
Registered: Jul 2009
Location: China
Posts: 3

Rep: Reputation: 0
How to cancel a breakpoint in gdb?


Now I'm using gdb to debug my program, I Know i can use "break #num" to set a breakpoint, but how can i cancel a brekpoint, anybody can help me?
 
Old 06-01-2010, 09:35 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I'm really only posting the results from a google search. Does this do what you want?
Code:
It is often necessary to eliminate a breakpoint, watchpoint, or catchpoint once it has done its job and you no longer want your program to stop there. This is called deleting the breakpoint. A breakpoint that has been deleted no longer exists; it is forgotten.

With the clear command you can delete breakpoints according to where they are in your program. With the delete command you can delete individual breakpoints, watchpoints, or catchpoints by specifying their breakpoint numbers.

It is not necessary to delete a breakpoint to proceed past it. GDB automatically ignores breakpoints on the first instruction to be executed when you continue execution without changing the execution address.

clear
    Delete any breakpoints at the next instruction to be executed in the selected stack frame (see section 6.3 Selecting a frame). When the innermost frame is selected, this is a good way to delete a breakpoint where your program just stopped. 
clear function
clear filename:function
    Delete any breakpoints set at entry to the function function. 
clear linenum
clear filename:linenum
    Delete any breakpoints set at or within the code of the specified line. 
delete [breakpoints] [bnums...]
    Delete the breakpoints, watchpoints, or catchpoints of the numbers specified as arguments. If no argument is specified, delete all breakpoints (GDB asks confirmation, unless you have set confirm off). You can abbreviate this command as d.
 
Old 06-02-2010, 01:10 AM   #3
jim.yefeng
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Rep: Reputation: 0
1. Run "info breakpoints" to list all break points which you have set.
2. Run "delete #num" to delete your break point.
3. If you just want to cancel the break point tempoary,
Run "disable #num" is ok. Thereafter, you can run "enable #num" to re-enalble it if needed.
 
Old 06-02-2010, 01:43 AM   #4
PJYang2009
LQ Newbie
 
Registered: Jul 2009
Location: China
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks

Quote:
Originally Posted by gilead View Post
I'm really only posting the results from a google search. Does this do what you want?
Code:
It is often necessary to eliminate a breakpoint, watchpoint, or catchpoint once it has done its job and you no longer want your program to stop there. This is called deleting the breakpoint. A breakpoint that has been deleted no longer exists; it is forgotten.

With the clear command you can delete breakpoints according to where they are in your program. With the delete command you can delete individual breakpoints, watchpoints, or catchpoints by specifying their breakpoint numbers.

It is not necessary to delete a breakpoint to proceed past it. GDB automatically ignores breakpoints on the first instruction to be executed when you continue execution without changing the execution address.

clear
    Delete any breakpoints at the next instruction to be executed in the selected stack frame (see section 6.3 Selecting a frame). When the innermost frame is selected, this is a good way to delete a breakpoint where your program just stopped. 
clear function
clear filename:function
    Delete any breakpoints set at entry to the function function. 
clear linenum
clear filename:linenum
    Delete any breakpoints set at or within the code of the specified line. 
delete [breakpoints] [bnums...]
    Delete the breakpoints, watchpoints, or catchpoints of the numbers specified as arguments. If no argument is specified, delete all breakpoints (GDB asks confirmation, unless you have set confirm off). You can abbreviate this command as d.
Thanks very much! I used "clear", and it worked fine
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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]how to exec cmd when breakpoint was hit jackandking Linux - Software 1 12-08-2008 11:49 PM
gdb breakpoint doesnt work? Thinking Programming 3 09-29-2005 06:36 AM
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
gas and gdb - breakpoint not "breaking" prell Programming 3 07-30-2004 06:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:43 PM.

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