While the simple nested part of the breakpoint setting problem was fixed, I still am having breakpoint issues whith "multi-project" workspaces, built and debugged as one app under one workspace. Part of the problem is the way my projects are organized as some of the libraries are one to two folders above the main code and project in the source tree.
Today was the breaking point for me as I really needed to debug some code from a library and couldn't because any breakpoint or "run to cursor" set in any of the library files would be completely ignored. Stepping into the library functions would work, but my "single step" finger was developing spasms from its over-use.
What I think is the bottom line is that GDB appears to have issues executing breakpoints from full path names on files which were compiled with relative paths.
I did a quick hack to work-around debugging my current library problem:
Index: src/plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- src/plugins/debuggergdb/debuggergdb.cpp (revision 2640)
+++ src/plugins/debuggergdb/debuggergdb.cpp (working copy)
@@ -985,10 +985,12 @@
// static
void DebuggerGDB::ConvertToGDBFile(wxString& str)
{
- wxFileName fname = str;
- str = fname.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
- DebuggerGDB::ConvertToGDBDirectory(str);
- str << fname.GetFullName();
+ //wxFileName fname = str;
+ //str = fname.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
+ //DebuggerGDB::ConvertToGDBDirectory(str);
+ //str << fname.GetFullName();
+ // Seems that gdb only needs the file name to break
+ str = wxFileNameFromPath(str);
}
// static
But... The problem is that if there are two files with the same name at different locations in the project/workspace, it's a toss of the coin as to which file the breakpoint will happen in.
I
think the proper solution is to use the projects relative path to the source file (as shown when viewing the file's properies)
when the breakpoint is set. This way GDB has the same source file path found in the object file. Well, this seems like it would be the easiest solution.
I'll experiment when I have some time and file a proper report if any conclusions are reached...