Solved

How to save breakpoints and tracepoints in gdb?

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Today companies are subjected to more-and-more data, and it won't stop any time soon.  But there are obvious opportunities for reducing data, particularly data duplicated among companies.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now