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.

2 comments

@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: stackoverflow.com/questions/9096624/…

@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

25 Answered Questions

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

31 Answered Questions

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

38 Answered Questions

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

1 Answered Questions

10 Answered Questions

5 Answered Questions

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

2 Answered Questions

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

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

2 Answered Questions

[SOLVED] Gdb conditional regex break

2 Answered Questions

[SOLVED] gdb: how to set a breakpoint in a file with spaces

  • 2012-02-29 14:22:49
  • milianw
  • 1488 View
  • 1 Score
  • 2 Answer
  • Tags:   gdb

Sponsored Content