aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-source.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-06-28 15:19:10 -0600
committerTom Tromey <tom@tromey.com>2019-07-17 12:19:05 -0600
commitc2cd8994669f63eb415522352a5d5006d0fbfb48 (patch)
treea82d261431329dcffd107a687f7016bed4ad6a5c /gdb/tui/tui-source.c
parent4dde7b34f4e40ee6e0ea596357e4def60bd67d20 (diff)
downloadfsf-binutils-gdb-c2cd8994669f63eb415522352a5d5006d0fbfb48.zip
fsf-binutils-gdb-c2cd8994669f63eb415522352a5d5006d0fbfb48.tar.gz
fsf-binutils-gdb-c2cd8994669f63eb415522352a5d5006d0fbfb48.tar.bz2
Introduce tui_source_window_base::location_matches_p method
This introduces the location_matches_p method, removing a spot that explicitly examines a window's type. gdb/ChangeLog 2019-07-17 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_update_breakpoint_info): Use location_matches_p. * tui/tui-source.c (tui_source_window::location_matches_p): New method. * tui/tui-disasm.c (tui_disasm_window::location_matches_p): New method. * tui/tui-data.h (struct tui_source_window_base) <location_matches_p>: New method. (struct tui_source_window, struct tui_disasm_window) <location_matches_p>: Likewise.
Diffstat (limited to 'gdb/tui/tui-source.c')
-rw-r--r--gdb/tui/tui-source.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index 34cb38b..2ca21dc 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -345,3 +345,13 @@ tui_source_window::style_changed ()
if (tui_active && is_visible)
refill ();
}
+
+bool
+tui_source_window::location_matches_p (struct bp_location *loc, int line_no)
+{
+ return (content[line_no].line_or_addr.loa == LOA_LINE
+ && content[line_no].line_or_addr.u.line_no == loc->line_number
+ && loc->symtab != NULL
+ && filename_cmp (fullname,
+ symtab_to_fullname (loc->symtab)) == 0);
+}