lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
List overview
Plugins-Commits
July 2013
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
plugins-commits@lists.geany.org
1 participants
5 discussions
Start a n
N
ew thread
[geany/geany-plugins] 478418: scope - cell signal and default view fixes for Windows
by Dimitar Zhekov
30 Jul '13
30 Jul '13
Branch: refs/heads/master Author: Dimitar Zhekov <dimitar.zhekov(a)gmail.com> Committer: Dimitar Zhekov <dimitar.zhekov(a)gmail.com> Date: Tue, 30 Jul 2013 17:49:45 UTC Commit: 4784187a04dca398cf5e29b3941264391f553399
https://github.com/geany/geany-plugins/commit/4784187a04dca398cf5e29b394126…
Log Message: ----------- scope - cell signal and default view fixes for Windows Modified Paths: -------------- scope/ChangeLog scope/src/views.c Modified: scope/ChangeLog 7 files changed, 7 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,10 @@ +2013-07-30 Dimitar Zhekov <dimitar.zhekov(a)gmail.com> + + * src/views.c: + 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(a)gmail.com> * src/break.c, src/conterm.c, src/debug.c, src/inspect.c, Modified: scope/src/views.c 7 files changed, 3 insertions(+), 4 deletions(-) =================================================================== @@ -258,8 +258,7 @@ static void on_editing_started(G_GNUC_UNUSED GtkCellRenderer *cell, GtkCellEdita gtk_entry_set_cursor_hadjustment(GTK_ENTRY(editable), hadjustment); } -static gboolean on_display_editable_map_event(GtkWidget *widget, G_GNUC_UNUSED GdkEvent *event, - gchar *display) +static gboolean on_display_editable_map(GtkWidget *widget, gchar *display) { gint position = 0; GtkEditable *editable = GTK_EDITABLE(widget); @@ -282,7 +281,7 @@ static void on_display_editing_started(G_GNUC_UNUSED GtkCellRenderer *cell, scp_tree_store_get_iter_from_string(store, &iter, path_str); scp_tree_store_get(store, &iter, COLUMN_VALUE, &value, COLUMN_HB_MODE, &hb_mode, -1); /* scrolling editable to the proper position is left as an exercise for the reader */ - g_signal_connect(editable, "map-event", G_CALLBACK(on_display_editable_map_event), + g_signal_connect(editable, "map", G_CALLBACK(on_display_editable_map), parse_get_display_from_7bit(value, hb_mode, MR_EDITVC)); } @@ -608,7 +607,7 @@ void views_init(void) #ifdef G_OS_UNIX view_current = VIEW_TERMINAL; #else - view_current = VIEW_PROGRAM; + view_current = VIEW_THREADS; #endif last_views_state = 0; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 015163: scope - explicitly init global/static variables
by Dimitar Zhekov
29 Jul '13
29 Jul '13
Branch: refs/heads/master Author: Dimitar Zhekov <dimitar.zhekov(a)gmail.com> Committer: Dimitar Zhekov <dimitar.zhekov(a)gmail.com> Date: Mon, 29 Jul 2013 16:28:42 UTC Commit: 015163d0f471250d6046d999f0b9fc9bcf689854
https://github.com/geany/geany-plugins/commit/015163d0f471250d6046d999f0b9f…
Log Message: ----------- scope - explicitly init global/static variables Modified Paths: -------------- scope/ChangeLog scope/NEWS scope/NOTES scope/docs/scope.html scope/src/break.c scope/src/conterm.c scope/src/debug.c scope/src/inspect.c scope/src/memory.c scope/src/menu.c scope/src/parse.c scope/src/program.c scope/src/register.c scope/src/scope.c scope/src/stack.c scope/src/store/scptreestore.c scope/src/thread.c scope/src/tooltip.c scope/src/tooltip.h scope/src/views.c Modified: scope/ChangeLog 14 files changed, 14 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,17 @@ +2013-07-25 Dimitar Zhekov <dimitar.zhekov(a)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. + * src/store/scptreestore.c: + Fixed indentation. + * docs/scope.html, src/scope.c: + Increased version to 0.91.2. + + 2013-07-11 Dimitar Zhekov <dimitar.zhekov(a)gmail.com> * src/scope.c: Modified: scope/NEWS 5 files changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,8 @@ +Scope 0.91.2 (2013-07-25) + + * Fixed various errors on plugin unload-and-reload. + + Scope 0.91.1 (2013-07-11) * (Un)Block toolbar Toggle Breakpoint when saving a document or Modified: scope/NOTES 3 files changed, 3 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,6 @@ +reloading a resident geany plugin module does not reinitialize any global +and static variables, so the sensitive ones must be initialized explicitly + register modified is 07 since changing a register ($dh, $mm1.uint64) may change another ($dx, $st1), and there is some chance of watches/inspects containing a register Modified: scope/docs/scope.html 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -738,7 +738,7 @@ <b><a name="copyright">Copyright</a></b> -<p>Scope 0.91.1, Copyright (C) 2013 Dimitar Toshkov Zhekov</p> +<p>Scope 0.91.2, 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> Modified: scope/src/break.c 4 files changed, 3 insertions(+), 1 deletions(-) =================================================================== @@ -676,7 +676,7 @@ void on_break_list(GArray *nodes) } } -gint break_async = -1; +gint break_async; void on_break_stopped(GArray *nodes) { @@ -1299,6 +1299,8 @@ void break_init(void) GtkWidget *menu; guint i; + break_async = -1; + tree = view_connect("break_view", &store, &selection, break_cells, "break_window", NULL); gtk_tree_view_column_set_cell_data_func(get_column("break_type_column"), GTK_CELL_RENDERER(get_object("break_type")), break_type_set_data_func, NULL, NULL); Modified: scope/src/conterm.c 34 files changed, 23 insertions(+), 11 deletions(-) =================================================================== @@ -28,6 +28,7 @@ #define NFD 5 #define DS_COPY (DS_BASICS | DS_EXTRA_1) +static int last_console_fd; #ifdef G_OS_UNIX #if (defined(__unix__) || defined(unix)) && !defined(USG) @@ -167,23 +168,22 @@ void on_vte_realize(GtkWidget *widget, G_GNUC_UNUSED gpointer gdata) #endif } -static VteTerminal *debug_console = NULL; /* non-NULL == vte console */ +static VteTerminal *debug_console; /* non-NULL == vte console */ static void console_output(int fd, const char *text, gint length) { static const char fd_colors[NFD] = { '6', '7', '1', '7', '5' }; static char setaf[5] = { '\033', '[', '3', '?', 'm' }; - static int last_fd = -1; gint i; - if (last_fd == 3 && fd != 0) + if (last_console_fd == 3 && fd != 0) vte_terminal_feed(debug_console, "\r\n", 2); - if (fd != last_fd) + if (fd != last_console_fd) { setaf[3] = fd_colors[fd]; vte_terminal_feed(debug_console, setaf, sizeof setaf); - last_fd = fd; + last_console_fd = fd; } if (length == -1) @@ -216,19 +216,21 @@ static void console_output_nl(int fd, const char *text, gint length) static GtkTextTag *fd_tags[NFD]; #define DC_LIMIT 32768 /* approx */ #define DC_DELTA 6144 -static guint dc_chars = 0; +static guint dc_chars; void context_output(int fd, const char *text, gint length) { - static int last_fd = -1; GtkTextIter end; gchar *utf8; gtk_text_buffer_get_end_iter(context, &end); - if (last_fd == 3 && fd != 0) + if (last_console_fd == 3 && fd != 0) gtk_text_buffer_insert(context, &end, "\n", 1); + if (fd != last_console_fd) + last_console_fd = fd; + if (length == -1) length = strlen(text); @@ -379,18 +381,23 @@ static guint console_menu_extra_state(void) static MenuInfo console_menu_info = { console_menu_items, console_menu_extra_state, 0 }; #ifdef G_OS_UNIX -static int pty_slave = -1; -char *slave_pty_name = NULL; +static int pty_slave; +char *slave_pty_name; #endif void conterm_init(void) { GtkWidget *console; - #ifdef G_OS_UNIX gchar *error = NULL; int pty_master; char *pty_name; +#endif + + last_console_fd = -1; +#ifdef G_OS_UNIX + pty_slave = -1; + slave_pty_name = NULL; program_window = get_widget("program_window"); console = vte_terminal_new(); @@ -488,6 +495,11 @@ void conterm_init(void) "#C0C0C0", "#C000C0" }; guint i; + #ifdef G_OS_UNIX + debug_console = NULL; + #endif + dc_chars = 0; + console = get_widget("debug_context"); gtk_widget_modify_base(console, GTK_STATE_NORMAL, &pref_vte_colour_back); gtk_widget_modify_cursor(console, &pref_vte_colour_fore, &pref_vte_colour_back); Modified: scope/src/debug.c 9 files changed, 6 insertions(+), 3 deletions(-) =================================================================== @@ -78,7 +78,7 @@ static int kill(HANDLE pid, int sig) KILLING } GdbState; -static GdbState gdb_state = INACTIVE; +static GdbState gdb_state; static GSource *gdb_source; static GPid gdb_pid; @@ -266,7 +266,7 @@ static gboolean source_check(G_GNUC_UNUSED GSource *source) } #endif /* G_OS_UNIX */ -static guint source_id = 0; +static guint source_id; static gboolean source_dispatch(G_GNUC_UNUSED GSource *source, G_GNUC_UNUSED GSourceFunc callback, G_GNUC_UNUSED gpointer gdata) @@ -325,7 +325,7 @@ static gboolean source_dispatch(G_GNUC_UNUSED GSource *source, } reading_pos = received->str; - result = waitpid(gdb_pid, &status, WNOHANG); + result = waitpid(gdb_pid, &status, WNOHANG); if (result == 0) { @@ -748,6 +748,9 @@ char *debug_send_evaluate(char token, gint scid, const gchar *expr) void debug_init(void) { + gdb_state = INACTIVE; + source_id = 0; + commands = g_string_sized_new(0x3FFF); received = g_string_sized_new(pref_gdb_buffer_length); MAXLEN = received->allocated_len - 1; Modified: scope/src/inspect.c 14 files changed, 9 insertions(+), 5 deletions(-) =================================================================== @@ -163,7 +163,7 @@ static void on_jump_to_menu_item_activate(GtkMenuItem *menuitem, G_GNUC_UNUSED g static GtkWidget *jump_to_item; static GtkContainer *jump_to_menu; -static gchar *jump_to_expr = NULL; +static gchar *jump_to_expr; static void on_inspect_row_inserted(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, G_GNUC_UNUSED gpointer gdata) @@ -480,7 +480,7 @@ static void inspect_node_change(const ParseNode *node, G_GNUC_UNUSED gpointer gd } } -static gboolean query_all_inspects = FALSE; +static gboolean query_all_inspects; void on_inspect_changelist(GArray *nodes) { @@ -681,10 +681,10 @@ static void on_inspect_display_edited(G_GNUC_UNUSED GtkCellRendererText *rendere }; static GObject *inspect_display; +static gboolean last_state_active; void inspects_update_state(DebugState state) { - static gboolean last_active = FALSE; gboolean active = state != DS_INACTIVE; GtkTreeIter iter; @@ -701,11 +701,11 @@ void inspects_update_state(DebugState state) g_object_set(inspect_display, "editable", var1 && !numchild, NULL); } - if (active != last_active) + if (active != last_state_active) { gtk_widget_set_sensitive(jump_to_item, active && scp_tree_store_get_iter_first(store, &iter)); - last_active = active; + last_state_active = active; } } @@ -1126,6 +1126,10 @@ void inspect_init(void) { GtkWidget *menu; + jump_to_expr = NULL; + query_all_inspects = FALSE; + last_state_active = FALSE; + jump_to_item = get_widget("inspect_jump_to_item"); jump_to_menu = GTK_CONTAINER(get_widget("inspect_jump_to_menu")); apply_item = menu_item_find(inspect_menu_items, "inspect_apply"); Modified: scope/src/memory.c 7 files changed, 5 insertions(+), 2 deletions(-) =================================================================== @@ -117,7 +117,7 @@ static void on_memory_bytes_editing_started(G_GNUC_UNUSED GtkCellRenderer *cell, static gint back_bytes_per_line; static gint bytes_per_line; -static gint bytes_per_group = 1; +static gint bytes_per_group; static void memory_configure(void) { @@ -133,7 +133,7 @@ static void memory_configure(void) } static guint64 memory_start; -static guint memory_count = 0; +static guint memory_count; #define MAX_BYTES (128 * MAX_BYTES_PER_LINE) /* +1 incomplete line */ static void write_block(guint64 start, const char *contents, guint count) @@ -382,6 +382,9 @@ void memory_init(void) GtkWidget *tree = GTK_WIDGET(view_connect("memory_view", &store, &selection, memory_cells, "memory_window", NULL)); + bytes_per_group = 1; + memory_count = 0; + memory_font = *pref_memory_font ? pref_memory_font : pref_vte_font; ui_widget_modify_font_from_string(tree, memory_font); g_signal_connect(get_object("memory_bytes"), "editing-started", Modified: scope/src/menu.c 10 files changed, 7 insertions(+), 3 deletions(-) =================================================================== @@ -51,7 +51,7 @@ void menu_item_execute(const MenuInfo *menu_info, const MenuItem *menu_item, gbo plugin_beep(); } -static gboolean block_execute = FALSE; +static gboolean block_execute; void menu_item_set_active(const MenuItem *menu_item, gboolean active) { @@ -109,7 +109,7 @@ static void on_menu_item_activate(GtkMenuItem *menuitem, MenuInfo *menu_info) } } -static MenuInfo *active_menu = NULL; +static MenuInfo *active_menu; static void update_active_menu(guint state) { @@ -404,7 +404,7 @@ void on_menu_update_boolean(const MenuItem *menu_item) *(gboolean *) menu_item->gdata = gtk_check_menu_item_get_active(item); } -static char *input = NULL; +static char *input; static gint eval_mr_mode; static gint scid_gen = 0; @@ -519,6 +519,10 @@ void menu_init(void) GList *children = gtk_container_get_children(GTK_CONTAINER(shell)); GtkWidget *search2 = find_widget(shell, "search2"); + block_execute = FALSE; + active_menu = NULL; + input = NULL; + popup_item = get_widget("popup_item"); menu_connect("popup_menu", &popup_menu_info, NULL); g_signal_connect(get_widget("popup_evaluate"), "button-release-event", Modified: scope/src/parse.c 7 files changed, 5 insertions(+), 2 deletions(-) =================================================================== @@ -439,8 +439,8 @@ gchar *parse_get_error(GArray *nodes) #define MAXLEN 0x7FF static GString *errors; -static guint errors_id = 0; -static guint error_count = 0; +static guint errors_id; +static guint error_count; static gboolean errors_show(G_GNUC_UNUSED gpointer gdata) { @@ -620,6 +620,9 @@ void parse_save(GKeyFile *config) void parse_init(void) { + errors_id = 0; + error_count = 0; + errors = g_string_sized_new(MAXLEN); parse_modes = SCP_TREE_STORE(get_object("parse_mode_store")); scp_tree_store_set_sort_column_id(parse_modes, MODE_NAME, GTK_SORT_ASCENDING); Modified: scope/src/program.c 3 files changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -307,7 +307,7 @@ void program_context_changed(void) #define build_check_execute() (build_get_execute(GEANY_BC_COMMAND) || \ build_get_execute(GEANY_BC_WORKING_DIR)) -static gboolean last_state_inactive = TRUE; +static gboolean last_state_inactive; void program_update_state(DebugState state) { @@ -442,6 +442,7 @@ void program_init(void) extern gboolean thread_select_on_exited; extern gboolean thread_select_follow; + last_state_inactive = TRUE; program_dialog = dialog_connect("program_dialog"); program_page_vbox = get_widget("program_page_vbox"); Modified: scope/src/register.c 7 files changed, 5 insertions(+), 2 deletions(-) =================================================================== @@ -70,7 +70,7 @@ static void register_node_update(const ParseNode *node, GString *commands[]) } } -static gboolean query_all_registers = TRUE; +static gboolean query_all_registers; static void registers_send_update(GArray *nodes, char token) { @@ -330,7 +330,7 @@ gboolean registers_update(void) return TRUE; } -static char *last_gdb_executable = NULL; +static char *last_gdb_executable; void registers_query_names(void) { @@ -527,6 +527,9 @@ static void on_register_selection_changed(G_GNUC_UNUSED GtkTreeSelection *select void register_init(void) { + query_all_registers = TRUE; + last_gdb_executable = NULL; + tree = GTK_WIDGET(view_connect("register_view", &store, &selection, register_cells, "register_window", ®ister_display)); gtk_widget_set_has_tooltip(tree, TRUE); Modified: scope/src/scope.c 31 files changed, 19 insertions(+), 12 deletions(-) =================================================================== @@ -32,7 +32,7 @@ PLUGIN_VERSION_CHECK(215) PLUGIN_SET_TRANSLATABLE_INFO(LOCALEDIR, GETTEXT_PACKAGE, _("Scope Debugger"), - _("Relatively simple GDB front-end."), "0.91.1" , + _("Relatively simple GDB front-end."), "0.91.2" , "Dimitar Toshkov Zhekov <dimitar.zhekov(a)gmail.com>") /* Keybinding(s) */ @@ -191,12 +191,13 @@ static void on_toolbar_reconfigured(GtkToolItem *tool_item, ToolItem *item) get_widget(item->icon[large])); } +static DebugState last_toolbar_state; + static void toolbar_update_state(DebugState state) { - static DebugState last_state = 0; state |= debug_menu_extra_state(); - if (state != last_state) + if (state != last_toolbar_state) { ToolItem *item; @@ -206,7 +207,7 @@ static void toolbar_update_state(DebugState state) menu_item_matches_state(debug_menu_items + item->index, state)); } - state = last_state; + last_toolbar_state = state; } } @@ -214,14 +215,14 @@ static void toolbar_update_state(DebugState state) static GtkWidget *debug_statusbar; static GtkLabel *debug_state_label; +static DebugState last_statusbar_state; + void statusbar_update_state(DebugState state) { - static DebugState last_state = DS_INACTIVE; - if (thread_state == THREAD_AT_ASSEMBLER) state = DS_EXTRA_1; - if (state != last_state) + if (state != last_statusbar_state) { static const char *const states[] = { N_("Busy"), N_("Ready"), N_("Debug"), N_("Hang"), N_("Assem"), N_("Load"), NULL }; @@ -242,7 +243,7 @@ void statusbar_update_state(DebugState state) gtk_statusbar_set_has_resize_grip(geany_statusbar, TRUE); #endif } - else if (last_state == DS_INACTIVE) + else if (last_statusbar_state == DS_INACTIVE) { #if GTK_CHECK_VERSION(3, 0, 0) gtk_window_set_has_resize_grip(GTK_WINDOW(geany->main_widgets->window), FALSE); @@ -252,11 +253,11 @@ void statusbar_update_state(DebugState state) gtk_widget_show(debug_statusbar); } - last_state = state; + last_statusbar_state = state; } } -static guint blink_id = 0; +static guint blink_id; static gboolean plugin_unblink(G_GNUC_UNUSED gpointer gdata) { @@ -312,7 +313,7 @@ static void on_document_open(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc, threads_mark(doc); } -static guint resync_id = 0; +static guint resync_id; static gboolean resync_readonly(G_GNUC_UNUSED gpointer gdata) { @@ -439,7 +440,7 @@ static void on_build_start(G_GNUC_UNUSED GObject *obj, G_GNUC_UNUSED gpointer gd { NULL, NULL } }; -static GtkBuilder *builder = NULL; +static GtkBuilder *builder; GObject *get_object(const char *name) { @@ -513,6 +514,11 @@ void plugin_init(G_GNUC_UNUSED GeanyData *gdata) ToolItem *tool_item = toolbar_items; const ScopeCallback *scb; + last_toolbar_state = 0; + last_statusbar_state = DS_INACTIVE; + blink_id = 0; + resync_id = 0; + main_locale_init(LOCALEDIR, GETTEXT_PACKAGE); scope_key_group = plugin_set_key_group(geany_plugin, "scope", COUNT_KB, NULL); builder = gtk_builder_new(); @@ -573,6 +579,7 @@ void plugin_init(G_GNUC_UNUSED GeanyData *gdata) conterm_init(); inspect_init(); register_init(); + tooltip_init(); parse_init(); debug_init(); views_init(); Modified: scope/src/stack.c 4 files changed, 3 insertions(+), 1 deletions(-) =================================================================== @@ -62,7 +62,7 @@ static void stack_node_location(const ParseNode *node, const char *fid) } } -const char *frame_id = NULL; +const char *frame_id; void on_stack_frames(GArray *nodes) { @@ -336,6 +336,8 @@ void stack_init(void) GtkTreeView *tree = view_create("stack_view", &store, &selection); GtkWidget *menu = menu_select("stack_menu", &stack_menu_info, selection); + frame_id = NULL; + view_set_sort_func(store, STACK_ID, store_gint_compare); view_set_sort_func(store, STACK_FILE, store_seek_compare); view_set_line_data_func("stack_line_column", "stack_line", STACK_LINE); Modified: scope/src/store/scptreestore.c 10 files changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -1059,7 +1059,7 @@ gboolean scp_tree_store_row_draggable(G_GNUC_UNUSED ScpTreeStore *store, { return TRUE; } - + gboolean scp_tree_store_drag_data_delete(ScpTreeStore *store, GtkTreePath *path) { GtkTreeIter iter; @@ -1123,9 +1123,9 @@ gboolean scp_tree_store_drag_data_received(ScpTreeStore *store, GtkTreePath *des GtkTreePath *src_path = NULL; GtkTreeIter src_iter; gboolean result = FALSE; - + validate_store(store); - + if (gtk_tree_get_row_drag_data(selection_data, &src_model, &src_path) && src_model == SCP_TREE_MODEL(store) && /* can only receive from ourselves */ scp_tree_store_get_iter(store, &src_iter, src_path)) @@ -1189,7 +1189,7 @@ gboolean scp_tree_store_row_drop_possible(ScpTreeStore *store, GtkTreePath *dest scp_tree_store_get_iter(store, &iter, parent_path); gtk_tree_path_free(parent_path); } - + if (src_path) gtk_tree_path_free(src_path); @@ -1437,7 +1437,7 @@ static gboolean scp_tree_store_buildable_custom_tag_start(GtkBuildable *buildabl parser_data->name = gtk_buildable_get_name(buildable); parser_data->types = g_array_new(FALSE, FALSE, sizeof(GType)); parser_data->collates = g_array_new(FALSE, FALSE, sizeof(gboolean)); - *parser = tree_model_parser; + *parser = tree_model_parser; *user_data = parser_data; return TRUE; } Modified: scope/src/thread.c 15 files changed, 10 insertions(+), 5 deletions(-) =================================================================== @@ -38,7 +38,7 @@ enum GROUP_PID }; -static ScpTreeStore *groups = NULL; +static ScpTreeStore *groups; void on_thread_group_started(GArray *nodes) { @@ -172,10 +172,10 @@ static void auto_select_thread(void) } } -guint thread_count = 0; -const char *thread_id = NULL; -ThreadState thread_state = THREAD_BLANK; -guint thread_prompt = 0; +guint thread_count; +const char *thread_id; +ThreadState thread_state; +guint thread_prompt; const char *thread_group_id(void) { @@ -876,6 +876,11 @@ void thread_init(void) GtkTreeView *tree = view_create("thread_view", &store, &selection); GtkWidget *menu = menu_select("thread_menu", &thread_menu_info, selection); + thread_count = 0; + thread_id = NULL; + thread_state = THREAD_BLANK; + thread_prompt = 0; + view_set_sort_func(store, THREAD_ID, store_gint_compare); view_set_sort_func(store, THREAD_FILE, store_seek_compare); view_set_line_data_func("thread_line_column", "thread_line", THREAD_LINE); Modified: scope/src/tooltip.c 20 files changed, 14 insertions(+), 6 deletions(-) =================================================================== @@ -48,9 +48,9 @@ static void tooltip_trigger(void) } } -static gchar *output = NULL; -static gint last_pos = -1; -static gint peek_pos = -1; +static gchar *output; +static gint last_pos; +static gint peek_pos; static gboolean show; static void tooltip_set(gchar *text) @@ -69,7 +69,7 @@ static void tooltip_set(gchar *text) } } -static gint scid_gen = 0; +static gint scid_gen; void on_tooltip_error(GArray *nodes) { @@ -86,7 +86,7 @@ void on_tooltip_error(GArray *nodes) } } -static char *input = NULL; +static char *input; void on_tooltip_value(GArray *nodes) { @@ -97,7 +97,7 @@ void on_tooltip_value(GArray *nodes) } } -static guint query_id = 0; +static guint query_id; static gboolean tooltip_launch(gpointer gdata) { @@ -200,6 +200,14 @@ gboolean tooltip_update(void) return TRUE; } +void tooltip_init(void) +{ + output = NULL; + tooltip_clear(); + input = NULL; + query_id = 0; +} + void tooltip_finalize(void) { g_free(output); Modified: scope/src/tooltip.h 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -28,6 +28,7 @@ void tooltip_clear(void); gboolean tooltip_update(void); +void tooltip_init(void); void tooltip_finalize(void); #define TOOLTIP_H 1 Modified: scope/src/views.c 17 files changed, 12 insertions(+), 5 deletions(-) =================================================================== @@ -114,7 +114,7 @@ void views_context_dirty(DebugState state, gboolean frame_only) } } -static ViewIndex view_current = 0; +static ViewIndex view_current; void views_clear(void) { @@ -580,18 +580,18 @@ gboolean view_command_active(void) return gtk_widget_get_visible(command_dialog); } +static DebugState last_views_state; + void views_update_state(DebugState state) { - static DebugState last_state = 0; - - if (state != last_state) + if (state != last_views_state) { if (gtk_widget_get_visible(command_dialog)) command_line_update_state(state); locals_update_state(state); watches_update_state(state); inspects_update_state(state); - last_state = state; + last_views_state = state; } } @@ -605,6 +605,13 @@ static void on_geany_sidebar_switch_page(G_GNUC_UNUSED GtkNotebook *notebook, void views_init(void) { +#ifdef G_OS_UNIX + view_current = VIEW_TERMINAL; +#else + view_current = VIEW_PROGRAM; +#endif + last_views_state = 0; + command_dialog = dialog_connect("command_dialog"); command_view = get_widget("command_view"); command_text = gtk_text_view_get_buffer(GTK_TEXT_VIEW(command_view)); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 4dc860: scope - update toolbar on document save/activate, support F77
by Dimitar Zhekov
11 Jul '13
11 Jul '13
Branch: refs/heads/master Author: Dimitar Zhekov <dimitar.zhekov(a)gmail.com> Committer: Dimitar Zhekov <dimitar.zhekov(a)gmail.com> Date: Thu, 11 Jul 2013 17:38:04 UTC Commit: 4dc860df2c96a325ffd634bb0ed108febf193567
https://github.com/geany/geany-plugins/commit/4dc860df2c96a325ffd634bb0ed10…
Log Message: ----------- scope - update toolbar on document save/activate, support F77 Modified Paths: -------------- scope/ChangeLog scope/NEWS scope/docs/scope.html scope/src/scope.c scope/src/utils.c Modified: scope/ChangeLog 11 files changed, 11 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,14 @@ +2013-07-11 Dimitar Zhekov <dimitar.zhekov(a)gmail.com> + + * src/scope.c: + 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: + Increased version to 0.91.1. + + 2013-07-05 Dimitar Zhekov <dimitar.zhekov(a)gmail.com> * src/codes.html: Modified: scope/NEWS 8 files changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,11 @@ +Scope 0.91.1 (2013-07-11) + + * (Un)Block toolbar Toggle Breakpoint when saving a document or + switching to another document. + + * Added F77 to the list of gdb-supported source file types. + + Scope 0.91 (2013-07-05) * Better support for float frame Inspect variables. Modified: scope/docs/scope.html 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -738,7 +738,7 @@ <b><a name="copyright">Copyright</a></b> -<p>Scope 0.91, Copyright (C) 2013 Dimitar Toshkov Zhekov</p> +<p>Scope 0.91.1, 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> Modified: scope/src/scope.c 16 files changed, 14 insertions(+), 2 deletions(-) =================================================================== @@ -32,7 +32,7 @@ PLUGIN_VERSION_CHECK(215) PLUGIN_SET_TRANSLATABLE_INFO(LOCALEDIR, GETTEXT_PACKAGE, _("Scope Debugger"), - _("Relatively simple GDB front-end."), "0.91" , + _("Relatively simple GDB front-end."), "0.91.1" , "Dimitar Toshkov Zhekov <dimitar.zhekov(a)gmail.com>") /* Keybinding(s) */ @@ -205,6 +205,8 @@ static void toolbar_update_state(DebugState state) gtk_widget_set_sensitive(item->widget, menu_item_matches_state(debug_menu_items + item->index, state)); } + + state = last_state; } } @@ -371,7 +373,15 @@ static gboolean on_editor_notify(G_GNUC_UNUSED GObject *obj, GeanyEditor *editor static void on_document_filetype_set(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc, G_GNUC_UNUSED GeanyFiletype *filetype_old, G_GNUC_UNUSED gpointer gdata) { - utils_lock_unlock(doc, debug_state() != DS_INACTIVE && utils_source_document(doc)); + DebugState state = debug_state(); + utils_lock_unlock(doc, state != DS_INACTIVE && utils_source_document(doc)); + toolbar_update_state(state); +} + +static void on_document_activate(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc, + G_GNUC_UNUSED gpointer user_data) +{ + toolbar_update_state(debug_state()); } static void on_project_open(G_GNUC_UNUSED GObject *obj, G_GNUC_UNUSED GKeyFile *config) @@ -419,6 +429,8 @@ static void on_build_start(G_GNUC_UNUSED GObject *obj, G_GNUC_UNUSED gpointer gd { "save-settings", G_CALLBACK(on_session_save) }, { "editor-notify", G_CALLBACK(on_editor_notify) }, { "document-filetype-set", G_CALLBACK(on_document_filetype_set) }, + { "document-activate", G_CALLBACK(on_document_activate) }, + { "document-save", G_CALLBACK(on_document_activate) }, { "project-before-save", G_CALLBACK(on_session_save) }, { "project-open", G_CALLBACK(on_project_open) }, { "project-close", G_CALLBACK(on_project_close) }, Modified: scope/src/utils.c 6 files changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -313,9 +313,9 @@ gboolean utils_source_filetype(GeanyFiletype *ft) { static const filetype_id ft_id[] = { GEANY_FILETYPES_C, GEANY_FILETYPES_CPP, GEANY_FILETYPES_D, GEANY_FILETYPES_OBJECTIVEC, GEANY_FILETYPES_FORTRAN, - GEANY_FILETYPES_JAVA, /* GEANY_FILETYPES_OPENCL_C, */ GEANY_FILETYPES_PASCAL, - /* GEANY_FILETYPES_S, */ GEANY_FILETYPES_ASM, /* GEANY_FILETYPES_MODULA_2, */ - GEANY_FILETYPES_ADA }; + GEANY_FILETYPES_F77, GEANY_FILETYPES_JAVA, /* GEANY_FILETYPES_OPENCL_C, */ + GEANY_FILETYPES_PASCAL, /* GEANY_FILETYPES_S, */ GEANY_FILETYPES_ASM, + /* GEANY_FILETYPES_MODULA_2, */ GEANY_FILETYPES_ADA, }; guint i; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 91dad4: scope - various changes, v0.91
by Dimitar Zhekov
05 Jul '13
05 Jul '13
Branch: refs/heads/master Author: Dimitar Zhekov <dimitar.zhekov(a)gmail.com> Committer: Dimitar Zhekov <dimitar.zhekov(a)gmail.com> Date: Fri, 05 Jul 2013 16:06:18 UTC Commit: 91dad4fa2c5d8dc0bbda4e0dc284cf6896e9bccd
https://github.com/geany/geany-plugins/commit/91dad4fa2c5d8dc0bbda4e0dc284c…
Log Message: ----------- scope - various changes, v0.91 Modified Paths: -------------- scope/ChangeLog scope/NEWS scope/NOTES scope/TODO scope/docs/codes.html scope/docs/scope.html scope/src/debug.c scope/src/debug.h scope/src/inspect.c scope/src/inspect.h scope/src/memory.c scope/src/parse.c scope/src/register.c scope/src/scope.c scope/src/tooltip.c scope/src/views.c scope/src/views.h scope/src/watch.c Modified: scope/ChangeLog 34 files changed, 34 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,37 @@ +2013-07-05 Dimitar Zhekov <dimitar.zhekov(a)gmail.com> + + * src/codes.html: + Documented the new Inspect commands. + * src/scope.html: + Explained the unified Watches/Memory/Inspect update policy. + * src/debug.c, src/debug.h, src/inspect.c, src/memory.c, + src/views.c, src/watch.c: + Unified the Watches/Memory/Inspect update policy. + * src/inspect.c, src/parse.c: + Added full Refresh instead of -var-update. + Fixed "new_numchild" -> "new_num_children". + Full update on an external changelist with >=1 elements. + Better support for float frame Inspect variables. + Support for out-of-scope assignments ignored by changelist. + * src/register.c: + Full update only if an external changed-registers contains at + least one element. + Disallow Format if no threads. + * docs/scope.html, src/scope.c: + Increased version to 0.91. + * TODO: + Inlined into scope.html. + + +2013-07-02 Dimitar Zhekov <dimitar.zhekov(a)gmail.com> + + * src/views.c: + 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. + + 2013-06-24 Dimitar Zhekov <dimitar.zhekov(a)gmail.com> * data/scope.glade, docs/codes.html, docs/scope.html, Modified: scope/NEWS 9 files changed, 8 insertions(+), 1 deletions(-) =================================================================== @@ -1,4 +1,11 @@ -Scope 0.90 (2013-05-17) +Scope 0.91 (2013-07-05) + + * Better support for float frame Inspect variables. + + * Unified and documented the Watch/Memory/Inspect update policy. + + +Scope 0.90 (2013-06-24) * Added Registers next to Inspect. Modified: scope/NOTES 13 files changed, 5 insertions(+), 8 deletions(-) =================================================================== @@ -1,12 +1,9 @@ -register modified is 07 since we may have watches and inspects containing -registers, and changing a register ($dh, $mm1.uint64) may change another -($dx, $st1); even if local variables can't be changed, that's enough +register modified is 07 since changing a register ($dh, $mm1.uint64) may +change another ($dx, $st1), and there is some chance of watches/inspects +containing a register -when switching to stack...memory and update is not possible, the subpage -contents will be kept if an update command for this page was sent on the -last thread stop/changed; otherwise it'll be cleared - -"^done,value=\"", '7' matches 07-var-assign, handled later as "^done", '7' +07<scid>-var-assign is required, because assigning to an out of scope +(sub)variable may succeed(?), but not be reflected on -var-update * the only way to fix unnecessary inspect drop target expansion is to block INTO, so deriving GtkTreeStore and altering GtkTreeDragDest makes no sense Modified: scope/TODO 14 files changed, 0 insertions(+), 14 deletions(-) =================================================================== @@ -1,14 +0,0 @@ -proper support for @ inspect frame - -various tests, source code checks etc. - -add clear icon to entries? not very useful - -test inspect new_numchild and in_scope changes - (but with C, these do not seem to change) - -don't remove [index] along with member names? - -Format (natural, decimal...) for Watches? - -libtool support / exec wrapper support Modified: scope/docs/codes.html 12 files changed, 10 insertions(+), 2 deletions(-) =================================================================== @@ -105,7 +105,11 @@ <tr><td class="nowrap">02<f><fid>-data-list-register-values</td> <td class="tab">change register <em>Format</em></td> - <td class="tab">update register value and/or format</td> + <td class="tab">update register value and/or format</td></tr> + +<tr><td class="nowrap">02<scid>-var-evaluate-expression</td> + <td class="tab"><em>Refresh</em> inspects</td> + <td class="tab">update register value</td></tr> <tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr> @@ -163,6 +167,10 @@ <td class="tab">views idle update, see above</td> <td class="tab">same as 02</td> +<tr><td class="nowrap">04<scid>-var-evaluate-expression</td> + <td class="tab">views idle update</td> + <td class="tab">same as 02</td></tr> + <tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr> <tr><td class="nowrap">05</td> @@ -222,7 +230,7 @@ <td class="tab">mark data views as dirty</td></tr> <tr><td class="nowrap">070<scid>-var-delete</td> - <td class="tab">un-<em>Apply</em> inspect</td> + <td class="tab">un-<em>Apply</em> inspect, invalid variable</td> <td class="tab">delete all children, clear columns</td></tr> <tr><td class="nowrap">071<scid>-var-delete</td> Modified: scope/docs/scope.html 30 files changed, 23 insertions(+), 7 deletions(-) =================================================================== @@ -60,6 +60,7 @@ <li><a href="#notes">Notes</a><ul> <li><a href="#editing_values">Editing values</a></li> <li><a href="#keeping_modes">Keeping modes</a></li> + <li><a href="#shared_memory">Shared memory</a></li> <li><a href="#xos4_colors">Sample dark colors</a></li> </ul></li> <li><a href="#pre_faq">Pre-FAQ</a> @@ -440,9 +441,6 @@ <p>A maximum of 16K may be displayed (128 lines * 128 bytes); <em>gdb_buffer_length</em> also limits the size.</p> -<p><em>Memory</em> empty but <em>Clear</em> available means that the subpage can not be -updated ATM; if you explicitly <em>Clear</em> it, no further updates will take place.</p> - <p><b><a name="console">Debug Console</a></b></p> <div><table> @@ -621,11 +619,25 @@ <p><b><a name="keeping_modes">Keeping modes</a></b></p> <p>The 7-bit, .names etc. modes for temporary objects, such as local variables, are not saved. -However, there is a global list with names and modes, and when you change a mode, it's saved +However, there is a global list with names and modes, and when you change a mode, it is saved in that list. Then, when a temporary object is created, Scope searches the list, and sets the modes (if any) for that object. For inspect children, the displayed names are used (including numbers for array elements), not the fully qualified names.</p> +<p><b><a name="shared_memory">Shared memory</a></b></p> + +<div>Scope does not know which Inspect/Watch expressions are thread and frame dependent, as +well as whether the Memory address and range are process/thread dependent, so their handling +is a compromise.<br> +In particular:</div> +<div class="tab"> +- the values will not be updated if threads exist, but none is selected, or if the selected +thread is running<br> +- for <em>Watches</em> and <em>Inspect</em>, Scope will try to select a frame before +sending the update command(s)<br> +- on a thread or frame change, if the values can not be updated at the moment, they will not +be cleared.</div> + <p><b><a name="xos4_colors">Sample dark colors</a></b></p> <pre> @@ -670,7 +682,7 @@ <p>A. They must be removed before sending the value to GDB. Leaving them while editing gives the false impression that you can assign selectively, while in fact omitting a "foo = -value, " <em>moves</em> all values left by 1, and changing a name or index has +value," <em>moves</em> all values left by 1, and changing a name or index has <em>no</em> effect.</p> <p>Q. A "signal `project-before-save' is invalid" warning is displayed on Geany startup, and @@ -693,7 +705,11 @@ <h3><a name="todo">TODO</a></h3> -<p>See TODO.</p> +<p>Various tests, source code checks etc.<br> +Format (natural, decimal...) for Watches?<br> +Add clear icon to entries? not very useful.<br> +Don't remove [index] along with member names?<br> +libtool support / exec wrapper support.</p> <h3><a name="not_todo">Not TODO</a></h3> @@ -722,7 +738,7 @@ <b><a name="copyright">Copyright</a></b> -<p>Scope 0.90, Copyright (C) 2013 Dimitar Toshkov Zhekov</p> +<p>Scope 0.91, 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> Modified: scope/src/debug.c 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -431,6 +431,7 @@ void on_debug_loaded(GArray *nodes) { breaks_apply(); inspects_apply(); + view_dirty(VIEW_WATCHES); if (program_temp_breakpoint) { Modified: scope/src/debug.h 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -26,6 +26,7 @@ DS_READY = 0x04, /* at prompt, has threads, none/running thread selected */ DS_DEBUG = 0x08, /* at prompt, has threads, stopped thread selected */ DS_HANGING = 0x10, /* at prompt, no threads */ + DS_VARIABLE = 0x18, DS_SENDABLE = 0x1C, DS_NOT_BUSY = 0x1D, DS_ACTIVE = 0x1E, Modified: scope/src/inspect.c 121 files changed, 94 insertions(+), 27 deletions(-) =================================================================== @@ -275,32 +275,61 @@ void on_inspect_variable(GArray *nodes) } } -void on_inspect_format(GArray *nodes) +static void inspect_set(GArray *nodes, const char *value, gint format) { - const char *s = parse_lead_value(nodes); - const char *value = parse_find_value(nodes, "value"); - gint format; - - for (format = FORMAT_NATURAL; format < FORMAT_COUNT; format++) - if (!strcmp(inspect_formats[format], s)) - break; + const char *token = parse_grab_token(nodes); + GtkTreeIter iter; - iff (format < FORMAT_COUNT, "bad format") + if (inspect_find(&iter, FALSE, token)) { - const char *token = parse_grab_token(nodes); - GtkTreeIter iter; - - if (inspect_find(&iter, FALSE, token)) + if (!value || *value) { gchar *display = inspect_redisplay(&iter, value, NULL); scp_tree_store_set(store, &iter, INSPECT_DISPLAY, display, INSPECT_VALUE, - value, INSPECT_FORMAT, format, -1); + value, -1); g_free(display); } + else + { + scp_tree_store_get(store, &iter, INSPECT_VALUE, &value, -1); + + if (value) + { + scp_tree_store_set(store, &iter, INSPECT_DISPLAY, "??", INSPECT_VALUE, + NULL); + } + } + + if (format < FORMAT_COUNT) + scp_tree_store_set(store, &iter, INSPECT_FORMAT, format, -1); } } +void on_inspect_format(GArray *nodes) +{ + const char *fmtstr = parse_lead_value(nodes); + gint format; + + for (format = FORMAT_NATURAL; format < FORMAT_COUNT; format++) + if (!strcmp(inspect_formats[format], fmtstr)) + break; + + iff (format < FORMAT_COUNT, "bad format") + inspect_set(nodes, parse_find_value(nodes, "value"), format); +} + +void on_inspect_evaluate(GArray *nodes) +{ + inspect_set(nodes, parse_lead_value(nodes), FORMAT_COUNT); +} + +void on_inspect_assign(GArray *nodes) +{ + on_inspect_evaluate(nodes); + views_data_dirty(DS_BUSY); +} + static void inspect_node_append(const ParseNode *node, GtkTreeIter *parent) { GArray *nodes = (GArray *) node->value; @@ -415,7 +444,7 @@ static void inspect_node_change(const ParseNode *node, G_GNUC_UNUSED gpointer gd ParseVariable var; GtkTreeIter iter; - if (parse_variable(nodes, &var, "new_numchild") && + if (parse_variable(nodes, &var, "new_num_children") && inspect_find(&iter, TRUE, var.name)) { const char *in_scope = parse_find_value(nodes, "in_scope"); @@ -451,9 +480,16 @@ static void inspect_node_change(const ParseNode *node, G_GNUC_UNUSED gpointer gd } } +static gboolean query_all_inspects = FALSE; + void on_inspect_changelist(GArray *nodes) { - parse_foreach(parse_lead_array(nodes), (GFunc) inspect_node_change, NULL); + GArray *changelist = parse_lead_array(nodes); + + if (parse_grab_token(nodes)) + parse_foreach(changelist, (GFunc) inspect_node_change, NULL); + else if (changelist->len) + query_all_inspects = TRUE; } static void inspect_apply(GtkTreeIter *iter) @@ -491,11 +527,37 @@ void on_inspect_signal(const char *name) void inspects_clear(void) { store_foreach(store, (GFunc) inspect_iter_clear, NULL); + query_all_inspects = FALSE; +} + +static gint inspect_iter_refresh(ScpTreeStore *store, GtkTreeIter *iter, gpointer gdata) +{ + const char *var1; + gint numchild; + + scp_tree_store_get(store, iter, INSPECT_VAR1, &var1, INSPECT_NUMCHILD, &numchild, -1); + + if (var1 && !numchild) + { + debug_send_format(F, "0%c%d-var-evaluate-expression %s", GPOINTER_TO_INT(gdata), + inspect_get_scid(iter), var1); + } + return FALSE; +} + +static void inspects_send_refresh(char token) +{ + scp_tree_store_traverse(store, TRUE, NULL, NULL, inspect_iter_refresh, NULL); + query_all_inspects = FALSE; } gboolean inspects_update(void) { - debug_send_command(N, "04-var-update 1 *"); + if (query_all_inspects) + inspects_send_refresh('4'); + else + debug_send_command(F, "04-var-update 1 *"); + return TRUE; } @@ -603,8 +665,13 @@ void inspect_add(const gchar *text) static void on_inspect_display_edited(G_GNUC_UNUSED GtkCellRendererText *renderer, gchar *path_str, gchar *new_text, G_GNUC_UNUSED gpointer gdata) { - view_display_edited(store, debug_state() & DS_SENDABLE, path_str, "07-var-assign %s %s", - new_text); + GtkTreeIter iter; + char *format; + + scp_tree_store_get_iter_from_string(store, &iter, path_str); + format = g_strdup_printf("07%d-var-assign %%s %%s", inspect_get_scid(&iter)); + view_display_edited(store, debug_state() & DS_VARIABLE, path_str, format, new_text); + g_free(format); } static const TreeCell inspect_cells[] = @@ -626,7 +693,7 @@ void inspects_update_state(DebugState state) const char *var1 = NULL; gint numchild = 0; - if (state & DS_SENDABLE) + if (state & DS_VARIABLE) { scp_tree_store_get(store, &iter, INSPECT_VAR1, &var1, INSPECT_NUMCHILD, &numchild, -1); @@ -716,7 +783,7 @@ void inspects_save(GKeyFile *config) static void on_inspect_refresh(G_GNUC_UNUSED const MenuItem *menu_item) { - debug_send_command(N, "-var-update 1 *"); + inspects_send_refresh('2'); } static void on_inspect_add(G_GNUC_UNUSED const MenuItem *menu_item) @@ -800,7 +867,7 @@ static void on_inspect_expand(G_GNUC_UNUSED const MenuItem *menu_item) INSPECT_COUNT, gtk_spin_button_get_value_as_int(expand_count), INSPECT_EXPAND, gtk_toggle_button_get_active(expand_automatic), -1); - if (debug_state() & DS_SENDABLE) + if (debug_state() & DS_VARIABLE) inspect_expand(&iter); else plugin_beep(); @@ -891,10 +958,10 @@ static void on_inspect_delete(G_GNUC_UNUSED const MenuItem *menu_item) } #define DS_EDITABLE (DS_BASICS | DS_EXTRA_2) -#define DS_APPLIABLE (DS_SENDABLE | DS_EXTRA_3) -#define DS_EXPANDABLE (DS_SENDABLE | DS_EXTRA_4) +#define DS_APPLIABLE (DS_VARIABLE | DS_EXTRA_3) +#define DS_EXPANDABLE (DS_VARIABLE | DS_EXTRA_4) #define DS_COPYABLE (DS_BASICS | DS_EXTRA_1) -#define DS_FORMATABLE (DS_NOT_BUSY | DS_EXTRA_1) +#define DS_FORMATABLE (DS_INACTIVE | DS_VARIABLE | DS_EXTRA_1) #define DS_REPARSABLE (DS_BASICS | DS_EXTRA_1) #define DS_DELETABLE (DS_NOT_BUSY | DS_EXTRA_1) @@ -904,7 +971,7 @@ static void on_inspect_delete(G_GNUC_UNUSED const MenuItem *menu_item) static MenuItem inspect_menu_items[] = { - { "inspect_refresh", on_inspect_refresh, DS_SENDABLE, NULL, NULL }, + { "inspect_refresh", on_inspect_refresh, DS_VARIABLE, 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 }, @@ -976,7 +1043,7 @@ static gboolean inspect_test_expand_row(G_GNUC_UNUSED GtkTreeView *tree_view, if (var1 || !expand) return FALSE; - if (debug_state() & DS_SENDABLE) + if (debug_state() & DS_VARIABLE) inspect_expand(iter); else plugin_blink(); Modified: scope/src/inspect.h 2 files changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -21,6 +21,8 @@ void on_inspect_variable(GArray *nodes); void on_inspect_format(GArray *nodes); +void on_inspect_evaluate(GArray *nodes); +void on_inspect_assign(GArray *nodes); void on_inspect_children(GArray *nodes); void on_inspect_ndeleted(GArray *nodes); void on_inspect_path_expr(GArray *nodes); Modified: scope/src/memory.c 12 files changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -37,7 +37,7 @@ enum static void on_memory_bytes_edited(G_GNUC_UNUSED GtkCellRendererText *renderer, gchar *path_str, gchar *new_text, G_GNUC_UNUSED gpointer gdata) { - if (*new_text && (debug_state() & DS_SENDABLE)) + if (*new_text && (debug_state() & DS_VARIABLE)) { GtkTreeIter iter; const char *addr, *bytes; @@ -335,21 +335,21 @@ static void on_memory_group_update(const MenuItem *menu_item) on_memory_refresh(menu_item); } -#define DS_FRESHABLE (DS_SENDABLE | DS_EXTRA_2) +#define DS_FRESHABLE (DS_VRIABLE | DS_EXTRA_2) #define DS_COPYABLE (DS_BASICS | DS_EXTRA_1) #define DS_CLEARABLE (DS_ACTIVE | DS_EXTRA_2) #define GROUP_ITEM(count, POWER) \ - { ("memory_group_"count), on_memory_group_update, DS_SENDABLE, NULL, \ + { ("memory_group_"count), on_memory_group_update, DS_VARIABLE, NULL, \ GINT_TO_POINTER(POWER) } static MenuItem memory_menu_items[] = { - { "memory_refresh", on_memory_refresh, DS_FRESHABLE, NULL, NULL }, - { "memory_read", on_memory_read, DS_SENDABLE, NULL, NULL }, + { "memory_refresh", on_memory_refresh, DS_VARIABLE, NULL, NULL }, + { "memory_read", on_memory_read, DS_VARIABLE, NULL, NULL }, { "memory_copy", on_memory_copy, DS_COPYABLE, NULL, NULL }, { "memory_clear", on_memory_clear, DS_CLEARABLE, NULL, NULL }, - { "memory_group", on_memory_group_display, DS_SENDABLE, NULL, NULL }, + { "memory_group", on_memory_group_display, DS_VARIABLE, NULL, NULL }, GROUP_ITEM("1", 0), GROUP_ITEM("2", 1), GROUP_ITEM("4", 2), Modified: scope/src/parse.c 3 files changed, 3 insertions(+), 0 deletions(-) =================================================================== @@ -102,8 +102,11 @@ static void on_data_modified(G_GNUC_UNUSED GArray *nodes) { "^done,stack-args=[", on_stack_arguments, '*', '\0', 1 }, { "^done,variables=[", on_local_variables, '*', '\0', 1 }, { "^done,line=\"", on_debug_list_source, '2', '\0', 2 }, + { "^done,value=\"", on_inspect_evaluate, '2', '\0', 1 }, { "^done,value=\"", on_tooltip_value, '3', '\0', 1 }, + { "^done,value=\"", on_inspect_evaluate, '4', '\0', 1 }, { "^done,value=\"", on_watch_value, '6', '\0', 1 }, + { "^done,value=\"", on_inspect_assign, '7', '\0', 1 }, { "^done,value=\"", on_menu_evaluate_value, '8', '\0', 1 }, { "^done,name=\"", on_inspect_variable, '7', '\0', 1 }, { "^done,format=\"", on_inspect_format, '7', '\0', 1 }, Modified: scope/src/register.c 21 files changed, 10 insertions(+), 11 deletions(-) =================================================================== @@ -70,6 +70,8 @@ static void register_node_update(const ParseNode *node, GString *commands[]) } } +static gboolean query_all_registers = TRUE; + static void registers_send_update(GArray *nodes, char token) { GString *commands[FORMAT_COUNT]; @@ -88,7 +90,10 @@ static void registers_send_update(GArray *nodes, char token) if (nodes) parse_foreach(nodes, (GFunc) register_node_update, commands); else + { store_foreach(store, (GFunc) register_iter_update, commands); + query_all_registers = FALSE; + } for (format = 0; format < FORMAT_COUNT; format++) { @@ -152,18 +157,17 @@ void on_register_names(GArray *nodes) registers_send_update(NULL, '2'); } -static gboolean query_all_registers = TRUE; - void on_register_changes(GArray *nodes) { const char *token = parse_grab_token(nodes); + GArray *changes = parse_lead_array(nodes); if (token) { if (utils_matches_frame(token)) - registers_send_update(parse_lead_array(nodes), '4'); + registers_send_update(changes, '4'); } - else + else if (changes->len) query_all_registers = TRUE; /* external changes */ } @@ -278,12 +282,7 @@ void on_register_values(GArray *nodes) ValueAction va = { *token - '0', utils_matches_frame(token + 1) }; if (va.format < FORMAT_COUNT || va.assign) - { parse_foreach(parse_lead_array(nodes), (GFunc) register_node_value, &va); - - if (va.assign) - query_all_registers = FALSE; - } } static void on_register_display_edited(G_GNUC_UNUSED GtkCellRendererText *renderer, @@ -315,7 +314,7 @@ void registers_clear(void) gboolean registers_update(void) { - if (g_strcmp0(frame_id, "0") && view_stack_update()) + if (view_frame_update()) return FALSE; if (frame_id) @@ -481,7 +480,7 @@ static void on_register_query(G_GNUC_UNUSED const MenuItem *menu_item) #define DS_FRESHABLE DS_DEBUG #define DS_COPYABLE (DS_BASICS | DS_EXTRA_1) -#define DS_FORMATABLE (DS_INACTIVE | DS_DEBUG | DS_HANGING | DS_EXTRA_2) +#define DS_FORMATABLE (DS_INACTIVE | DS_DEBUG | DS_EXTRA_2) #define DS_QUERABLE DS_SENDABLE #define FORMAT_ITEM(format, FORMAT) \ Modified: scope/src/scope.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -32,7 +32,7 @@ PLUGIN_VERSION_CHECK(215) PLUGIN_SET_TRANSLATABLE_INFO(LOCALEDIR, GETTEXT_PACKAGE, _("Scope Debugger"), - _("Relatively simple GDB front-end."), "0.90" , + _("Relatively simple GDB front-end."), "0.91" , "Dimitar Toshkov Zhekov <dimitar.zhekov(a)gmail.com>") /* Keybinding(s) */ Modified: scope/src/tooltip.c 6 files changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -173,11 +173,11 @@ void tooltip_remove(GeanyEditor *editor) if (gtk_widget_get_has_tooltip(widget)) { - gulong tooltip_id = g_signal_handler_find(widget, G_SIGNAL_MATCH_ID, + gulong query_tooltip_id = g_signal_handler_find(widget, G_SIGNAL_MATCH_ID, g_signal_lookup("query-tooltip", GTK_TYPE_WIDGET), 0, NULL, NULL, NULL); - if (tooltip_id) - g_signal_handler_disconnect(widget, tooltip_id); + if (query_tooltip_id) + g_signal_handler_disconnect(widget, query_tooltip_id); gtk_widget_set_has_tooltip(widget, FALSE); } } Modified: scope/src/views.c 6 files changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -47,10 +47,10 @@ { FALSE, VC_NONE, breaks_clear, breaks_update, FALSE, DS_SENDABLE }, { FALSE, VC_DATA, stack_clear, stack_update, TRUE, DS_DEBUG }, { FALSE, VC_FRAME, locals_clear, locals_update, TRUE, DS_DEBUG }, - { FALSE, VC_FRAME, watches_clear, watches_update, TRUE, DS_DEBUG }, - { FALSE, VC_DATA, memory_clear, memory_update, TRUE, DS_SENDABLE }, + { 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_DATA, inspects_clear, inspects_update, FALSE, DS_DEBUG }, + { FALSE, VC_FRAME, inspects_clear, inspects_update, FALSE, DS_VARIABLE }, { 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 } Modified: scope/src/views.h 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -42,6 +42,7 @@ void views_clear(void); void views_update(DebugState state); gboolean view_stack_update(void); +#define view_frame_update() (g_strcmp0(frame_id, "0") && view_stack_update()) void view_local_update(void); void on_view_changed(GtkNotebook *notebook, gpointer page, gint page_num, gpointer gdata); Modified: scope/src/watch.c 10 files changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -88,7 +88,7 @@ static void on_watch_expr_edited(G_GNUC_UNUSED GtkCellRendererText *renderer, static void on_watch_display_edited(G_GNUC_UNUSED GtkCellRendererText *renderer, gchar *path_str, gchar *new_text, G_GNUC_UNUSED gpointer gdata) { - view_display_edited(store, debug_state() & DS_SENDABLE, path_str, "07-gdb-set var %s=%s", + view_display_edited(store, debug_state() & DS_VARIABLE, path_str, "07-gdb-set var %s=%s", new_text); } @@ -144,7 +144,7 @@ void watches_clear(void) gboolean watches_update(void) { - if (g_strcmp0(frame_id, "0") && view_stack_update()) + if (view_frame_update()) return FALSE; store_foreach(store, (GFunc) watch_iter_update, GPOINTER_TO_INT(FALSE)); @@ -177,7 +177,7 @@ void watch_add(const gchar *text) void watches_update_state(DebugState state) { - g_object_set(watch_display, "editable", (state & DS_SENDABLE) != 0, NULL); + g_object_set(watch_display, "editable", (state & DS_VARIABLE) != 0, NULL); } void watches_delete_all(void) @@ -294,14 +294,14 @@ static void on_watch_delete(G_GNUC_UNUSED const MenuItem *menu_item) } #define DS_COPYABLE (DS_BASICS | DS_EXTRA_1) -#define DS_MODIFYABLE (DS_SENDABLE | DS_EXTRA_1) +#define DS_MODIFYABLE (DS_VARIABLE | DS_EXTRA_1) #define DS_INSPECTABLE (DS_NOT_BUSY | DS_EXTRA_1) #define DS_REPARSABLE (DS_BASICS | DS_EXTRA_1) #define DS_DELETABLE (DS_BASICS | DS_EXTRA_1) static MenuItem watch_menu_items[] = { - { "watch_refresh", on_watch_refresh, DS_SENDABLE, NULL, NULL }, + { "watch_refresh", on_watch_refresh, DS_VARIABLE, NULL, NULL }, { "watch_unsorted", on_watch_unsorted, 0, NULL, NULL }, { "watch_add", on_watch_add, 0, NULL, NULL }, { "watch_copy", on_watch_copy, DS_COPYABLE, NULL, NULL }, -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] a486ec: scope - fixed shutdown sequence and register refresh bugs
by Dimitar Zhekov
02 Jul '13
02 Jul '13
Branch: refs/heads/master Author: Dimitar Zhekov <dimitar.zhekov(a)gmail.com> Committer: Dimitar Zhekov <dimitar.zhekov(a)gmail.com> Date: Tue, 02 Jul 2013 15:11:28 UTC Commit: a486ecf212a2e02197deca4b0f7b04ddbd76338f
https://github.com/geany/geany-plugins/commit/a486ecf212a2e02197deca4b0f7b0…
Log Message: ----------- scope - fixed shutdown sequence and register refresh bugs Modified Paths: -------------- scope/src/views.c Modified: scope/src/views.c 18 files changed, 10 insertions(+), 8 deletions(-) =================================================================== @@ -82,9 +82,8 @@ static void view_update(ViewIndex index, DebugState state) static GtkWidget *inspect_page; static GtkWidget *register_page; -static void views_sidebar_update(DebugState state) +static void views_sidebar_update(gint page_num, DebugState state) { - gint page_num = gtk_notebook_get_current_page(geany_sidebar); GtkWidget *page = gtk_notebook_get_nth_page(geany_sidebar, page_num); if (page == inspect_page) @@ -111,7 +110,7 @@ void views_context_dirty(DebugState state, gboolean frame_only) if (option_update_all_views) views_update(state); else - views_sidebar_update(state); + views_sidebar_update(gtk_notebook_get_current_page(geany_sidebar), state); } } @@ -169,7 +168,7 @@ void views_update(DebugState state) view_update(view_current, state); view_update(VIEW_TOOLTIP, state); - views_sidebar_update(state); + views_sidebar_update(gtk_notebook_get_current_page(geany_sidebar), state); } } @@ -597,11 +596,13 @@ void views_update_state(DebugState state) } static void on_geany_sidebar_switch_page(G_GNUC_UNUSED GtkNotebook *notebook, - G_GNUC_UNUSED gpointer page, G_GNUC_UNUSED gint page_num, G_GNUC_UNUSED gpointer gdata) + G_GNUC_UNUSED gpointer page, gint page_num, G_GNUC_UNUSED gpointer gdata) { - views_sidebar_update(debug_state()); + views_sidebar_update(page_num, debug_state()); } +static gulong switch_sidebar_page_id; + void views_init(void) { command_dialog = dialog_connect("command_dialog"); @@ -632,8 +633,8 @@ void views_init(void) utils_enter_to_clicked(command_view, command_send); geany_sidebar = GTK_NOTEBOOK(geany->main_widgets->sidebar_notebook); - g_signal_connect(geany_sidebar, "switch-page", G_CALLBACK(on_geany_sidebar_switch_page), - NULL); + switch_sidebar_page_id = g_signal_connect(geany_sidebar, "switch-page", + G_CALLBACK(on_geany_sidebar_switch_page), NULL); inspect_page = get_widget("inspect_page"); gtk_notebook_append_page(geany_sidebar, inspect_page, get_widget("inspect_label")); register_page = get_widget("register_page"); @@ -642,6 +643,7 @@ void views_init(void) void views_finalize(void) { + g_signal_handler_disconnect(geany_sidebar, switch_sidebar_page_id); gtk_widget_destroy(GTK_WIDGET(command_dialog)); gtk_widget_destroy(inspect_page); gtk_widget_destroy(register_page); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
Results per page:
10
25
50
100
200