aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2005-01-28 16:20:09 +0000
committerAndrew Cagney <cagney@redhat.com>2005-01-28 16:20:09 +0000
commit6c4039537b88d99fca574514c243156467289471 (patch)
treeff44f824bd8fd60be3cb44bc83e0f8bb3c364dc1
parentf7e323d58b6312da747af517269c9aa21c78896a (diff)
downloadgdb-6c4039537b88d99fca574514c243156467289471.zip
gdb-6c4039537b88d99fca574514c243156467289471.tar.gz
gdb-6c4039537b88d99fca574514c243156467289471.tar.bz2
2005-01-28 Andrew Cagney <cagney@gnu.org>
* valprint.h (print_octal_chars, print_char_chars) (print_hex_chars, print_decimal_chars, print_binary_chars): Make buffer a const bfd_byte. * valprint.c (print_binary_chars, print_octal_chars) (print_decimal_chars, print_hex_chars, print_char_chars): Make "valaddr"buffer a const bfd_byte, ditto for local variables referencing that buffer.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/valprint.c23
-rw-r--r--gdb/valprint.h10
3 files changed, 26 insertions, 15 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7dcac84..b3eef4a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2005-01-28 Andrew Cagney <cagney@gnu.org>
+ * valprint.h (print_octal_chars, print_char_chars)
+ (print_hex_chars, print_decimal_chars, print_binary_chars): Make
+ buffer a const bfd_byte.
+ * valprint.c (print_binary_chars, print_octal_chars)
+ (print_decimal_chars, print_hex_chars, print_char_chars): Make
+ "valaddr"buffer a const bfd_byte, ditto for local variables
+ referencing that buffer.
+
* m2-valprint.c: Include "c-lang.h".
(c_val_print): Delete extern declaration.
* scm-valprint.c: Include "c-lang.h".
diff --git a/gdb/valprint.c b/gdb/valprint.c
index fd92750..053f49f 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -344,13 +344,13 @@ print_floating (char *valaddr, struct type *type, struct ui_file *stream)
}
void
-print_binary_chars (struct ui_file *stream, unsigned char *valaddr,
+print_binary_chars (struct ui_file *stream, const bfd_byte *valaddr,
unsigned len)
{
#define BITS_IN_BYTES 8
- unsigned char *p;
+ const bfd_byte *p;
unsigned int i;
int b;
@@ -404,9 +404,10 @@ print_binary_chars (struct ui_file *stream, unsigned char *valaddr,
* Print it in octal on stream or format it in buf.
*/
void
-print_octal_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
+print_octal_chars (struct ui_file *stream, const bfd_byte *valaddr,
+ unsigned len)
{
- unsigned char *p;
+ const bfd_byte *p;
unsigned char octa1, octa2, octa3, carry;
int cycle;
@@ -551,7 +552,7 @@ print_octal_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
* Print it in decimal on stream or format it in buf.
*/
void
-print_decimal_chars (struct ui_file *stream, unsigned char *valaddr,
+print_decimal_chars (struct ui_file *stream, const bfd_byte *valaddr,
unsigned len)
{
#define TEN 10
@@ -568,7 +569,7 @@ print_decimal_chars (struct ui_file *stream, unsigned char *valaddr,
#define LOW_NIBBLE( x ) ( (x) & 0x00F)
#define HIGH_NIBBLE( x ) (((x) & 0x0F0) >> 4)
- unsigned char *p;
+ const bfd_byte *p;
unsigned char *digits;
int carry;
int decimal_len;
@@ -686,9 +687,10 @@ print_decimal_chars (struct ui_file *stream, unsigned char *valaddr,
/* VALADDR points to an integer of LEN bytes. Print it in hex on stream. */
void
-print_hex_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
+print_hex_chars (struct ui_file *stream, const bfd_byte *valaddr,
+ unsigned len)
{
- unsigned char *p;
+ const bfd_byte *p;
/* FIXME: We should be not printing leading zeroes in most cases. */
@@ -717,9 +719,10 @@ print_hex_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
Omit any leading zero chars. */
void
-print_char_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
+print_char_chars (struct ui_file *stream, const bfd_byte *valaddr,
+ unsigned len)
{
- unsigned char *p;
+ const bfd_byte *p;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
diff --git a/gdb/valprint.h b/gdb/valprint.h
index 647b4bd..ae93ff5 100644
--- a/gdb/valprint.h
+++ b/gdb/valprint.h
@@ -55,18 +55,18 @@ extern void val_print_array_elements (struct type *, char *, CORE_ADDR,
extern void val_print_type_code_int (struct type *, char *,
struct ui_file *);
-extern void print_binary_chars (struct ui_file *, unsigned char *,
+extern void print_binary_chars (struct ui_file *, const bfd_byte *,
unsigned int);
-extern void print_octal_chars (struct ui_file *, unsigned char *,
+extern void print_octal_chars (struct ui_file *, const bfd_byte *,
unsigned int);
-extern void print_decimal_chars (struct ui_file *, unsigned char *,
+extern void print_decimal_chars (struct ui_file *, const bfd_byte *,
unsigned int);
-extern void print_hex_chars (struct ui_file *, unsigned char *,
+extern void print_hex_chars (struct ui_file *, const bfd_byte *,
unsigned int);
-extern void print_char_chars (struct ui_file *, unsigned char *,
+extern void print_char_chars (struct ui_file *, const bfd_byte *,
unsigned int);
#endif