Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: gdb/tui/tui-stack.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/tui/tui-stack.h ('k') | gdb/tui/tui-win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/tui/tui-stack.c
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index 262a6bf3143de6d8c71970e4e530945617ced2cb..c1ea7ad2b003f3b4f02835708d327785d67d15e2 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -1,6 +1,6 @@
/* TUI display locator.
- Copyright (C) 1998-2004, 2006-2012 Free Software Foundation, Inc.
+ Copyright (C) 1998-2013 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -28,7 +28,8 @@
#include "target.h"
#include "top.h"
#include "gdb-demangle.h"
-#include "gdb_string.h"
+#include <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);
@@ -94,7 +95,7 @@ tui_make_status_line (struct tui_locator_element *loc)
/* Translate line number and obtain its size. */
if (loc->line_no > 0)
- sprintf (line_buf, "%d", loc->line_no);
+ xsnprintf (line_buf, sizeof (line_buf), "%d", loc->line_no);
else
strcpy (line_buf, "??");
line_width = strlen (line_buf);
@@ -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);
« no previous file with comments | « gdb/tui/tui-stack.h ('k') | gdb/tui/tui-win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698