From c68a6671d724482e3101ff3afc3effc928585cf9 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 27 May 2005 04:39:33 +0000 Subject: 2005-05-27 Andrew Cagney * 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. --- gdb/ChangeLog | 21 +++++++++++++++++++++ gdb/cli/cli-cmds.c | 4 +++- gdb/jv-lang.c | 4 ++-- gdb/jv-valprint.c | 4 ++-- gdb/scm-lang.c | 10 +++++----- gdb/scm-lang.h | 2 +- gdb/scm-valprint.c | 6 +++--- gdb/source.c | 4 ++-- gdb/tui/tui.c | 2 +- gdb/tui/tui.h | 3 ++- gdb/valops.c | 2 +- gdb/value.h | 2 +- 12 files changed, 44 insertions(+), 20 deletions(-) (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b05eb5aeb01..451515929d0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,24 @@ +2005-05-27 Andrew Cagney + + * 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. + 2005-05-26 Andrew Cagney * command.h (add_setshow_integer_cmd): Make VAR an integer. diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index af110961db9..aaba486ed33 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -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; diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index 08f736ac91d..c6700c92415 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -216,7 +216,7 @@ get_java_utf8_name (struct obstack *obstack, struct value *name) + 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 *expect_type, struct expression *exp, 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; diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index 41f6c561a6f..7e24e566cbb 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -72,7 +72,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format, 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, struct ui_file *stream, int format, while (i < length && things_printed < print_max) { - char *buf; + gdb_byte *buf; buf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT); fputs_filtered (", ", stream); diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c index 6054920c5d6..5ffa233603a 100644 --- a/gdb/scm-lang.c +++ b/gdb/scm-lang.c @@ -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); } diff --git a/gdb/scm-lang.h b/gdb/scm-lang.h index 1339ebaee90..bd1c21016a1 100644 --- a/gdb/scm-lang.h +++ b/gdb/scm-lang.h @@ -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); diff --git a/gdb/scm-valprint.c b/gdb/scm-valprint.c index 05399aa091a..9e952fb6908 100644 --- a/gdb/scm-valprint.c +++ b/gdb/scm-valprint.c @@ -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); diff --git a/gdb/source.c b/gdb/source.c index d8ca4a01342..063ffe59006 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -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; diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 3a7fb3390b0..4503be7ed91 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -552,7 +552,7 @@ tui_is_window_visible (enum tui_win_type 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)) { diff --git a/gdb/tui/tui.h b/gdb/tui/tui.h index d7b741c68a5..7b767d19630 100644 --- a/gdb/tui/tui.h +++ b/gdb/tui/tui.h @@ -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. */ diff --git a/gdb/valops.c b/gdb/valops.c index 14b845e7def..54c81ac2f0a 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -2269,7 +2269,7 @@ check_field_in (struct type *type, const char *name) 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; diff --git a/gdb/value.h b/gdb/value.h index 2347dad80fd..034bdc462cd 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -495,7 +495,7 @@ extern void print_variable_value (struct symbol *var, 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); -- cgit v1.2.3