[geany/geany-plugins] c823ec: debugger: Restore behavior when GDB stops with reason=location-reached

Colomban Wendling git-noreply at xxxxx
Sun Nov 15 17:28:24 UTC 2015


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 27 Oct 2014 21:19:26 UTC
Commit:      c823ecce37e85f08a446e19f52bfe90dd61de093
             https://github.com/geany/geany-plugins/commit/c823ecce37e85f08a446e19f52bfe90dd61de093

Log Message:
-----------
debugger: Restore behavior when GDB stops with reason=location-reached

Actually this reason isn't handled, and if it worked earlier is just
that it would use the previous stop reason in this case.

The updated code broke that as it always set the reason even when not
handled, so restore the old version.


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

Modified: debugger/src/dbm_gdb.c
7 lines changed, 6 insertions(+), 1 deletions(-)
===================================================================
@@ -483,7 +483,6 @@ static gboolean on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer d
 		}
 
 		/* looking for a reason to stop */
-		stop_reason = SR_EXITED_NORMALLY; /* somehow, sometimes there can be no stop reason */
 		if ((reason = gdb_mi_result_var(record->first, "reason", GDB_MI_VAL_STRING)) != NULL)
 		{
 			if (!strcmp(reason, "breakpoint-hit"))
@@ -498,6 +497,12 @@ static gboolean on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer d
 				stop_reason = SR_EXITED_SIGNALLED;
 			else if (!strcmp(reason, "exited"))
 				stop_reason = SR_EXITED_WITH_CODE;
+			/* FIXME: handle "location-reached" */
+		}
+		else
+		{
+			/* somehow, sometimes there can be no stop reason */
+			stop_reason = SR_EXITED_NORMALLY;
 		}
 		
 		if (SR_BREAKPOINT_HIT == stop_reason || SR_END_STEPPING_RANGE == stop_reason || SR_SIGNAL_RECIEVED == stop_reason)



--------------
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