Solved

How to save breakpoints and tracepoints in gdb?

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

726 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