* ada-lang.c (find_struct_field): Initialize *byte_offset_p.
* breakpoint.c (do_enable_breakpoint): Ignore both mem_cnt and i.
* c-typeprint.c (c_type_print_varspec_suffix): Don't test length
greater than or equal to zero.
* m2-typeprint.c (m2_array): Likewise.
* p-typeprint.c (pascal_type_print_varspec_prefix): Likewise.
* gdbtypes.c (copy_type_recursive): Correct == typo.
* i386-tdep.c (i386_skip_prologue): Remove stray semicolon.
* linux-nat.c (linux_nat_info_proc_cmd): Don't compare a pointer
greater than zero.
* macroscope.c (sal_macro_scope): Don't name a local variable "main".
(default_macro_scope): Remove unused variable.
* prologue-value.h (pv_area_find_reg): Don't name an argument
"register".
* remote-fileio.c (remote_fio_func_map): Add missing braces.
* remote.c (sigint_remote_twice_token, sigint_remote_token): Change
type.
(cleanup_sigint_signal_handler): Remove casts.
* valprint.c (val_print): Use a volatile local for the modified
argument.
* varobj.c (languages): Remove extra array dimension.
(varobj_create): Correct access to languages array.
* mi/mi-cmd-break.c (mi_cmd_break_insert, mi_cmd_break_watch): Add
missing braces.
* mi/mi-cmd-disas.c (mi_cmd_disassemble): Likewise.
* mi/mi-cmd-env.c (mi_cmd_env_path, mi_cmd_env_dir): Likewise.
* mi/mi-getopt.c (mi_valid_noargs): Likewise.
* mi/mi-main.c (mi_cmd_data_read_memory): Likewise.
(mi_cmd_data_write_memory): Likewise.
* signals/signals.c (target_signal_to_string): Cast to int before
comparing.
* tui/tui-layout.c (init_and_make_win): Take and return a void *.
Update all callers.
+2007-01-03 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * ada-lang.c (find_struct_field): Initialize *byte_offset_p.
+ * breakpoint.c (do_enable_breakpoint): Ignore both mem_cnt and i.
+ * c-typeprint.c (c_type_print_varspec_suffix): Don't test length
+ greater than or equal to zero.
+ * m2-typeprint.c (m2_array): Likewise.
+ * p-typeprint.c (pascal_type_print_varspec_prefix): Likewise.
+ * gdbtypes.c (copy_type_recursive): Correct == typo.
+ * i386-tdep.c (i386_skip_prologue): Remove stray semicolon.
+ * linux-nat.c (linux_nat_info_proc_cmd): Don't compare a pointer
+ greater than zero.
+ * macroscope.c (sal_macro_scope): Don't name a local variable "main".
+ (default_macro_scope): Remove unused variable.
+ * prologue-value.h (pv_area_find_reg): Don't name an argument
+ "register".
+ * remote-fileio.c (remote_fio_func_map): Add missing braces.
+ * remote.c (sigint_remote_twice_token, sigint_remote_token): Change
+ type.
+ (cleanup_sigint_signal_handler): Remove casts.
+ * valprint.c (val_print): Use a volatile local for the modified
+ argument.
+ * varobj.c (languages): Remove extra array dimension.
+ (varobj_create): Correct access to languages array.
+ * mi/mi-cmd-break.c (mi_cmd_break_insert, mi_cmd_break_watch): Add
+ missing braces.
+ * mi/mi-cmd-disas.c (mi_cmd_disassemble): Likewise.
+ * mi/mi-cmd-env.c (mi_cmd_env_path, mi_cmd_env_dir): Likewise.
+ * mi/mi-getopt.c (mi_valid_noargs): Likewise.
+ * mi/mi-main.c (mi_cmd_data_read_memory): Likewise.
+ (mi_cmd_data_write_memory): Likewise.
+ * signals/signals.c (target_signal_to_string): Cast to int before
+ comparing.
+ * tui/tui-layout.c (init_and_make_win): Take and return a void *.
+ Update all callers.
+
2007-01-03 Daniel Jacobowitz <dan@codesourcery.com>
* NEWS: Mention pointer to member improvements.
if (field_type_p != NULL)
*field_type_p = NULL;
if (byte_offset_p != NULL)
- *byte_offset_p;
+ *byte_offset_p = 0;
if (bit_offset_p != NULL)
*bit_offset_p = 0;
if (bit_size_p != NULL)
int mem_cnt = can_use_hardware_watchpoint (bpt->val);
/* Hack around 'unused var' error for some targets here */
- (void) mem_cnt, i;
+ (void) mem_cnt, (void) i;
target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT (
bpt->type, i + mem_cnt, other_type_used);
/* we can consider of type is bp_hardware_watchpoint, convert to
fprintf_filtered (stream, ")");
fprintf_filtered (stream, "[");
- if (TYPE_LENGTH (type) >= 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
+ if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
&& TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
fprintf_filtered (stream, "%d",
(TYPE_LENGTH (type)
can't, but at the moment it is not needed. */
if (TYPE_CODE (type) == TYPE_CODE_FLT)
- TYPE_FLOATFORMAT (new_type) == TYPE_FLOATFORMAT (type);
+ TYPE_FLOATFORMAT (new_type) = TYPE_FLOATFORMAT (type);
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|| TYPE_CODE (type) == TYPE_CODE_UNION
|| TYPE_CODE (type) == TYPE_CODE_TEMPLATE
/* addl y,%ebx */
if (delta > 0 && op == 0x81
- && read_memory_unsigned_integer (pc + delta + 1, 1) == 0xc3);
+ && read_memory_unsigned_integer (pc + delta + 1, 1) == 0xc3)
{
pc += delta + 6;
}
if (cmdline_f || all)
{
sprintf (fname1, "/proc/%lld/cmdline", pid);
- if ((procfile = fopen (fname1, "r")) > 0)
+ if ((procfile = fopen (fname1, "r")) != NULL)
{
fgets (buffer, sizeof (buffer), procfile);
printf_filtered ("cmdline = '%s'\n", buffer);
if (mappings_f || all)
{
sprintf (fname1, "/proc/%lld/maps", pid);
- if ((procfile = fopen (fname1, "r")) > 0)
+ if ((procfile = fopen (fname1, "r")) != NULL)
{
long long addr, endaddr, size, offset, inode;
char permissions[8], device[8], filename[MAXPATHLEN];
if (status_f || all)
{
sprintf (fname1, "/proc/%lld/status", pid);
- if ((procfile = fopen (fname1, "r")) > 0)
+ if ((procfile = fopen (fname1, "r")) != NULL)
{
while (fgets (buffer, sizeof (buffer), procfile) != NULL)
puts_filtered (buffer);
if (stat_f || all)
{
sprintf (fname1, "/proc/%lld/stat", pid);
- if ((procfile = fopen (fname1, "r")) > 0)
+ if ((procfile = fopen (fname1, "r")) != NULL)
{
int itmp;
char ctmp;
int show, int level)
{
fprintf_filtered (stream, "ARRAY [");
- if (TYPE_LENGTH (type) >= 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
+ if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
&& TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
{
if (TYPE_INDEX_TYPE (type) != 0)
struct macro_scope *
sal_macro_scope (struct symtab_and_line sal)
{
- struct macro_source_file *main, *inclusion;
+ struct macro_source_file *main_file, *inclusion;
struct macro_scope *ms;
if (! sal.symtab
ms = (struct macro_scope *) xmalloc (sizeof (*ms));
- main = macro_main (sal.symtab->macro_table);
- inclusion = macro_lookup_inclusion (main, sal.symtab->filename);
+ main_file = macro_main (sal.symtab->macro_table);
+ inclusion = macro_lookup_inclusion (main_file, sal.symtab->filename);
if (inclusion)
{
For the time being, though, we'll just treat these as
occurring at the end of the main source file. */
- ms->file = main;
+ ms->file = main_file;
ms->line = -1;
complaint (&symfile_complaints,
default_macro_scope (void)
{
struct symtab_and_line sal;
- struct macro_source_file *main;
struct macro_scope *ms;
/* If there's a selected frame, use its PC. */
{"c", CONDITION_OPT, 1},
{"i", IGNORE_COUNT_OPT, 1},
{"p", THREAD_OPT, 1},
- 0
+ { 0, 0, 0 }
};
/* Parse arguments. It could be -r or -h or -t, <location> or ``--''
{
{"r", READ_OPT, 0},
{"a", ACCESS_OPT, 0},
- 0
+ { 0, 0, 0 }
};
/* Parse arguments. */
{"n", NUM_OPT, 1},
{"s", START_OPT, 1},
{"e", END_OPT, 1},
- 0
+ { 0, 0, 0 }
};
/* Get the options with their arguments. Keep track of what we
static struct mi_opt opts[] =
{
{"r", RESET_OPT, 0},
- 0
+ { 0, 0, 0 }
};
dont_repeat ();
static struct mi_opt opts[] =
{
{"r", RESET_OPT, 0},
- 0
+ { 0, 0, 0 }
};
dont_repeat ();
char *optarg;
static struct mi_opt opts[] =
{
- 0
+ { 0, 0, 0 }
};
if (mi_getopt (prefix, argc, argv, opts, &optind, &optarg) == -1)
static struct mi_opt opts[] =
{
{"o", OFFSET_OPT, 1},
- 0
+ { 0, 0, 0 }
};
while (1)
static struct mi_opt opts[] =
{
{"o", OFFSET_OPT, 1},
- 0
+ { 0, 0, 0 }
};
while (1)
if (passed_a_ptr)
fprintf_filtered (stream, "(");
fprintf_filtered (stream, "array ");
- if (TYPE_LENGTH (type) >= 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
+ if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
&& TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
fprintf_filtered (stream, "[%d..%d] ",
TYPE_ARRAY_LOWER_BOUND_VALUE (type),
instead, and collecting all your information in one pass. */
int pv_area_find_reg (struct pv_area *area,
struct gdbarch *gdbarch,
- int register,
+ int reg,
CORE_ADDR *offset_p);
char *name;
void (*func)(char *);
} remote_fio_func_map[] = {
- "open", remote_fileio_func_open,
- "close", remote_fileio_func_close,
- "read", remote_fileio_func_read,
- "write", remote_fileio_func_write,
- "lseek", remote_fileio_func_lseek,
- "rename", remote_fileio_func_rename,
- "unlink", remote_fileio_func_unlink,
- "stat", remote_fileio_func_stat,
- "fstat", remote_fileio_func_fstat,
- "gettimeofday", remote_fileio_func_gettimeofday,
- "isatty", remote_fileio_func_isatty,
- "system", remote_fileio_func_system,
- NULL, NULL
+ { "open", remote_fileio_func_open },
+ { "close", remote_fileio_func_close },
+ { "read", remote_fileio_func_read },
+ { "write", remote_fileio_func_write },
+ { "lseek", remote_fileio_func_lseek },
+ { "rename", remote_fileio_func_rename },
+ { "unlink", remote_fileio_func_unlink },
+ { "stat", remote_fileio_func_stat },
+ { "fstat", remote_fileio_func_fstat },
+ { "gettimeofday", remote_fileio_func_gettimeofday },
+ { "isatty", remote_fileio_func_isatty },
+ { "system", remote_fileio_func_system },
+ { NULL, NULL }
};
static int
static int use_threadextra_query;
/* Tokens for use by the asynchronous signal handlers for SIGINT. */
-static void *sigint_remote_twice_token;
-static void *sigint_remote_token;
+static struct async_signal_handler *sigint_remote_twice_token;
+static struct async_signal_handler *sigint_remote_token;
/* These are pointers to hook functions that may be set in order to
modify resume/wait behavior for a particular architecture. */
{
signal (SIGINT, handle_sigint);
if (sigint_remote_twice_token)
- delete_async_signal_handler ((struct async_signal_handler **)
- &sigint_remote_twice_token);
+ delete_async_signal_handler (&sigint_remote_twice_token);
if (sigint_remote_token)
- delete_async_signal_handler ((struct async_signal_handler **)
- &sigint_remote_token);
+ delete_async_signal_handler (&sigint_remote_token);
}
/* Send ^C to target to halt it. Target will respond, and send us a
/* Target signal translation functions for GDB.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
char *
target_signal_to_string (enum target_signal sig)
{
- if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST))
+ if ((int) sig >= TARGET_SIGNAL_FIRST && (int) sig <= TARGET_SIGNAL_LAST)
return signals[sig].string;
else
return signals[TARGET_SIGNAL_UNKNOWN].string;
char *
target_signal_to_name (enum target_signal sig)
{
- if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST)
+ if ((int) sig >= TARGET_SIGNAL_FIRST && (int) sig <= TARGET_SIGNAL_LAST
&& signals[sig].name != NULL)
return signals[sig].name;
else
********************************/
static void show_layout (enum tui_layout_type);
static void init_gen_win_info (struct tui_gen_win_info *, enum tui_win_type, int, int, int, int);
-static void init_and_make_win (void **, enum tui_win_type, int, int, int, int, int);
+static void *init_and_make_win (void *, enum tui_win_type, int, int, int, int, int);
static void show_source_or_disasm_and_command (enum tui_layout_type);
static void make_source_or_disasm_window (struct tui_win_info * *, enum tui_win_type, int, int);
static void make_command_window (struct tui_win_info * *, int, int);
static void
make_command_window (struct tui_win_info * * win_info_ptr, int height, int origin_y)
{
- init_and_make_win ((void **) win_info_ptr,
- CMD_WIN,
- height,
- tui_term_width (),
- 0,
- origin_y,
- DONT_BOX_WINDOW);
+ *win_info_ptr = init_and_make_win (*win_info_ptr,
+ CMD_WIN,
+ height,
+ tui_term_width (),
+ 0,
+ origin_y,
+ DONT_BOX_WINDOW);
(*win_info_ptr)->can_highlight = FALSE;
}
static void
make_data_window (struct tui_win_info * * win_info_ptr, int height, int origin_y)
{
- init_and_make_win ((void **) win_info_ptr,
- DATA_WIN,
- height,
- tui_term_width (),
- 0,
- origin_y,
- BOX_WINDOW);
+ *win_info_ptr = init_and_make_win (*win_info_ptr,
+ DATA_WIN,
+ height,
+ tui_term_width (),
+ 0,
+ origin_y,
+ BOX_WINDOW);
}
if (TUI_DISASM_WIN == NULL)
{
make_disasm_window (&TUI_DISASM_WIN, asm_height, src_height - 1);
- init_and_make_win ((void **) & locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- tui_term_width (),
- 0,
- (src_height + asm_height) - 1,
- DONT_BOX_WINDOW);
+ locator = init_and_make_win (locator,
+ LOCATOR_WIN,
+ 2 /* 1 */ ,
+ tui_term_width (),
+ 0,
+ (src_height + asm_height) - 1,
+ DONT_BOX_WINDOW);
}
else
{
make_source_window (&tui_win_list[win_type], src_height, data_height - 1);
else
make_disasm_window (&tui_win_list[win_type], src_height, data_height - 1);
- init_and_make_win ((void **) & locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- tui_term_width (),
- 0,
- total_height - 1,
- DONT_BOX_WINDOW);
+ locator = init_and_make_win (locator,
+ LOCATOR_WIN,
+ 2 /* 1 */ ,
+ tui_term_width (),
+ 0,
+ total_height - 1,
+ DONT_BOX_WINDOW);
}
else
{
/*
** init_and_make_win().
*/
-static void
-init_and_make_win (void ** win_info_ptr, enum tui_win_type win_type,
- int height, int width, int origin_x, int origin_y, int box_it)
+static void *
+init_and_make_win (void *opaque_win_info, enum tui_win_type win_type,
+ int height, int width, int origin_x, int origin_y,
+ int box_it)
{
- void *opaque_win_info = *win_info_ptr;
struct tui_gen_win_info * generic;
if (opaque_win_info == NULL)
}
tui_make_window (generic, box_it);
}
- *win_info_ptr = opaque_win_info;
+ return opaque_win_info;
}
execution_info = tui_source_exec_info_win_ptr ();
else
execution_info = tui_disassem_exec_info_win_ptr ();
- init_and_make_win ((void **) & execution_info,
- EXEC_INFO_WIN,
- height,
- 3,
- 0,
- origin_y,
- DONT_BOX_WINDOW);
+ execution_info = init_and_make_win (execution_info,
+ EXEC_INFO_WIN,
+ height,
+ 3,
+ 0,
+ origin_y,
+ DONT_BOX_WINDOW);
/*
** Now create the source window.
*/
- init_and_make_win ((void **) win_info_ptr,
- type,
- height,
- tui_term_width () - execution_info->width,
- execution_info->width,
- origin_y,
- BOX_WINDOW);
+ *win_info_ptr = init_and_make_win (*win_info_ptr,
+ type,
+ height,
+ tui_term_width () - execution_info->width,
+ execution_info->width,
+ origin_y,
+ BOX_WINDOW);
(*win_info_ptr)->detail.source_info.execution_info = execution_info;
}
make_source_window (win_info_ptr, src_height - 1, 0);
else
make_disasm_window (win_info_ptr, src_height - 1, 0);
- init_and_make_win ((void **) & locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- tui_term_width (),
- 0,
- src_height - 1,
- DONT_BOX_WINDOW);
+ locator = init_and_make_win (locator,
+ LOCATOR_WIN,
+ 2 /* 1 */ ,
+ tui_term_width (),
+ 0,
+ src_height - 1,
+ DONT_BOX_WINDOW);
}
else
{
int deref_ref, int recurse, enum val_prettyprint pretty)
{
volatile struct gdb_exception except;
+ volatile enum val_prettyprint real_pretty = pretty;
int ret = 0;
struct type *real_type = check_typedef (type);
if (pretty == Val_pretty_default)
- {
- pretty = prettyprint_structs ? Val_prettyprint : Val_no_prettyprint;
- }
+ real_pretty = prettyprint_structs ? Val_prettyprint : Val_no_prettyprint;
QUIT;
TRY_CATCH (except, RETURN_MASK_ERROR)
{
ret = LA_VAL_PRINT (type, valaddr, embedded_offset, address,
- stream, format, deref_ref, recurse, pretty);
+ stream, format, deref_ref, recurse, real_pretty);
}
if (except.reason < 0)
fprintf_filtered (stream, _("<error reading variable>"));
};
/* Array of known source language routines. */
-static struct language_specific
- languages[vlang_end][sizeof (struct language_specific)] = {
+static struct language_specific languages[vlang_end] = {
/* Unknown (try treating as C */
{
vlang_unknown,
/* Set language info */
lang = variable_language (var);
- var->root->lang = languages[lang];
+ var->root->lang = &languages[lang];
/* Set ourselves as our root */
var->root->rootvar = var;