Revision: 2228 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2228&view=re... Author: cesspit Date: 2011-10-04 11:28:35 +0000 (Tue, 04 Oct 2011) Log Message: ----------- debugger: gdb pretty printers, leaks
Modified Paths: -------------- trunk/geany-plugins/debugger/src/dbm_gdb.c
Modified: trunk/geany-plugins/debugger/src/dbm_gdb.c =================================================================== --- trunk/geany-plugins/debugger/src/dbm_gdb.c 2011-10-04 08:09:09 UTC (rev 2227) +++ trunk/geany-plugins/debugger/src/dbm_gdb.c 2011-10-04 11:28:35 UTC (rev 2228) @@ -1110,24 +1110,34 @@ gchar *expression = unescape(pos); g_string_assign(var->expression, expression); g_free(expression); + g_free(record); /* children number */ sprintf(command, "-var-info-num-children "%s"", varname); exec_sync_command(command, TRUE, &record); - pos = strstr(record, "numchild="") + strlen("numchild=""); *(strchr(pos, '"')) = '\0'; int numchild = atoi(pos); var->has_children = numchild > 0; + g_free(record);
/* value */ - sprintf(command, "-var-evaluate-expression "%s"", varname); + sprintf(command, "-data-evaluate-expression "%s"", var->expression->str); exec_sync_command(command, TRUE, &record); - pos = strstr(record, "value="") + strlen("value=""); + pos = strstr(record, "value=""); + if (!pos) + { + g_free(record); + sprintf(command, "-var-evaluate-expression "%s"", varname); + exec_sync_command(command, TRUE, &record); + pos = strstr(record, "value=""); + } + pos += + strlen("value=""); *(strrchr(pos, '"')) = '\0'; gchar *value = unescape(pos); g_string_assign(var->value, value); g_free(value); + g_free(record);
/* type */ sprintf(command, "-var-info-type "%s"", varname);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org