This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Another gdb_byte pass
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 27 May 2005 00:24:35 -0400
- Subject: [commit] Another gdb_byte pass
2005-05-27 Andrew Cagney <cagney@gnu.org>
* jv-lang.c (get_java_utf8_name): Add cast.
(evaluate_subexp_java): Use gdb_byte for buffers.
* jv-valprint.c (java_value_print, java_value_print): Use gdb_byte
for buffers.
* scm-lang.c (scm_get_field, scm_unpack)
(scm_evaluate_string): Use gdb_byte for buffers.
(scm_lookup_name): Add cast.
* scm-valprint.c (scm_scmval_print, scm_scmval_print): Use
gdb_byte for buffers.
* tui/tui.h (tui_get_command_dimension): Make parameters unsigned.
* tui/tui.c (tui_get_command_dimension): Make parameters unsigned.
* value.h (check_field): Change "name" to a string.
* valops.c (check_field): Change "name" to a string.
* scm-lang.h (scm_parse): Use gdb_byte for buffers.
* source.c (get_current_source_symtab_and_line)
(set_current_source_symtab_and_line): Initialize all fields of sal
structures.
* cli/cli-cmds.c (list_command): Use gdb_byte for buffers.
Index: jv-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/jv-lang.c,v
retrieving revision 1.41
diff -p -u -r1.41 jv-lang.c
--- jv-lang.c 11 Feb 2005 04:05:56 -0000 1.41
+++ jv-lang.c 27 May 2005 04:37:51 -0000
@@ -216,7 +216,7 @@ get_java_utf8_name (struct obstack *obst
+ TYPE_LENGTH (value_type (temp));
chrs = obstack_alloc (obstack, name_length + 1);
chrs[name_length] = '\0';
- read_memory (data_addr, chrs, name_length);
+ read_memory (data_addr, (gdb_byte *) chrs, name_length);
return chrs;
}
@@ -883,7 +883,7 @@ evaluate_subexp_java (struct type *expec
CORE_ADDR address;
long length, index;
struct type *el_type;
- char buf4[4];
+ gdb_byte buf4[4];
struct value *clas = java_class_from_object (arg1);
struct value *temp = clas;
Index: jv-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/jv-valprint.c,v
retrieving revision 1.25
diff -p -u -r1.25 jv-valprint.c
--- jv-valprint.c 9 May 2005 21:20:34 -0000 1.25
+++ jv-valprint.c 27 May 2005 04:37:51 -0000
@@ -72,7 +72,7 @@ java_value_print (struct value *val, str
if (TYPE_CODE (type) == TYPE_CODE_STRUCT && name != NULL
&& (i = strlen (name), name[i - 1] == ']'))
{
- char buf4[4];
+ gdb_byte buf4[4];
long length;
unsigned int things_printed = 0;
int reps;
@@ -93,7 +93,7 @@ java_value_print (struct value *val, str
while (i < length && things_printed < print_max)
{
- char *buf;
+ gdb_byte *buf;
buf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
fputs_filtered (", ", stream);
Index: scm-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/scm-lang.c,v
retrieving revision 1.31
diff -p -u -r1.31 scm-lang.c
--- scm-lang.c 9 May 2005 21:20:34 -0000 1.31
+++ scm-lang.c 27 May 2005 04:37:51 -0000
@@ -73,7 +73,7 @@ is_scmvalue_type (struct type *type)
LONGEST
scm_get_field (LONGEST svalue, int index)
{
- char buffer[20];
+ gdb_byte buffer[20];
read_memory (SCM2PTR (svalue) + index * TYPE_LENGTH (builtin_type_scm),
buffer, TYPE_LENGTH (builtin_type_scm));
return extract_signed_integer (buffer, TYPE_LENGTH (builtin_type_scm));
@@ -84,7 +84,7 @@ scm_get_field (LONGEST svalue, int index
or Boolean (CONTEXT == TYPE_CODE_BOOL). */
LONGEST
-scm_unpack (struct type *type, const char *valaddr, enum type_code context)
+scm_unpack (struct type *type, const gdb_byte *valaddr, enum type_code context)
{
if (is_scmvalue_type (type))
{
@@ -157,7 +157,7 @@ scm_lookup_name (char *str)
struct symbol *sym;
args[0] = value_allocate_space_in_inferior (len);
args[1] = value_from_longest (builtin_type_int, len);
- write_memory (value_as_long (args[0]), str, len);
+ write_memory (value_as_long (args[0]), (gdb_byte *) str, len);
if (in_eval_c ()
&& (sym = lookup_symbol ("env",
@@ -189,9 +189,9 @@ scm_evaluate_string (char *str, int len)
struct value *func;
struct value *addr = value_allocate_space_in_inferior (len + 1);
LONGEST iaddr = value_as_long (addr);
- write_memory (iaddr, str, len);
+ write_memory (iaddr, (gdb_byte *) str, len);
/* FIXME - should find and pass env */
- write_memory (iaddr + len, "", 1);
+ write_memory (iaddr + len, (gdb_byte *) "", 1);
func = find_function_in_inferior ("scm_evstr");
return call_function_by_hand (func, 1, &addr);
}
Index: scm-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/scm-lang.h,v
retrieving revision 1.7
diff -p -u -r1.7 scm-lang.h
--- scm-lang.h 9 May 2005 21:20:34 -0000 1.7
+++ scm-lang.h 27 May 2005 04:37:51 -0000
@@ -69,4 +69,4 @@ extern struct type *builtin_type_scm;
extern int scm_parse (void);
-extern LONGEST scm_unpack (struct type *, const char *, enum type_code);
+extern LONGEST scm_unpack (struct type *, const gdb_byte *, enum type_code);
Index: scm-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/scm-valprint.c,v
retrieving revision 1.11
diff -p -u -r1.11 scm-valprint.c
--- scm-valprint.c 9 May 2005 21:20:35 -0000 1.11
+++ scm-valprint.c 27 May 2005 04:37:51 -0000
@@ -220,7 +220,7 @@ taloop:
int i;
int done = 0;
int buf_size;
- char buffer[64];
+ gdb_byte buffer[64];
int truncate = print_max && len > (int) print_max;
if (truncate)
len = print_max;
@@ -248,8 +248,8 @@ taloop:
{
int len = SCM_LENGTH (svalue);
- char *str = (char *) alloca (len);
- read_memory (SCM_CDR (svalue), str, len + 1);
+ char *str = alloca (len);
+ read_memory (SCM_CDR (svalue), (gdb_byte *) str, len + 1);
/* Should handle weird characters FIXME */
str[len] = '\0';
fputs_filtered (str, stream);
Index: source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.67
diff -p -u -r1.67 source.c
--- source.c 24 Feb 2005 13:51:34 -0000 1.67
+++ source.c 27 May 2005 04:38:01 -0000
@@ -142,7 +142,7 @@ get_lines_to_list (void)
struct symtab_and_line
get_current_source_symtab_and_line (void)
{
- struct symtab_and_line cursal;
+ struct symtab_and_line cursal = { };
cursal.symtab = current_source_symtab;
cursal.line = current_source_line;
@@ -181,7 +181,7 @@ set_default_source_symtab_and_line (void
struct symtab_and_line
set_current_source_symtab_and_line (const struct symtab_and_line *sal)
{
- struct symtab_and_line cursal;
+ struct symtab_and_line cursal = { };
cursal.symtab = current_source_symtab;
cursal.line = current_source_line;
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.160
diff -p -u -r1.160 valops.c
--- valops.c 26 May 2005 20:48:59 -0000 1.160
+++ valops.c 27 May 2005 04:38:02 -0000
@@ -2269,7 +2269,7 @@ check_field_in (struct type *type, const
target structure/union is defined, otherwise, return 0. */
int
-check_field (struct value *arg1, const gdb_byte *name)
+check_field (struct value *arg1, const char *name)
{
struct type *t;
Index: value.h
===================================================================
RCS file: /cvs/src/src/gdb/value.h,v
retrieving revision 1.87
diff -p -u -r1.87 value.h
--- value.h 9 May 2005 21:20:35 -0000 1.87
+++ value.h 27 May 2005 04:38:02 -0000
@@ -495,7 +495,7 @@ extern void print_variable_value (struct
struct frame_info *frame,
struct ui_file *stream);
-extern int check_field (struct value *, const gdb_byte *);
+extern int check_field (struct value *, const char *);
extern void typedef_print (struct type *type, struct symbol *news,
struct ui_file *stream);
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.60
diff -p -u -r1.60 cli-cmds.c
--- cli/cli-cmds.c 12 May 2005 21:20:38 -0000 1.60
+++ cli/cli-cmds.c 27 May 2005 04:38:02 -0000
@@ -650,7 +650,9 @@ static void
list_command (char *arg, int from_tty)
{
struct symtabs_and_lines sals, sals_end;
- struct symtab_and_line sal, sal_end, cursal;
+ struct symtab_and_line sal = { };
+ struct symtab_and_line sal_end = { };
+ struct symtab_and_line cursal = { };
struct symbol *sym;
char *arg1;
int no_end = 1;
Index: tui/tui.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.c,v
retrieving revision 1.53
diff -p -u -r1.53 tui.c
--- tui/tui.c 9 Nov 2004 00:59:03 -0000 1.53
+++ tui/tui.c 27 May 2005 04:38:02 -0000
@@ -552,7 +552,7 @@ tui_is_window_visible (enum tui_win_type
}
int
-tui_get_command_dimension (int *width, int *height)
+tui_get_command_dimension (unsigned int *width, unsigned int *height)
{
if (!tui_active || (TUI_CMD_WIN == NULL))
{
Index: tui/tui.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.h,v
retrieving revision 1.22
diff -p -u -r1.22 tui.h
--- tui/tui.h 10 Feb 2004 19:08:19 -0000 1.22
+++ tui/tui.h 27 May 2005 04:38:02 -0000
@@ -59,7 +59,8 @@ enum tui_win_type
extern CORE_ADDR tui_get_low_disassembly_address (CORE_ADDR, CORE_ADDR);
extern void tui_show_assembly (CORE_ADDR addr);
extern int tui_is_window_visible (enum tui_win_type type);
-extern int tui_get_command_dimension (int *width, int *height);
+extern int tui_get_command_dimension (unsigned int *width,
+ unsigned int *height);
/* Initialize readline and configure the keymap for the switching
key shortcut. */