How to set break point on one file of a project which has many files with same name?

WilliamKF picture WilliamKF · Mar 11, 2011 · Viewed 61.1k times · Source

I want to set a break point in gdb on file service.cpp on line 45 and I do:

gdb> break service.cpp:45

The problem is that there are many service.cpp files in my application and it is not picking the one I am interested in. How can I specify the right service.cpp file?

Answer

Carl Norum picture Carl Norum · Mar 11, 2011

Specify the full path:

gdb> break /Full/path/to/service.cpp:45