[geany/geany-plugins] 80428a: debugger: Fix toggling breakpoints for unknown locations

Colomban Wendling git-noreply at xxxxx
Tue Feb 9 19:27:16 UTC 2016


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Tue, 09 Feb 2016 19:27:16 UTC
Commit:      80428ad33a8b59d687e23ca6dccd9edbf7d6155c
             https://github.com/geany/geany-plugins/commit/80428ad33a8b59d687e23ca6dccd9edbf7d6155c

Log Message:
-----------
debugger: Fix toggling breakpoints for unknown locations

Apparently unknown locations are reported by GDB with quotes around the
file name, so account for them when checking the file name.


Modified Paths:
--------------
    debugger/src/dbm_gdb.c

Modified: debugger/src/dbm_gdb.c
10 lines changed, 7 insertions(+), 3 deletions(-)
===================================================================
@@ -943,9 +943,13 @@ static int get_break_number(char* file, int line)
 		colon = strrchr(location, ':');
 		if (colon && atoi(colon + 1) == line)
 		{
-			gchar *fname = g_strndup(location, colon - location);
-			/* FIXME: the check used to be made against \"file\" (e.g. file surrounded
-			 * by backslash-quote), but that's not at least how GDB 7.7 does it */
+			gchar *fname;
+
+			/* quotes around filename (location not found or something?) */
+			if (*location == '"' && colon - location > 2)
+				fname = g_strndup(location + 1, colon - location - 2);
+			else
+				fname = g_strndup(location, colon - location);
 			break_found = strcmp(fname, file) == 0;
 			g_free(fname);
 		}



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list