aboutsummaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-01-15 19:50:05 +0000
committerDaniel Jacobowitz <drow@false.org>2006-01-15 19:50:05 +0000
commit777ea8f14f3be7147da90d067f72f925ea4f282f (patch)
tree150570bc1336a3ea4e42dea5a66910d93144f7fa /gdb/printcmd.c
parent4b17b3897bf45ea21ed2de1743c063765e9dcf2f (diff)
downloadfsf-binutils-gdb-777ea8f14f3be7147da90d067f72f925ea4f282f.zip
fsf-binutils-gdb-777ea8f14f3be7147da90d067f72f925ea4f282f.tar.gz
fsf-binutils-gdb-777ea8f14f3be7147da90d067f72f925ea4f282f.tar.bz2
* printcmd.c (output_command): Always initialize fmt.size.
(printf_command): Use gdb_byte. * symfile.c (separate_debug_file_exists): Use gdb_byte. (load_section_callback, read_target_long_array): Likewise. (simple_read_overlay_table, simple_read_overlay_region_table) (simple_overlay_update_1): Correct calls to read_target_long_array. * valprint.c (partial_memory_read): Change MYADDR to a gdb_byte *. Also change local pointers. (val_print_string): Use gdb_byte.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index c57ac28..b6f3a7d 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1,7 +1,7 @@
/* Print values for GNU debugger GDB.
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GDB.
@@ -967,6 +967,8 @@ output_command (char *exp, int from_tty)
struct value *val;
struct format_data fmt;
+ fmt.size = 0;
+
if (exp && *exp == '/')
{
exp++;
@@ -1938,7 +1940,7 @@ printf_command (char *arg, int from_tty)
{
case string_arg:
{
- char *str;
+ gdb_byte *str;
CORE_ADDR tem;
int j;
tem = value_as_address (val_args[i]);
@@ -1946,7 +1948,7 @@ printf_command (char *arg, int from_tty)
/* This is a %s argument. Find the length of the string. */
for (j = 0;; j++)
{
- char c;
+ gdb_byte c;
QUIT;
read_memory (tem + j, &c, 1);
if (c == 0)
@@ -1954,12 +1956,12 @@ printf_command (char *arg, int from_tty)
}
/* Copy the string contents into a string inside GDB. */
- str = (char *) alloca (j + 1);
+ str = (gdb_byte *) alloca (j + 1);
if (j != 0)
read_memory (tem, str, j);
str[j] = 0;
- printf_filtered (current_substring, str);
+ printf_filtered (current_substring, (char *) str);
}
break;
case double_arg: