mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-16 12:24:19 +08:00
* 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.
This commit is contained in:
@ -1,3 +1,15 @@
|
|||||||
|
2006-01-15 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2006-01-15 Mark Kettenis <kettenis@gnu.org>
|
2006-01-15 Mark Kettenis <kettenis@gnu.org>
|
||||||
|
|
||||||
* alphafbsd-tdep.c: Include "solib-svr4.h".
|
* alphafbsd-tdep.c: Include "solib-svr4.h".
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* Print values for GNU debugger GDB.
|
/* Print values for GNU debugger GDB.
|
||||||
|
|
||||||
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
|
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.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
@ -967,6 +967,8 @@ output_command (char *exp, int from_tty)
|
|||||||
struct value *val;
|
struct value *val;
|
||||||
struct format_data fmt;
|
struct format_data fmt;
|
||||||
|
|
||||||
|
fmt.size = 0;
|
||||||
|
|
||||||
if (exp && *exp == '/')
|
if (exp && *exp == '/')
|
||||||
{
|
{
|
||||||
exp++;
|
exp++;
|
||||||
@ -1938,7 +1940,7 @@ printf_command (char *arg, int from_tty)
|
|||||||
{
|
{
|
||||||
case string_arg:
|
case string_arg:
|
||||||
{
|
{
|
||||||
char *str;
|
gdb_byte *str;
|
||||||
CORE_ADDR tem;
|
CORE_ADDR tem;
|
||||||
int j;
|
int j;
|
||||||
tem = value_as_address (val_args[i]);
|
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. */
|
/* This is a %s argument. Find the length of the string. */
|
||||||
for (j = 0;; j++)
|
for (j = 0;; j++)
|
||||||
{
|
{
|
||||||
char c;
|
gdb_byte c;
|
||||||
QUIT;
|
QUIT;
|
||||||
read_memory (tem + j, &c, 1);
|
read_memory (tem + j, &c, 1);
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
@ -1954,12 +1956,12 @@ printf_command (char *arg, int from_tty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Copy the string contents into a string inside GDB. */
|
/* Copy the string contents into a string inside GDB. */
|
||||||
str = (char *) alloca (j + 1);
|
str = (gdb_byte *) alloca (j + 1);
|
||||||
if (j != 0)
|
if (j != 0)
|
||||||
read_memory (tem, str, j);
|
read_memory (tem, str, j);
|
||||||
str[j] = 0;
|
str[j] = 0;
|
||||||
|
|
||||||
printf_filtered (current_substring, str);
|
printf_filtered (current_substring, (char *) str);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case double_arg:
|
case double_arg:
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
/* Generic symbol file reading for the GNU debugger, GDB.
|
/* Generic symbol file reading for the GNU debugger, GDB.
|
||||||
|
|
||||||
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||||
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Cygnus Support, using pieces from other GDB modules.
|
Contributed by Cygnus Support, using pieces from other GDB modules.
|
||||||
|
|
||||||
@ -1141,7 +1142,7 @@ separate_debug_file_exists (const char *name, unsigned long crc)
|
|||||||
{
|
{
|
||||||
unsigned long file_crc = 0;
|
unsigned long file_crc = 0;
|
||||||
int fd;
|
int fd;
|
||||||
char buffer[8*1024];
|
gdb_byte buffer[8*1024];
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
fd = open (name, O_RDONLY | O_BINARY);
|
fd = open (name, O_RDONLY | O_BINARY);
|
||||||
@ -1523,7 +1524,7 @@ load_section_callback (bfd *abfd, asection *asec, void *data)
|
|||||||
bfd_size_type size = bfd_get_section_size (asec);
|
bfd_size_type size = bfd_get_section_size (asec);
|
||||||
if (size > 0)
|
if (size > 0)
|
||||||
{
|
{
|
||||||
char *buffer;
|
gdb_byte *buffer;
|
||||||
struct cleanup *old_chain;
|
struct cleanup *old_chain;
|
||||||
CORE_ADDR lma = bfd_section_lma (abfd, asec) + args->load_offset;
|
CORE_ADDR lma = bfd_section_lma (abfd, asec) + args->load_offset;
|
||||||
bfd_size_type block_size;
|
bfd_size_type block_size;
|
||||||
@ -1568,7 +1569,7 @@ load_section_callback (bfd *abfd, asection *asec, void *data)
|
|||||||
method to the target vector and then use
|
method to the target vector and then use
|
||||||
that. remote.c could implement that method
|
that. remote.c could implement that method
|
||||||
using the ``qCRC'' packet. */
|
using the ``qCRC'' packet. */
|
||||||
char *check = xmalloc (len);
|
gdb_byte *check = xmalloc (len);
|
||||||
struct cleanup *verify_cleanups =
|
struct cleanup *verify_cleanups =
|
||||||
make_cleanup (xfree, check);
|
make_cleanup (xfree, check);
|
||||||
|
|
||||||
@ -3475,7 +3476,7 @@ static void
|
|||||||
read_target_long_array (CORE_ADDR memaddr, unsigned int *myaddr, int len)
|
read_target_long_array (CORE_ADDR memaddr, unsigned int *myaddr, int len)
|
||||||
{
|
{
|
||||||
/* FIXME (alloca): Not safe if array is very large. */
|
/* FIXME (alloca): Not safe if array is very large. */
|
||||||
char *buf = alloca (len * TARGET_LONG_BYTES);
|
gdb_byte *buf = alloca (len * TARGET_LONG_BYTES);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
read_memory (memaddr, buf, len * TARGET_LONG_BYTES);
|
read_memory (memaddr, buf, len * TARGET_LONG_BYTES);
|
||||||
@ -3515,7 +3516,7 @@ simple_read_overlay_table (void)
|
|||||||
= (void *) xmalloc (cache_novlys * sizeof (*cache_ovly_table));
|
= (void *) xmalloc (cache_novlys * sizeof (*cache_ovly_table));
|
||||||
cache_ovly_table_base = SYMBOL_VALUE_ADDRESS (ovly_table_msym);
|
cache_ovly_table_base = SYMBOL_VALUE_ADDRESS (ovly_table_msym);
|
||||||
read_target_long_array (cache_ovly_table_base,
|
read_target_long_array (cache_ovly_table_base,
|
||||||
(int *) cache_ovly_table,
|
(unsigned int *) cache_ovly_table,
|
||||||
cache_novlys * 4);
|
cache_novlys * 4);
|
||||||
|
|
||||||
return 1; /* SUCCESS */
|
return 1; /* SUCCESS */
|
||||||
@ -3543,7 +3544,7 @@ simple_read_overlay_region_table (void)
|
|||||||
{
|
{
|
||||||
cache_ovly_region_table_base = SYMBOL_VALUE_ADDRESS (msym);
|
cache_ovly_region_table_base = SYMBOL_VALUE_ADDRESS (msym);
|
||||||
read_target_long_array (cache_ovly_region_table_base,
|
read_target_long_array (cache_ovly_region_table_base,
|
||||||
(int *) cache_ovly_region_table,
|
(unsigned int *) cache_ovly_region_table,
|
||||||
cache_novly_regions * 3);
|
cache_novly_regions * 3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3577,7 +3578,7 @@ simple_overlay_update_1 (struct obj_section *osect)
|
|||||||
/* && cache_ovly_table[i][SIZE] == size */ )
|
/* && cache_ovly_table[i][SIZE] == size */ )
|
||||||
{
|
{
|
||||||
read_target_long_array (cache_ovly_table_base + i * TARGET_LONG_BYTES,
|
read_target_long_array (cache_ovly_table_base + i * TARGET_LONG_BYTES,
|
||||||
(int *) cache_ovly_table[i], 4);
|
(unsigned int *) cache_ovly_table[i], 4);
|
||||||
if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
|
if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
|
||||||
&& cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
|
&& cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
|
||||||
/* && cache_ovly_table[i][SIZE] == size */ )
|
/* && cache_ovly_table[i][SIZE] == size */ )
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/* Print values for GDB, the GNU debugger.
|
/* Print values for GDB, the GNU debugger.
|
||||||
|
|
||||||
Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||||
1996, 1997, 1998, 1999, 2000, 2001, 2002, 2005 Free Software
|
1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||||
Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
|
||||||
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
/* Prototypes for local functions */
|
/* Prototypes for local functions */
|
||||||
|
|
||||||
static int partial_memory_read (CORE_ADDR memaddr, char *myaddr,
|
static int partial_memory_read (CORE_ADDR memaddr, gdb_byte *myaddr,
|
||||||
int len, int *errnoptr);
|
int len, int *errnoptr);
|
||||||
|
|
||||||
static void show_print (char *, int);
|
static void show_print (char *, int);
|
||||||
@ -1038,7 +1038,7 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
|
|||||||
function be eliminated. */
|
function be eliminated. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
partial_memory_read (CORE_ADDR memaddr, char *myaddr, int len, int *errnoptr)
|
partial_memory_read (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int *errnoptr)
|
||||||
{
|
{
|
||||||
int nread; /* Number of bytes actually read. */
|
int nread; /* Number of bytes actually read. */
|
||||||
int errcode; /* Error from last read. */
|
int errcode; /* Error from last read. */
|
||||||
@ -1086,9 +1086,9 @@ val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream)
|
|||||||
unsigned int fetchlimit; /* Maximum number of chars to print. */
|
unsigned int fetchlimit; /* Maximum number of chars to print. */
|
||||||
unsigned int nfetch; /* Chars to fetch / chars fetched. */
|
unsigned int nfetch; /* Chars to fetch / chars fetched. */
|
||||||
unsigned int chunksize; /* Size of each fetch, in chars. */
|
unsigned int chunksize; /* Size of each fetch, in chars. */
|
||||||
char *buffer = NULL; /* Dynamically growable fetch buffer. */
|
gdb_byte *buffer = NULL; /* Dynamically growable fetch buffer. */
|
||||||
char *bufptr; /* Pointer to next available byte in buffer. */
|
gdb_byte *bufptr; /* Pointer to next available byte in buffer. */
|
||||||
char *limit; /* First location past end of fetch buffer. */
|
gdb_byte *limit; /* First location past end of fetch buffer. */
|
||||||
struct cleanup *old_chain = NULL; /* Top of the old cleanup chain. */
|
struct cleanup *old_chain = NULL; /* Top of the old cleanup chain. */
|
||||||
int found_nul; /* Non-zero if we found the nul char */
|
int found_nul; /* Non-zero if we found the nul char */
|
||||||
|
|
||||||
@ -1121,7 +1121,7 @@ val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream)
|
|||||||
|
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
buffer = (char *) xmalloc (len * width);
|
buffer = (gdb_byte *) xmalloc (len * width);
|
||||||
bufptr = buffer;
|
bufptr = buffer;
|
||||||
old_chain = make_cleanup (xfree, buffer);
|
old_chain = make_cleanup (xfree, buffer);
|
||||||
|
|
||||||
@ -1139,11 +1139,11 @@ val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream)
|
|||||||
nfetch = min (chunksize, fetchlimit - bufsize);
|
nfetch = min (chunksize, fetchlimit - bufsize);
|
||||||
|
|
||||||
if (buffer == NULL)
|
if (buffer == NULL)
|
||||||
buffer = (char *) xmalloc (nfetch * width);
|
buffer = (gdb_byte *) xmalloc (nfetch * width);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
discard_cleanups (old_chain);
|
discard_cleanups (old_chain);
|
||||||
buffer = (char *) xrealloc (buffer, (nfetch + bufsize) * width);
|
buffer = (gdb_byte *) xrealloc (buffer, (nfetch + bufsize) * width);
|
||||||
}
|
}
|
||||||
|
|
||||||
old_chain = make_cleanup (xfree, buffer);
|
old_chain = make_cleanup (xfree, buffer);
|
||||||
@ -1196,13 +1196,13 @@ val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream)
|
|||||||
|
|
||||||
if (len == -1 && !found_nul)
|
if (len == -1 && !found_nul)
|
||||||
{
|
{
|
||||||
char *peekbuf;
|
gdb_byte *peekbuf;
|
||||||
|
|
||||||
/* We didn't find a null terminator we were looking for. Attempt
|
/* We didn't find a null terminator we were looking for. Attempt
|
||||||
to peek at the next character. If not successful, or it is not
|
to peek at the next character. If not successful, or it is not
|
||||||
a null byte, then force ellipsis to be printed. */
|
a null byte, then force ellipsis to be printed. */
|
||||||
|
|
||||||
peekbuf = (char *) alloca (width);
|
peekbuf = (gdb_byte *) alloca (width);
|
||||||
|
|
||||||
if (target_read_memory (addr, peekbuf, width) == 0
|
if (target_read_memory (addr, peekbuf, width) == 0
|
||||||
&& extract_unsigned_integer (peekbuf, width) != 0)
|
&& extract_unsigned_integer (peekbuf, width) != 0)
|
||||||
|
Reference in New Issue
Block a user