Solved

How to save breakpoints and tracepoints in gdb?

Posted on 2008-06-24
3
1,937 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
  • 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 500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.

860 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