Skip to content

Commit

Permalink
scope - fixed inspect update/refresh and win32 waf build paths
Browse files Browse the repository at this point in the history
  • Loading branch information
zhekov committed Aug 27, 2013
1 parent 4784187 commit c2bf3e7
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 34 deletions.
35 changes: 26 additions & 9 deletions scope/ChangeLog
@@ -1,18 +1,35 @@
2013-08-25 Dimitar Zhekov <dimitar.zhekov@gmail.com>

* docs/codes.html, docs/scope.html, src/inspect.c,
src/prefs.c, src/prefs.h, src/views.c:
Fixed Inspect Refresh.
Added an option to disable Inspect Refresh/update in Hang mode
(causes internal gdb error).
* wscript_build:
Fixed the path handling when building with Waf under win32: Geany
does not change to it's own directory any more.
* src/register.c, src/scope.c:
Fixed unused variable warnings.
* docs/scope.html, src/scope.c:
Increased version to 0.91.3.


2013-07-30 Dimitar Zhekov <dimitar.zhekov@gmail.com>

* src/views.c:
Use map signal to pre-change contents when editing tree
cells, since map-event is not received under Windows.
Use map signal to pre-change contents when editing tree cells,
since map-event is not received under Windows.
* Windows panel defaults to THREADS view, not PROGRAM.


2013-07-25 Dimitar Zhekov <dimitar.zhekov@gmail.com>

* src/break.c, src/conterm.c, src/debug.c, src/inspect.c,
src/memory.c, src/menu.c, src/parse.c, src/program.c,
src/register.c, src/scope.c, src/stack.c, src/thread.c,
src/tooltip.c, src/tooltip.h, src/views.c:
Explicitly initialize all sensitive global and static
variables, since reloading the plugin will not do that.
Explicitly initialize all sensitive global and static variables,
since reloading the plugin will not do that.
* src/store/scptreestore.c:
Fixed indentation.
* docs/scope.html, src/scope.c:
Expand All @@ -22,8 +39,8 @@
2013-07-11 Dimitar Zhekov <dimitar.zhekov@gmail.com>

* src/scope.c:
Update toolbar state when saving a document or switching to
another document, and properly cache the last state.
Update toolbar state when saving a document or switching to another
document, and properly cache the last state.
* src/utils.c:
Recognize F77 as gdb-supported file type (was only Fortran).
* docs/scope.html, src/scope.c:
Expand Down Expand Up @@ -58,8 +75,8 @@
2013-07-02 Dimitar Zhekov <dimitar.zhekov@gmail.com>

* src/views.c:
Fixed shutdown sequence error when destroying Inspect or
Registers switches to the other page and causes refresh.
Fixed shutdown sequence error when destroying Inspect or Registers
switches to the other page and causes refresh.
Fixed the page number to refresh when switching to Inspect or
Registers.

Expand Down Expand Up @@ -183,7 +200,7 @@

2013-03-07 Enrico Tröger <enrico.troeger@uvena.de>

* wscript_build
* wscript_build:
Fixed the path handling when building with Waf.


Expand Down
3 changes: 3 additions & 0 deletions scope/NOTES
@@ -1,3 +1,6 @@
-var-evaluate-expression reports the value from the last -var-update or
-var-assign execution, not the current value

reloading a resident geany plugin module does not reinitialize any global
and static variables, so the sensitive ones must be initialized explicitly

Expand Down
8 changes: 6 additions & 2 deletions scope/docs/codes.html
Expand Up @@ -109,7 +109,7 @@

<tr><td class="nowrap">02&lt;scid&gt;-var-evaluate-expression</td>
<td class="tab"><em>Refresh</em> inspects</td>
<td class="tab">update register value</td></tr>
<td class="tab">update inspect value</td></tr>

<tr><td class="nowrap">&nbsp;</td><td class="tab">&nbsp;</td><td class="tab">&nbsp;</td></tr>

Expand All @@ -135,10 +135,14 @@
<td class="tab">views idle update</td>
<td class="tab">(print instruction in debug console)</td></tr>

<tr><td class="nowrap">04-var-update</td>
<tr><td class="nowrap">040-var-update</td>
<td class="tab">views idle update</td>
<td class="tab">(partial) inspects update</td></tr>

<tr><td class="nowrap">041-var-update</td>
<td class="tab"><em>Refresh</em> inspects</td>
<td class="tab">(prepare gdb for -var-evaluate-expression)</td></tr>

<tr><td class="nowrap">04&lt;tid&gt;-stack-list-frames</td>
<td class="tab">views idle update</td>
<td class="tab">same as 02</td></tr>
Expand Down
18 changes: 14 additions & 4 deletions scope/docs/scope.html
Expand Up @@ -459,8 +459,9 @@ <h3><a name="debug_panel">Debug panel</a></h3>

<p><b><a name="inspect">Inspect</a></b></p>

<p>All -var-* commands except -var-update will be ignored when entered from the command line,
because their output does not provide enough information to identify the variable object.</p>
<p>-var-* commands entered from the command line will not update the <em>Inspect</em> view,
because their output does not provide enough information to identify the variable object,
and/or their PRINT-VALUES argument is unknown.</p>

<p><em>Jump To</em> lists the top-level variables, which is useful if you have a lot of
children displayed. It's disabled while gdb is inactive, because all variables are collapsed
Expand Down Expand Up @@ -508,7 +509,13 @@ <h3><a name="preferences">Preferences</a></h3>
larger, for example Scope may be activated only 10 times per second if Geany is idle.</p>

<p><em>async_break_bugs</em> (win~1 only) - whether gdb escapes slashes twice in the
asynchronous break messages. If true, only <tt>=breakpoint-deleted</tt> will be handled.</p>
asynchronous break messages. if true (the default), only <tt>=breakpoint-deleted</tt> will be
handled.</p>

<p><em>var_update_bug</em> - whether -var-update causes internal gdb error if the program is
loaded but not running. If true (the default), the update of inspect expressions (including
<em>Refresh</em>) will be disabled in <em>Hand</em> state. AFAIK, they will always have the
globally initialized values (if any) in that state anyway.</p>

<p><em>auto_view_source</em> - seek in source on single click in threads, breakpoints
and stack.</p>
Expand Down Expand Up @@ -591,6 +598,9 @@ <h3><a name="notes">Notes</a></h3>
<p>A disabled check button or check menu item means that the respective functionality is
unavailable; it doesn't matter if the interface element is checked or not.</p>

<p>Frame-dependent commands entered from the command line will not update the respective view,
because their output does not contain thread and frame information.</p>

<p><b><a name="editing_values">Editing values</a></b></p>

<div>GDB often displays values in format unsuitable for assigning. So when editing a value,
Expand Down Expand Up @@ -738,7 +748,7 @@ <h3><a name="legal_info">Legal information</a></h3>

<b><a name="copyright">Copyright</a></b>

<p>Scope 0.91.2, Copyright (C) 2013 Dimitar Toshkov Zhekov</p>
<p>Scope 0.91.3, Copyright (C) 2013 Dimitar Toshkov Zhekov</p>

<p>The menu and toolbar icons are from <a href="http://netbeans.org">Netbeans</a>, except for
BreakPoint.</p>
Expand Down
19 changes: 14 additions & 5 deletions scope/src/inspect.c
Expand Up @@ -485,9 +485,14 @@ static gboolean query_all_inspects;
void on_inspect_changelist(GArray *nodes)
{
GArray *changelist = parse_lead_array(nodes);
const char *token = parse_grab_token(nodes);

if (parse_grab_token(nodes))
parse_foreach(changelist, (GFunc) inspect_node_change, NULL);
if (token)
{
iff (*token <= '1', "%s: invalid i_oper", token)
if (*token == '0')
parse_foreach(changelist, (GFunc) inspect_node_change, NULL);
}
else if (changelist->len)
query_all_inspects = TRUE;
}
Expand Down Expand Up @@ -547,7 +552,8 @@ static gint inspect_iter_refresh(ScpTreeStore *store, GtkTreeIter *iter, gpointe

static void inspects_send_refresh(char token)
{
scp_tree_store_traverse(store, TRUE, NULL, NULL, inspect_iter_refresh, NULL);
scp_tree_store_traverse(store, TRUE, NULL, NULL, inspect_iter_refresh,
GINT_TO_POINTER(token));
query_all_inspects = FALSE;
}

Expand All @@ -556,7 +562,7 @@ gboolean inspects_update(void)
if (query_all_inspects)
inspects_send_refresh('4');
else
debug_send_command(F, "04-var-update 1 *");
debug_send_command(F, "040-var-update 1 *");

return TRUE;
}
Expand Down Expand Up @@ -783,6 +789,7 @@ void inspects_save(GKeyFile *config)

static void on_inspect_refresh(G_GNUC_UNUSED const MenuItem *menu_item)
{
debug_send_command(F, "041-var-update 1 *");
inspects_send_refresh('2');
}

Expand Down Expand Up @@ -971,7 +978,7 @@ static void on_inspect_delete(G_GNUC_UNUSED const MenuItem *menu_item)

static MenuItem inspect_menu_items[] =
{
{ "inspect_refresh", on_inspect_refresh, DS_VARIABLE, NULL, NULL },
{ "inspect_refresh", on_inspect_refresh, DS_DEBUG, NULL, NULL },
{ "inspect_add", on_inspect_add, DS_NOT_BUSY, NULL, NULL },
{ "inspect_edit", on_inspect_edit, DS_EDITABLE, NULL, NULL },
{ "inspect_apply", on_inspect_apply, DS_APPLIABLE, NULL, NULL },
Expand Down Expand Up @@ -1148,6 +1155,8 @@ void inspect_init(void)
g_signal_connect(selection, "changed", G_CALLBACK(on_inspect_selection_changed), NULL);
menu = menu_select("inspect_menu", &inspect_menu_info, selection);
g_signal_connect(menu, "show", G_CALLBACK(on_inspect_menu_show), NULL);
if (!pref_var_update_bug)
inspect_menu_items->state = DS_VARIABLE;

inspect_dialog = dialog_connect("inspect_dialog");
inspect_name = GTK_ENTRY(get_widget("inspect_name_entry"));
Expand Down
2 changes: 2 additions & 0 deletions scope/src/prefs.c
Expand Up @@ -34,6 +34,7 @@ gint pref_gdb_wait_death;
gint pref_gdb_send_interval;
gboolean pref_async_break_bugs;
#endif
gboolean pref_var_update_bug;

gboolean pref_auto_view_source;
gboolean pref_keep_exec_point;
Expand Down Expand Up @@ -237,6 +238,7 @@ void prefs_init(void)
stash_group_add_integer(group, &pref_gdb_send_interval, "gdb_send_interval", 5);
stash_group_add_boolean(group, &pref_async_break_bugs, "async_break_bugs", TRUE);
#endif
stash_group_add_boolean(group, &pref_var_update_bug, "var_update_bug", TRUE);
stash_group_add_boolean(group, &pref_auto_view_source, "auto_view_source", FALSE);
stash_group_add_boolean(group, &pref_keep_exec_point, "keep_exec_point", FALSE);
stash_group_add_integer(group, &pref_visual_beep_length, "visual_beep_length", 25);
Expand Down
1 change: 1 addition & 0 deletions scope/src/prefs.h
Expand Up @@ -27,6 +27,7 @@ extern gint pref_gdb_wait_death;
extern gint pref_gdb_send_interval;
extern gboolean pref_async_break_bugs;
#endif
extern gboolean pref_var_update_bug;

extern gboolean pref_auto_view_source;
extern gboolean pref_keep_exec_point;
Expand Down
1 change: 0 additions & 1 deletion scope/src/register.c
Expand Up @@ -375,7 +375,6 @@ static gboolean register_load(GKeyFile *config, const char *section)
char *name = utils_key_file_get_string(config, section, "name");
gint format = utils_get_setting_integer(config, section, "format", FORMAT_NATURAL);
gboolean valid = FALSE;
GtkTreeIter iter;

if (name && (unsigned) format < FORMAT_COUNT)
{
Expand Down
4 changes: 2 additions & 2 deletions scope/src/scope.c
Expand Up @@ -32,7 +32,7 @@ GeanyFunctions *geany_functions;
PLUGIN_VERSION_CHECK(215)

PLUGIN_SET_TRANSLATABLE_INFO(LOCALEDIR, GETTEXT_PACKAGE, _("Scope Debugger"),
_("Relatively simple GDB front-end."), "0.91.2" ,
_("Relatively simple GDB front-end."), "0.91.3" ,
"Dimitar Toshkov Zhekov <dimitar.zhekov@gmail.com>")

/* Keybinding(s) */
Expand Down Expand Up @@ -379,7 +379,7 @@ static void on_document_filetype_set(G_GNUC_UNUSED GObject *obj, GeanyDocument *
toolbar_update_state(state);
}

static void on_document_activate(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc,
static void on_document_activate(G_GNUC_UNUSED GObject *obj, G_GNUC_UNUSED GeanyDocument *doc,
G_GNUC_UNUSED gpointer user_data)
{
toolbar_update_state(debug_state());
Expand Down
5 changes: 4 additions & 1 deletion scope/src/views.c
Expand Up @@ -50,7 +50,7 @@ static ViewInfo views[VIEW_COUNT] =
{ FALSE, VC_FRAME, watches_clear, watches_update, FALSE, DS_VARIABLE },
{ FALSE, VC_DATA, memory_clear, memory_update, FALSE, DS_VARIABLE },
{ FALSE, VC_NONE, NULL, dc_update, FALSE, DS_DEBUG },
{ FALSE, VC_FRAME, inspects_clear, inspects_update, FALSE, DS_VARIABLE },
{ FALSE, VC_FRAME, inspects_clear, inspects_update, FALSE, DS_DEBUG },
{ FALSE, VC_FRAME, registers_clear, registers_update, TRUE, DS_DEBUG },
{ FALSE, VC_DATA, tooltip_clear, tooltip_update, FALSE, DS_SENDABLE },
{ FALSE, VC_NONE, menu_clear, NULL, FALSE, 0 }
Expand Down Expand Up @@ -611,6 +611,9 @@ void views_init(void)
#endif
last_views_state = 0;

if (!pref_var_update_bug)
views[VIEW_INSPECT].state = DS_VARIABLE;

command_dialog = dialog_connect("command_dialog");
command_view = get_widget("command_view");
command_text = gtk_text_view_get_buffer(GTK_TEXT_VIEW(command_view));
Expand Down
19 changes: 9 additions & 10 deletions scope/wscript_build
Expand Up @@ -28,25 +28,24 @@ name = 'Scope'
includes = ['scope/src', 'scope/src/store']

if target_is_win32(bld):
datadir = '${GEANYPLUGINS_DATADIR}/geany-plugins/scope'
datadir = '${G_PREFIX}/${GEANYPLUGINS_DATADIR}/geany-plugins/scope'
docdir = 'doc/plugins/scope'
prefix = '${G_PREFIX}/'
htmldocdir = '${G_PREFIX}/%s/html' % docdir
libraries = []
else:
datadir = '${GEANYPLUGINS_DATADIR}/geany-plugins/scope'
docdir = '${DOCDIR}/scope'
prefix = ''
htmldocdir = '%s/html' % docdir
libraries = ['VTE', 'UTIL']

htmldocdir = '%s/html' % docdir
defines = [ subst_vars('PLUGINDATADIR="' + datadir + '"', bld.env),
subst_vars('PLUGINHTMLDOCDIR="' + htmldocdir + '"', bld.env)]
defines = [ subst_vars('PLUGINDATADIR="' + datadir + '"', bld.env).replace("\\", "/"),
subst_vars('PLUGINHTMLDOCDIR="' + htmldocdir + '"', bld.env).replace("\\", "/")]

build_plugin(bld, name, includes=includes, libraries=libraries, defines=defines)

bld.install_files('%s%s' % (prefix, htmldocdir), 'docs/codes.html')
bld.install_files('%s%s' % (prefix, htmldocdir), 'docs/scope.html')
bld.install_files(htmldocdir, 'docs/codes.html')
bld.install_files(htmldocdir, 'docs/scope.html')

start_dir = bld.path.find_dir('data')
bld.install_files('%s%s' % (prefix, datadir), start_dir.ant_glob('*.png'), cwd=start_dir)
bld.install_files('%s%s' % (prefix, datadir), 'data/scope.glade')
bld.install_files(datadir, start_dir.ant_glob('*.png'), cwd=start_dir)
bld.install_files(datadir, 'data/scope.glade')

0 comments on commit c2bf3e7

Please sign in to comment.