?
Solved

How to save breakpoints and tracepoints in gdb?

Posted on 2008-06-24
3
Medium Priority
?
1,973 Views
Last Modified: 2013-12-12
I am using gdb. I am not able to use ddd because my connection is slow and not able to run xterm. i am not able to use emacs, because I have not learned it.

Now it is painful to set up my traces and breaks every time.

Is there a way to save all this work for next time I run the debug?

0
Comment
Question by:EmadGirgis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 14

Expert Comment

by:agriesser
ID: 21864311
There is no way known to me to save breakpoints and the like using the command line interface or the text user interface in gdb.
You can, though, create a .gdbinit file (see man gdb) and store the breakpoint commands in there (although I don't think that this is really a good idea, as breakpoints might change when the program evolves, etc.).

So I think you're out of luck here, even if this is not the answer you wanted to hear.
0
 
LVL 14

Accepted Solution

by:
agriesser earned 1000 total points
ID: 21864337
Forgot to add:
Tracepoints can be saved using the "save-tracepoints /path/to/file" command. If you want to load the tracepoints again, use the "source /path/to/file" command.

Another idea to make life easier with not being able to save breakpoints:
You can turn history saving on:

(gdb) set history save on

That way, gdb will save the command history into a file and in future invocations of gdb, you can cycle through your previous commands (breakpoint definitions, etc.).

To make this change permanent, you need to add "set history save on" to your gdbinit file.
0
 
LVL 14

Expert Comment

by:agriesser
ID: 21905339
You should definetly read http://www.experts-exchange.com/help.jsp, especially the section "What is the right grade to give?".
0

Featured Post

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Starting up a Project
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question