From ce27fb254cf9f800fb7f1a953eb8fa47522b9788 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sat, 29 Jan 2005 00:11:12 +0000 Subject: [PATCH] 2005-01-28 Andrew Cagney * language.h (struct language_defn): Make la_printstr's buffer parameter a const bfd_byte. * p-lang.h (pascal_printstr): Update function to match. * ada-valprint.c (ada_printstr): Update function to match. * scm-lang.c (scm_printstr): Update function to match. * p-lang.c (pascal_printstr): Update function to match. * ada-lang.h (ada_printstr): Update function to match. * m2-lang.c (m2_printstr): Update function to match. * objc-lang.c (objc_printstr): Update function to match. * c-lang.h (c_printstr): Update function to match. * f-lang.c (f_printstr): Update function to match. * c-lang.c (c_printstr): Update function to match. * language.c (unk_lang_printstr): Update function to match. --- gdb/ChangeLog | 14 ++++++++++++++ gdb/ada-lang.h | 3 ++- gdb/ada-valprint.c | 4 ++-- gdb/c-lang.c | 9 +++++---- gdb/c-lang.h | 2 +- gdb/f-lang.c | 13 ++++++------- gdb/language.c | 10 +++------- gdb/language.h | 2 +- gdb/m2-lang.c | 12 +++++------- gdb/objc-lang.c | 4 ++-- gdb/p-lang.c | 8 +++++--- gdb/p-lang.h | 3 ++- gdb/scm-lang.c | 11 ++++------- 13 files changed, 52 insertions(+), 43 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e42cac89a48..8681d9444a6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,19 @@ 2005-01-28 Andrew Cagney + * language.h (struct language_defn): Make la_printstr's buffer + parameter a const bfd_byte. + * p-lang.h (pascal_printstr): Update function to match. + * ada-valprint.c (ada_printstr): Update function to match. + * scm-lang.c (scm_printstr): Update function to match. + * p-lang.c (pascal_printstr): Update function to match. + * ada-lang.h (ada_printstr): Update function to match. + * m2-lang.c (m2_printstr): Update function to match. + * objc-lang.c (objc_printstr): Update function to match. + * c-lang.h (c_printstr): Update function to match. + * f-lang.c (f_printstr): Update function to match. + * c-lang.c (c_printstr): Update function to match. + * language.c (unk_lang_printstr): Update function to match. + * valprint.c (val_print_type_code_int): Make buffer a const bfd_byte. * valprint.h (val_print_type_code_int): Ditto. diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index 7db9452960c..57816cbb6ab 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -204,7 +204,8 @@ extern void ada_emit_char (int, struct ui_file *, int, int); extern void ada_printchar (int, struct ui_file *); -extern void ada_printstr (struct ui_file *, char *, unsigned int, int, int); +extern void ada_printstr (struct ui_file *, const bfd_byte *, + unsigned int, int, int); extern void ada_convert_actuals (struct value *, int, struct value **, CORE_ADDR *); diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 0f2f81660c4..040a6261a5c 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -528,8 +528,8 @@ printstr (struct ui_file *stream, const bfd_byte *string, } void -ada_printstr (struct ui_file *stream, char *string, unsigned int length, - int width, int force_ellipses) +ada_printstr (struct ui_file *stream, const bfd_byte *string, + unsigned int length, int width, int force_ellipses) { printstr (stream, string, length, force_ellipses, width); } diff --git a/gdb/c-lang.c b/gdb/c-lang.c index c7eb918ed1a..fa53927b9a9 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -1,6 +1,7 @@ /* C language support routines for GDB, the GNU debugger. - Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. + + Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GDB. @@ -85,8 +86,8 @@ c_printchar (int c, struct ui_file *stream) printing LENGTH characters, or if FORCE_ELLIPSES. */ void -c_printstr (struct ui_file *stream, char *string, unsigned int length, - int width, int force_ellipses) +c_printstr (struct ui_file *stream, const bfd_byte *string, + unsigned int length, int width, int force_ellipses) { unsigned int i; unsigned int things_printed = 0; diff --git a/gdb/c-lang.h b/gdb/c-lang.h index 0a0267e743b..1ecee2cbdd1 100644 --- a/gdb/c-lang.h +++ b/gdb/c-lang.h @@ -50,7 +50,7 @@ extern int c_value_print (struct value *, struct ui_file *, int, extern void c_printchar (int, struct ui_file *); -extern void c_printstr (struct ui_file * stream, char *string, +extern void c_printstr (struct ui_file * stream, const bfd_byte *string, unsigned int length, int width, int force_ellipses); diff --git a/gdb/f-lang.c b/gdb/f-lang.c index e058dd4aa43..811ac5493ec 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -1,6 +1,8 @@ /* Fortran language support routines for GDB, the GNU debugger. - Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + + Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, + 2003, 2004, 2005 Free Software Foundation, Inc. + Contributed by Motorola. Adapted from the C parser by Farooq Butt (fmbutt@engage.sps.mot.com). @@ -87,9 +89,6 @@ static void patch_common_entries (SAVED_F77_COMMON_PTR, CORE_ADDR, int); #endif static struct type *f_create_fundamental_type (struct objfile *, int); -static void f_printstr (struct ui_file * stream, char *string, - unsigned int length, int width, - int force_ellipses); static void f_printchar (int c, struct ui_file * stream); static void f_emit_char (int c, struct ui_file * stream, int quoter); @@ -161,8 +160,8 @@ f_printchar (int c, struct ui_file *stream) be replaced with a true F77 version. */ static void -f_printstr (struct ui_file *stream, char *string, unsigned int length, - int width, int force_ellipses) +f_printstr (struct ui_file *stream, const bfd_byte *string, + unsigned int length, int width, int force_ellipses) { unsigned int i; unsigned int things_printed = 0; diff --git a/gdb/language.c b/gdb/language.c index cdf35ea6bb6..ba7b80cb4b7 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -1,7 +1,7 @@ /* Multiple source language support for GDB. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by the Department of Computer Science at the State University of New York at Buffalo. @@ -86,10 +86,6 @@ static void unk_lang_emit_char (int c, struct ui_file *stream, int quoter); static void unk_lang_printchar (int c, struct ui_file *stream); -static void unk_lang_printstr (struct ui_file * stream, char *string, - unsigned int length, int width, - int force_ellipses); - static struct type *unk_lang_create_fundamental_type (struct objfile *, int); static void unk_lang_print_type (struct type *, char *, struct ui_file *, @@ -1098,8 +1094,8 @@ unk_lang_printchar (int c, struct ui_file *stream) } static void -unk_lang_printstr (struct ui_file *stream, char *string, unsigned int length, - int width, int force_ellipses) +unk_lang_printstr (struct ui_file *stream, const bfd_byte *string, + unsigned int length, int width, int force_ellipses) { error ("internal error - unimplemented function unk_lang_printstr called."); } diff --git a/gdb/language.h b/gdb/language.h index 1a54f05f29e..e9698b71391 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -193,7 +193,7 @@ struct language_defn void (*la_printchar) (int ch, struct ui_file * stream); - void (*la_printstr) (struct ui_file * stream, char *string, + void (*la_printstr) (struct ui_file * stream, const bfd_byte *string, unsigned int length, int width, int force_ellipses); diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index fbb1fa30614..fdad7b47d61 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -1,6 +1,7 @@ /* Modula 2 language support routines for GDB, the GNU debugger. - Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. + + Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GDB. @@ -31,9 +32,6 @@ extern void _initialize_m2_language (void); static struct type *m2_create_fundamental_type (struct objfile *, int); -static void m2_printstr (struct ui_file * stream, char *string, - unsigned int length, int width, - int force_ellipses); static void m2_printchar (int, struct ui_file *); static void m2_emit_char (int, struct ui_file *, int); @@ -109,8 +107,8 @@ m2_printchar (int c, struct ui_file *stream) be replaced with a true Modula version. */ static void -m2_printstr (struct ui_file *stream, char *string, unsigned int length, - int width, int force_ellipses) +m2_printstr (struct ui_file *stream, const bfd_byte *string, + unsigned int length, int width, int force_ellipses) { unsigned int i; unsigned int things_printed = 0; diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index f0d3b784a43..8ddffa81908 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -1,6 +1,6 @@ /* Objective-C language support routines for GDB, the GNU debugger. - Copyright 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Apple Computer, Inc. Written by Michael Snyder. @@ -335,7 +335,7 @@ objc_printchar (int c, struct ui_file *stream) FORCE_ELLIPSES. */ static void -objc_printstr (struct ui_file *stream, char *string, +objc_printstr (struct ui_file *stream, const bfd_byte *string, unsigned int length, int width, int force_ellipses) { unsigned int i; diff --git a/gdb/p-lang.c b/gdb/p-lang.c index f7c49df7d77..8c0b6e5ac1b 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -1,5 +1,7 @@ /* Pascal language support routines for GDB, the GNU debugger. - Copyright 2000, 2002, 2003, 2004 Free Software Foundation, Inc. + + Copyright 2000, 2002, 2003, 2004, 2005 Free Software Foundation, + Inc. This file is part of GDB. @@ -155,8 +157,8 @@ pascal_printchar (int c, struct ui_file *stream) had to stop before printing LENGTH characters, or if FORCE_ELLIPSES. */ void -pascal_printstr (struct ui_file *stream, char *string, unsigned int length, - int width, int force_ellipses) +pascal_printstr (struct ui_file *stream, const bfd_byte *string, + unsigned int length, int width, int force_ellipses) { unsigned int i; unsigned int things_printed = 0; diff --git a/gdb/p-lang.h b/gdb/p-lang.h index 39eb0435f09..0f1ef81c07e 100644 --- a/gdb/p-lang.h +++ b/gdb/p-lang.h @@ -43,7 +43,8 @@ extern int extern void pascal_printchar (int, struct ui_file *); -extern void pascal_printstr (struct ui_file *, char *, unsigned int, int, int); +extern void pascal_printstr (struct ui_file *, const bfd_byte *, + unsigned int, int, int); extern struct type *pascal_create_fundamental_type (struct objfile *, int); diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c index 21f39ec9c89..71f2d2dab24 100644 --- a/gdb/scm-lang.c +++ b/gdb/scm-lang.c @@ -1,7 +1,7 @@ /* Scheme/Guile language support routines for GDB, the GNU debugger. - Copyright 1995, 1996, 1998, 2000, 2001, 2002, 2003, 2004 Free Software - Foundation, Inc. + Copyright 1995, 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 Free + Software Foundation, Inc. This file is part of GDB. @@ -40,9 +40,6 @@ static struct value *evaluate_subexp_scm (struct type *, struct expression *, int *, enum noside); static struct value *scm_lookup_name (char *); static int in_eval_c (void); -static void scm_printstr (struct ui_file * stream, char *string, - unsigned int length, int width, - int force_ellipses); struct type *builtin_type_scm; @@ -53,8 +50,8 @@ scm_printchar (int c, struct ui_file *stream) } static void -scm_printstr (struct ui_file *stream, char *string, unsigned int length, - int width, int force_ellipses) +scm_printstr (struct ui_file *stream, const bfd_byte *string, + unsigned int length, int width, int force_ellipses) { fprintf_filtered (stream, "\"%s\"", string); } -- 2.30.2