aboutsummaryrefslogtreecommitdiff
path: root/gdb/observable.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-11-14 16:11:15 -0700
committerTom Tromey <tom@tromey.com>2019-12-20 09:15:57 -0700
commita75cd9a2c129dfc086cbe570ef9cff9b84570bbd (patch)
tree41c25e54e16683cf7ace77fd26f6325c7f28190a /gdb/observable.h
parent2dfd3df48dc7edb551718b3944eca6b35a7058a5 (diff)
downloadbinutils-a75cd9a2c129dfc086cbe570ef9cff9b84570bbd.zip
binutils-a75cd9a2c129dfc086cbe570ef9cff9b84570bbd.tar.gz
binutils-a75cd9a2c129dfc086cbe570ef9cff9b84570bbd.tar.bz2
Add observable to watch current source symtab
This patch adds an observable, so that a later patch can change the TUI to notice when the user has selected a new source symtab, say via "list". gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * source.c (struct current_source_location) <set, symtab, line>: New methods. <m_symtab, m_line>: Rename. Now private. (get_current_source_symtab_and_line) (set_default_source_symtab_and_line) (set_current_source_symtab_and_line) (clear_current_source_symtab_and_line, select_source_symtab) (info_source_command, print_source_lines_base) (info_line_command, search_command_helper): Update. * observable.h (current_source_symtab_and_line_changed): Declare observable. * observable.c (current_source_symtab_and_line_changed): Define observable. Change-Id: I3c0f6b40f2df84b590bdf5b5ec5ccd8423bb7f22
Diffstat (limited to 'gdb/observable.h')
-rw-r--r--gdb/observable.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/observable.h b/gdb/observable.h
index 9ce0099..0c41aa3 100644
--- a/gdb/observable.h
+++ b/gdb/observable.h
@@ -241,6 +241,12 @@ extern observable<user_selected_what /* selection */>
should be reconsulted. */
extern observable<> source_styling_changed;
+/* The CLI's notion of the current source has changed. This differs
+ from user_selected_context_changed in that it is also set by the
+ "list" command. */
+
+extern observable<> current_source_symtab_and_line_changed;
+
} /* namespace observers */
} /* namespace gdb */