From 56d397a3824d826cdbaa02dba633bd86da6308c5 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sun, 3 Feb 2013 16:16:42 +0000 Subject: gdb/ * source.c (print_source_lines_base): Print for TUI also "fullname". * tui/tui-data.c (init_content_element): Change tui_locator_element field to full_name. * tui/tui-data.h (struct tui_locator_element): Likewise. * tui/tui-disasm.c (tui_show_disassem_and_update_source): Rename tui_update_locator_filename calls to tui_update_locator_fullname. Replace symtab->filename refererence by symtab_to_fullname call. * tui/tui-out.c (tui_field_string): Check for "fullname" now. * tui/tui-source.c (tui_set_source_content): Change tui_locator_element field to full_name. Replace symtab->filename refererence by symtab_to_fullname call. (tui_show_symtab_source): Rename parameter to fullname. Change tui_locator_element field to full_name. * tui/tui-stack.c: Include source.h. (tui_set_locator_filename): Rename the declaration to ... (tui_set_locator_fullname): ... here. Rename its parameter to fullname, updates its comment. (tui_set_locator_info): Rename its parameter to fullname. (tui_set_locator_filename): Rename the definition to ... (tui_set_locator_fullname): ... here. Rename its parameter to fullname, updates its comment. Change tui_locator_element field to full_name. (tui_set_locator_info): Rename its parameter to fullname. (tui_set_locator_info): Rename callee to tui_set_locator_fullname. (tui_update_locator_filename): Rename to ... (tui_update_locator_fullname): ... here. Rename callee to tui_set_locator_fullname. (tui_show_frame_info): Replace symtab->filename refererence by symtab_to_fullname call. * tui/tui-stack.h (tui_update_locator_filename): Rename to ... (tui_update_locator_fullname): ... here. * tui/tui-winsource.c (tui_display_main): Rename the callee to tui_update_locator_fullname. Replace symtab->filename refererence by symtab_to_fullname call. * tui/tui.c (tui_show_source): Rename its parameter to fullname. Rename the callee to tui_update_locator_fullname. * tui/tui.h (tui_show_source): Rename its parameter to fullname. --- gdb/tui/tui-stack.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'gdb/tui/tui-stack.c') diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index 515730f..7adf896 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -29,6 +29,7 @@ #include "top.h" #include "gdb-demangle.h" #include "gdb_string.h" +#include "source.h" #include "tui/tui.h" #include "tui/tui-data.h" #include "tui/tui-stack.h" @@ -44,12 +45,12 @@ Returns a pointer to a static area holding the result. */ static char *tui_get_function_from_frame (struct frame_info *fi); -/* Set the filename portion of the locator. */ -static void tui_set_locator_filename (const char *filename); +/* Set the full_name portion of the locator. */ +static void tui_set_locator_fullname (const char *fullname); /* Update the locator, with the provided arguments. */ static void tui_set_locator_info (struct gdbarch *gdbarch, - const char *filename, + const char *fullname, const char *procname, int lineno, CORE_ADDR addr); @@ -276,27 +277,27 @@ tui_show_locator_content (void) /* Set the filename portion of the locator. */ static void -tui_set_locator_filename (const char *filename) +tui_set_locator_fullname (const char *fullname) { struct tui_gen_win_info *locator = tui_locator_win_info_ptr (); struct tui_locator_element *element; if (locator->content[0] == NULL) { - tui_set_locator_info (NULL, filename, NULL, 0, 0); + tui_set_locator_info (NULL, fullname, NULL, 0, 0); return; } element = &((struct tui_win_element *) locator->content[0])->which_element.locator; - element->file_name[0] = 0; - strcat_to_buf (element->file_name, MAX_LOCATOR_ELEMENT_LEN, filename); + element->full_name[0] = 0; + strcat_to_buf (element->full_name, MAX_LOCATOR_ELEMENT_LEN, fullname); } /* Update the locator, with the provided arguments. */ static void tui_set_locator_info (struct gdbarch *gdbarch, - const char *filename, + const char *fullname, const char *procname, int lineno, CORE_ADDR addr) @@ -318,14 +319,14 @@ tui_set_locator_info (struct gdbarch *gdbarch, element->line_no = lineno; element->addr = addr; element->gdbarch = gdbarch; - tui_set_locator_filename (filename); + tui_set_locator_fullname (fullname); } -/* Update only the filename portion of the locator. */ +/* Update only the full_name portion of the locator. */ void -tui_update_locator_filename (const char *filename) +tui_update_locator_fullname (const char *fullname) { - tui_set_locator_filename (filename); + tui_set_locator_fullname (fullname); tui_show_locator_content (); } @@ -348,11 +349,12 @@ tui_show_frame_info (struct frame_info *fi) find_frame_sal (fi, &sal); source_already_displayed = sal.symtab != 0 - && tui_source_is_displayed (sal.symtab->filename); + && tui_source_is_displayed (symtab_to_fullname (sal.symtab)); if (get_frame_pc_if_available (fi, &pc)) tui_set_locator_info (get_frame_arch (fi), - sal.symtab == 0 ? "??" : sal.symtab->filename, + (sal.symtab == 0 + ? "??" : symtab_to_fullname (sal.symtab)), tui_get_function_from_frame (fi), sal.line, pc); -- cgit v1.1