4

Possible Duplicate:
How to avoid entering library's source files while debugging in Qt Creator with gdb?

anybody know how to tell gdb to only enter code that is in your project? I know it's hard for a debugger to know what is "in the project" and what is a library....but I thought some naive checks could help, eg don't look in any files that aren't in the users home directory. I frequently have code like this:

MyFunction(complexVarable, complexvar); //passed by value

and gdb insists on going through the copy constructors of the two passed values, but all I care about is MyFunction. Any tips? There are two parts to the question,

  1. ignore code that isn't mine (not in home dir)
  2. skip copies for function calls.

thanks.

EDIT: btw I use emacs, maybe there are some tools there I missed, but I'm open to using external gdb frontends.

Community
  • 1
  • 1
Chris H
  • 6,433
  • 5
  • 33
  • 51
  • 1
    `next` (instead of `step`) and `finish` may be useful. By default, `C-x C-a C-n` / `C-x C-a C-f` for the latter, in the Emacs gud-gdb mode. – ephemient Feb 05 '10 at 05:42
  • Have a look at https://stackoverflow.com/a/31629136/5155476 and https://stackoverflow.com/a/42721326/5155476 – codesniffer Jan 05 '19 at 15:03

1 Answers1

1

As per my opinion this cannot be done. every project has a flow of data from one function to other. gdb is designed to work on the flow of data. so if your project is somewhere in the middle of the flow,gdb cant help you,since evry function has some purpose to do with the input it gets and output it gives. all you can do is create the same function separately and replicate the scenario as if its running in teh flow by giving the inputs it needs and output it gives.

Vijay
  • 65,327
  • 90
  • 227
  • 319
  • left this question out for a few days, and I was afraid this was going to be the answer. thanks n'way – Chris H Feb 07 '10 at 02:59
  • @ChrisH: This functionality is available as the "skip" command in newer gdb. At this point the gdb 7.5 release does not have it and you have to build gdb from sources (weekly releases. 7.5.50 works and is easy to build). – nimrodm Nov 14 '12 at 11:19