By MnshSnghl

2009-09-25 08:04:18 8 Comments

Is there a single command in gdb which can set breakpoints on all the functions in a given file ? I know about rbreak regex which sets breakpoints in matching regular expression functions, but my file doesnt have fixed patterned functions.

In another way, is there a command by which I can set a breakpoint on a filename. Which will mean, whenever control gets inside this file, it should break ?

I personally think this should not be much difficult to implement in gdb, but just wondering if somebody has already done this.


@gnod 2014-03-11 13:06:11

(gdb) set height 0
(gdb) rbreak file.cpp:.*

worked fine for me.

In my case it was useful to shrink the result set a little bit by specifying a template argument for the functions contained in the file:

(gdb) rbreak file.cpp:.*TemplateClass.*

@Shaun Lebron 2011-11-09 07:50:40

@Employed Russian 2012-02-01 16:04:39

That doesn't work, and isn't expected to work:…

@Shaun Lebron 2012-02-09 22:45:14

Look for "rbreak file:regex" on the page I linked. I confirmed that it works in my own examples.

Related Questions

Sponsored Content

34 Answered Questions

[SOLVED] What's the difference between a method and a function?

9 Answered Questions

[SOLVED] What does the exclamation mark do before the function?

  • 2010-09-20 21:21:51
  • Sebastian Otto
  • 166923 View
  • 1240 Score
  • 9 Answer
  • Tags:   javascript function

39 Answered Questions

[SOLVED] var functionName = function() {} vs function functionName() {}

26 Answered Questions

[SOLVED] Set a default parameter value for a JavaScript function

11 Answered Questions

5 Answered Questions

[SOLVED] Can I set a breakpoint on 'memory access' in GDB?

1 Answered Questions

2 Answered Questions

[SOLVED] putting breakpoint in a file using "rbreak filename.c:." doesn't work

  • 2012-02-01 13:31:51
  • mezda
  • 4345 View
  • 5 Score
  • 2 Answer
  • Tags:   gdb

2 Answered Questions

[SOLVED] Gdb conditional regex break

Sponsored Content