Search code examples
gdbbreakpointsambiguity

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


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?


Solution

  • Specify the full path:

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