+2015-07-31 Simon Marchi <simon.marchi@ericsson.com>
+
+ * aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): Use enum
+ type or value instead of integer.
+ (aarch64_linux_insert_watchpoint): Likewise.
+ (aarch64_linux_remove_watchpoint): Likewise.
+ * ada-lang.c (ada_op_print_tab): Likewise.
+ * amd64-linux-tdep.c (amd64_canonicalize_syscall): Likewise.
+ (amd64_linux_syscall_record_common): Likewise.
+ * arch-utils.c (target_byte_order_user): Likewise.
+ (default_byte_order): Likewise.
+ * arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Likewise.
+ (arm_linux_get_hwbp_type): Likewise.
+ (arm_linux_hw_watchpoint_initialize): Likewise.
+ (arm_linux_insert_watchpoint): Likewise.
+ * arm-linux-tdep.c (arm_canonicalize_syscall): Likewise.
+ (arm_linux_syscall_record): Likewise.
+ * breakpoint.c (update_watchpoint): Likewise.
+ (breakpoint_here_p): Likewise.
+ (bpstat_print): Likewise.
+ (enable_breakpoint_disp): Likewise.
+ * c-lang.c (c_op_print_tab): Likewise.
+ * cli/cli-decode.c (add_info_alias): Likewise.
+ * d-lang.c (d_op_print_tab): Likewise.
+ * eval.c (evaluate_subexp_standard): Likewise.
+ * f-exp.y (dot_ops): Likewise.
+ (f77_keywords): Likewise.
+ * f-lang.c (f_op_print_tab): Likewise.
+ * go-lang.c (go_op_print_tab): Likewise.
+ * guile/scm-breakpoint.c (gdbscm_make_breakpoint): Likewise.
+ * guile/scm-cmd.c (gdbscm_make_command): Likewise.
+ * guile/scm-param.c (gdbscm_make_parameter): Likewise.
+ * guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Likewise.
+ * guile/scm-string.c (struct scm_to_stringn_data): Likewise.
+ (struct scm_from_stringn_data): Likewise.
+ * i386-linux-tdep.c (i386_canonicalize_syscall): Likewise.
+ * ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise.
+ (ia64_linux_remove_watchpoint): Likewise.
+ (ia64_linux_can_use_hw_breakpoint): Likewise.
+ * infrun.c (print_stop_event): Likewise.
+ * jv-lang.c (java_op_print_tab): Likewise.
+ * linux-nat.c (linux_proc_xfer_partial): Likewise.
+ * linux-nat.h (struct lwp_info): Likewise.
+ * linux-thread-db.c (enable_thread_event): Likewise.
+ * m2-lang.c (m2_op_print_tab): Likewise.
+ * mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Likewise.
+ (mi_cmd_stack_list_variables): Likewise.
+ * mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise.
+ * mi/mi-out.c (mi_table_begin): Likewise.
+ (mi_table_header): Likewise.
+ * mips-linux-nat.c (mips_linux_can_use_hw_breakpoint): Likewise.
+ (mips_linux_insert_watchpoint): Likewise.
+ (mips_linux_remove_watchpoint): Likewise.
+ * nat/mips-linux-watch.c (mips_linux_watch_type_to_irw): Likewise.
+ * nat/mips-linux-watch.h (struct mips_watchpoint): Likewise.
+ (mips_linux_watch_type_to_irw): Likewise.
+ * nto-procfs.c (procfs_can_use_hw_breakpoint): Likewise.
+ (procfs_insert_hw_watchpoint): Likewise.
+ (procfs_remove_hw_watchpoint): Likewise.
+ (procfs_hw_watchpoint): Likewise.
+ (procfs_can_use_hw_breakpoint): Likewise.
+ (procfs_remove_hw_watchpoint): Likewise.
+ (procfs_insert_hw_watchpoint): Likewise.
+ * p-lang.c (pascal_op_print_tab): Likewise.
+ * ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Likewise.
+ * ppc-linux-tdep.c (ppu2spu_unwind_register): Likewise.
+ * ppc-sysv-tdep.c (get_decimal_float_return_value): Likewise.
+ * procfs.c (procfs_can_use_hw_breakpoint): Likewise.
+ (procfs_insert_watchpoint): Likewise.
+ (procfs_remove_watchpoint): Likewise.
+ * psymtab.c (recursively_search_psymtabs): Likewise.
+ * remote-m32r-sdi.c (m32r_can_use_hw_watchpoint): Likewise.
+ (m32r_insert_watchpoint): Likewise.
+ * remote-mips.c (mips_can_use_watchpoint): Likewise.
+ (mips_insert_watchpoint): Likewise.
+ (mips_remove_watchpoint): Likewise.
+ * remote.c (watchpoint_to_Z_packet): Likewise.
+ (remote_insert_watchpoint): Likewise.
+ (remote_remove_watchpoint): Likewise.
+ (remote_check_watch_resources): Likewise.
+ * s390-linux-nat.c (s390_insert_watchpoint): Likewise.
+ (s390_remove_watchpoint): Likewise.
+ (s390_can_use_hw_breakpoint): Likewise.
+ * s390-linux-tdep.c (s390_gdbarch_init): Likewise.
+ * spu-linux-nat.c (spu_can_use_hw_breakpoint): Likewise.
+ * target.h (struct target_ops): Likewise.
+ * tilegx-tdep.c (tilegx_analyze_prologue): Likewise.
+ * ui-out.c (struct ui_out_hdr): Likewise.
+ (append_header_to_list): Likewise.
+ (get_next_header): Likewise.
+ (verify_field): Likewise.
+ (ui_out_begin): Likewise.
+ (ui_out_field_int): Likewise.
+ (ui_out_field_fmt_int): Likewise.
+ (ui_out_field_skip): Likewise.
+ (ui_out_field_string): Likewise.
+ (ui_out_field_fmt): Likewise.
+ * varobj.c (new_variable): Likewise.
+ * x86-nat.c (x86_insert_watchpoint): Likewise.
+ (x86_remove_watchpoint): Likewise.
+ (x86_can_use_hw_breakpoint): Likewise.
+ * xtensa-tdep.h (struct gdbarch_tdep): Likewise.
+ * inflow.c (enum gdb_has_a_terminal_flag_enum): Add name to
+ previously anonymous enumeration type..
+ * linux-record.h (enum gdb_syscall): Add gdb_sys_no_syscall
+ value.
+ * target-debug.h (target_debug_print_enum_target_hw_bp_type): New.
+ (target_debug_print_enum_bptype): New.
+ * target-delegates.c: Regenerate.
+
2015-07-30 Sandra Loosemore <sandra@codesourcery.com>
* nios2-tdep.c (nios2_analyze_prologue): Do what the comment
static int
aarch64_linux_can_use_hw_breakpoint (struct target_ops *self,
- int type, int cnt, int othertype)
+ enum bptype type,
+ int cnt, int othertype)
{
if (type == bp_hardware_watchpoint || type == bp_read_watchpoint
|| type == bp_access_watchpoint || type == bp_watchpoint)
static int
aarch64_linux_insert_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond)
{
int ret;
static int
aarch64_linux_remove_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond)
{
int ret;
{".all", UNOP_IND, PREC_SUFFIX, 1},
{"'access", UNOP_ADDR, PREC_SUFFIX, 1},
{"'size", OP_ATR_SIZE, PREC_SUFFIX, 1},
- {NULL, 0, 0, 0}
+ {NULL, OP_NULL, PREC_SUFFIX, 0}
};
\f
enum ada_primitive_types {
case amd64_sys_arch_prctl:
case amd64_x32_sys_arch_prctl:
- return -1; /* Note */
+ return gdb_sys_no_syscall; /* Note */
case amd64_sys_adjtimex:
case amd64_x32_sys_adjtimex:
return gdb_sys_move_pages;
default:
- return -1;
+ return gdb_sys_no_syscall;
}
}
{
int ret;
ULONGEST syscall_native;
- enum gdb_syscall syscall_gdb = -1;
+ enum gdb_syscall syscall_gdb = gdb_sys_no_syscall;
regcache_raw_read_unsigned (regcache, AMD64_RAX_REGNUM, &syscall_native);
break;
}
- syscall_gdb = amd64_canonicalize_syscall (syscall_native);
+ syscall_gdb
+ = amd64_canonicalize_syscall ((enum amd64_syscall) syscall_native);
- if (syscall_gdb < 0)
+ if (syscall_gdb == gdb_sys_no_syscall)
{
printf_unfiltered (_("Process record and replay target doesn't "
"support syscall number %s\n"),
\f
/* Functions to manipulate the endianness of the target. */
-static int target_byte_order_user = BFD_ENDIAN_UNKNOWN;
+static enum bfd_endian target_byte_order_user = BFD_ENDIAN_UNKNOWN;
static const char endian_big[] = "big";
static const char endian_little[] = "little";
static const bfd_target *default_bfd_vec;
#endif
-static int default_byte_order = BFD_ENDIAN_UNKNOWN;
+static enum bfd_endian default_byte_order = BFD_ENDIAN_UNKNOWN;
void
initialize_current_architecture (void)
there is not an appropriate resource available, otherwise returns 1. */
static int
arm_linux_can_use_hw_breakpoint (struct target_ops *self,
- int type, int cnt, int ot)
+ enum bptype type,
+ int cnt, int ot)
{
if (type == bp_hardware_watchpoint || type == bp_read_watchpoint
|| type == bp_access_watchpoint || type == bp_watchpoint)
p->control = arm_hwbp_control_initialize (mask, arm_hwbp_break, 1);
}
-/* Get the ARM hardware breakpoint type from the RW value we're given when
- asked to set a watchpoint. */
+/* Get the ARM hardware breakpoint type from the type value we're
+ given when asked to set a watchpoint. */
static arm_hwbp_type
-arm_linux_get_hwbp_type (int rw)
+arm_linux_get_hwbp_type (enum target_hw_bp_type type)
{
if (rw == hw_read)
return arm_hwbp_load;
/* Initialize the hardware breakpoint structure P for a watchpoint at ADDR
to LEN. The type of watchpoint is given in RW. */
static void
-arm_linux_hw_watchpoint_initialize (CORE_ADDR addr, int len, int rw,
+arm_linux_hw_watchpoint_initialize (CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct arm_linux_hw_breakpoint *p)
{
const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap ();
p->address = (unsigned int) addr;
p->control = arm_hwbp_control_initialize (mask,
- arm_linux_get_hwbp_type (rw), 1);
+ arm_linux_get_hwbp_type (type), 1);
}
/* Are two break-/watch-points equal? */
/* Insert a Hardware breakpoint. */
static int
arm_linux_insert_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int rw,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type rw,
struct expression *cond)
{
struct lwp_info *lp;
else if (syscall >= 248 && syscall <= 253)
return syscall + 4;
- return -1;
+ return gdb_sys_no_syscall;
}
/* Record all registers but PC register for process-record. */
syscall_gdb = arm_canonicalize_syscall (svc_number);
- if (syscall_gdb < 0)
+ if (syscall_gdb == gdb_sys_no_syscall)
{
printf_unfiltered (_("Process record and replay target doesn't "
"support syscall number %s\n"),
&& TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
{
CORE_ADDR addr;
- int type;
+ enum target_hw_bp_type type;
struct bp_location *loc, **tmp;
int bitpos = 0, bitsize = 0;
}
}
- return any_breakpoint_here ? ordinary_breakpoint_here : 0;
+ return any_breakpoint_here ? ordinary_breakpoint_here : no_breakpoint_here;
}
/* Return true if there's a moribund breakpoint at PC. */
enum print_stop_action
bpstat_print (bpstat bs, int kind)
{
- int val;
+ enum print_stop_action val;
/* Maybe another breakpoint in the chain caused us to stop.
(Currently all watchpoints go on the bpstat whether hit or not.
if (is_watchpoint (bpt))
{
/* Initialize it just to avoid a GCC false warning. */
- enum enable_state orig_enable_state = 0;
+ enum enable_state orig_enable_state = bp_disabled;
TRY
{
{"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
{"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
{"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
- {NULL, 0, 0, 0}
+ {NULL, OP_NULL, PREC_PREFIX, 0}
};
\f
enum c_primitive_types {
struct cmd_list_element *
add_info_alias (const char *name, const char *oldname, int abbrev_flag)
{
- return add_alias_cmd (name, oldname, 0, abbrev_flag, &infolist);
+ return add_alias_cmd (name, oldname, class_run, abbrev_flag, &infolist);
}
/* Add an element to the list of commands. */
{"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
{"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
{"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
- {NULL, 0, 0, 0}
+ {NULL, OP_NULL, PREC_PREFIX, 0}
};
/* Mapping of all D basic data types into the language vector. */
CORE_ADDR selector = 0;
int struct_return = 0;
- int sub_no_side = 0;
+ enum noside sub_no_side = EVAL_NORMAL;
struct value *msg_send = NULL;
struct value *msg_send_stret = NULL;
{ ".GT.", GREATERTHAN, BINOP_END },
{ ".lt.", LESSTHAN, BINOP_END },
{ ".LT.", LESSTHAN, BINOP_END },
- { NULL, 0, 0 }
+ { NULL, 0, BINOP_END }
};
struct f77_boolean_val
{ "sizeof", SIZEOF, BINOP_END },
{ "real_8", REAL_S8_KEYWORD, BINOP_END },
{ "real", REAL_KEYWORD, BINOP_END },
- { NULL, 0, 0 }
+ { NULL, 0, BINOP_END }
};
/* Implementation of a dynamically expandable buffer for processing input
{".LT.", BINOP_LESS, PREC_ORDER, 0},
{"**", UNOP_IND, PREC_PREFIX, 0},
{"@", BINOP_REPEAT, PREC_REPEAT, 0},
- {NULL, 0, 0, 0}
+ {NULL, OP_NULL, PREC_REPEAT, 0}
};
\f
enum f_primitive_types {
{"unsafe.Sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
{"++", UNOP_POSTINCREMENT, PREC_SUFFIX, 0},
{"--", UNOP_POSTDECREMENT, PREC_SUFFIX, 0},
- {NULL, 0, 0, 0}
+ {NULL, OP_NULL, PREC_SUFFIX, 0}
};
enum go_primitive_types {
char *s;
char *location;
int type_arg_pos = -1, access_type_arg_pos = -1, internal_arg_pos = -1;
- int type = bp_breakpoint;
- int access_type = hw_write;
+ enum bptype type = bp_breakpoint;
+ enum target_hw_bp_type access_type = hw_write;
int internal = 0;
SCM result;
breakpoint_smob *bp_smob;
int doc_arg_pos = -1;
char *s;
char *name;
- int command_class = no_class;
+ enum command_class command_class = no_class;
SCM completer_class = SCM_BOOL_F;
int is_prefix = 0;
char *doc = NULL;
if (gdbscm_is_exception (initial_value_scm))
gdbscm_throw (initial_value_scm);
}
- pascm_set_param_value_x (param_type, &p_smob->value, enum_list,
+ pascm_set_param_value_x (p_smob->type, &p_smob->value, enum_list,
initial_value_scm,
initial_value_arg_pos, FUNC_NAME);
}
struct value *value;
enum display_hint hint;
struct cleanup *cleanups;
- int result = EXT_LANG_RC_NOP;
+ enum ext_lang_rc result = EXT_LANG_RC_NOP;
enum string_repr_result print_result;
/* No pretty-printer support for unavailable values. */
SCM string;
size_t *lenp;
const char *charset;
- int conversion_kind;
+ scm_t_string_failed_conversion_handler conversion_kind;
char *result;
};
const char *string;
size_t len;
const char *charset;
- int conversion_kind;
+ scm_t_string_failed_conversion_handler conversion_kind;
SCM result;
};
if (syscall <= i386_syscall_max)
return syscall;
else
- return -1;
+ return gdb_sys_no_syscall;
}
/* Parse the arguments of current system call instruction and record
static int
ia64_linux_insert_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int rw,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond)
{
struct lwp_info *lp;
dbr_addr = (long) addr;
dbr_mask = (~(len - 1) & 0x00ffffffffffffffL); /* construct mask to match */
dbr_mask |= 0x0800000000000000L; /* Only match privilege level 3 */
- switch (rw)
+ switch (type)
{
case hw_write:
dbr_mask |= (1L << 62); /* Set w bit */
static int
ia64_linux_remove_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond)
{
int idx;
static int
ia64_linux_can_use_hw_breakpoint (struct target_ops *self,
- int type, int cnt, int othertype)
+ enum bptype type,
+ int cnt, int othertype)
{
return 1;
}
}
#endif
-enum
+enum gdb_has_a_terminal_flag_enum
{
yes, no, have_not_checked
}
print_stop_event (struct target_waitstatus *ws)
{
int bpstat_ret;
- int source_flag;
+ enum print_what source_flag;
int do_frame_printing = 1;
struct thread_info *tp = inferior_thread ();
{"*", UNOP_IND, PREC_PREFIX, 0},
{"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
{"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
- {NULL, 0, 0, 0}
+ {NULL, OP_NULL, PREC_PREFIX, 0}
};
enum java_primitive_types
char filename[64];
if (object != TARGET_OBJECT_MEMORY || !readbuf)
- return 0;
+ return TARGET_XFER_EOF;
/* Don't bother for one word. */
if (len < 3 * sizeof (long))
Values:
- TARGET_WAITKIND_SYSCALL_ENTRY
- TARGET_WAITKIND_SYSCALL_RETURN */
- int syscall_state;
+ enum target_waitkind syscall_state;
/* The processor core this LWP was last seen on. */
int core;
each must provide a mapping from their set to this one. */
enum gdb_syscall {
+ /* An unknown GDB syscall, not a real syscall. */
+ gdb_sys_no_syscall = -1,
+
gdb_sys_restart_syscall = 0,
gdb_sys_exit = 1,
gdb_sys_fork = 2,
}
static td_err_e
-enable_thread_event (int event, CORE_ADDR *bp)
+enable_thread_event (td_event_e event, CORE_ADDR *bp)
{
td_notify_t notify;
td_err_e err;
{"MIN", UNOP_MIN, PREC_BUILTIN_FUNCTION, 0},
{"ODD", UNOP_ODD, PREC_BUILTIN_FUNCTION, 0},
{"TRUNC", UNOP_TRUNC, PREC_BUILTIN_FUNCTION, 0},
- {NULL, 0, 0, 0}
+ {NULL, OP_NULL, PREC_BUILTIN_FUNCTION, 0}
};
\f
/* The built-in types of Modula-2. */
struct frame_info *frame;
int raw_arg = 0;
enum ext_lang_bt_status result = EXT_LANG_BT_ERROR;
- int print_value;
+ enum print_values print_value;
int oind = 0;
int skip_unavailable = 0;
int i;
struct frame_info *frame;
int raw_arg = 0;
enum ext_lang_bt_status result = EXT_LANG_BT_ERROR;
- int print_value;
+ enum print_values print_value;
int oind = 0;
int skip_unavailable = 0;
struct collection_list tracepoint_list, stepping_list;
struct traceframe_info *tinfo;
int oind = 0;
- int var_print_values = PRINT_ALL_VALUES;
- int comp_print_values = PRINT_ALL_VALUES;
+ enum print_values var_print_values = PRINT_ALL_VALUES;
+ enum print_values comp_print_values = PRINT_ALL_VALUES;
int registers_format = 'x';
int memory_contents = 0;
struct ui_out *uiout = current_uiout;
const char *tblid)
{
mi_open (uiout, tblid, ui_out_type_tuple);
- mi_field_int (uiout, -1, -1, -1, "nr_rows", nr_rows);
- mi_field_int (uiout, -1, -1, -1, "nr_cols", nr_cols);
+ mi_field_int (uiout, -1, -1, ui_left, "nr_rows", nr_rows);
+ mi_field_int (uiout, -1, -1, ui_left, "nr_cols", nr_cols);
mi_open (uiout, "hdr", ui_out_type_list);
}
return;
mi_open (uiout, NULL, ui_out_type_tuple);
- mi_field_int (uiout, 0, 0, 0, "width", width);
- mi_field_int (uiout, 0, 0, 0, "alignment", alignment);
- mi_field_string (uiout, 0, 0, 0, "col_name", col_name);
+ mi_field_int (uiout, 0, 0, ui_center, "width", width);
+ mi_field_int (uiout, 0, 0, ui_center, "alignment", alignment);
+ mi_field_string (uiout, 0, 0, ui_center, "col_name", col_name);
mi_field_string (uiout, 0, width, alignment, "colhdr", colhdr);
mi_close (uiout, ui_out_type_tuple);
}
static int
mips_linux_can_use_hw_breakpoint (struct target_ops *self,
- int type, int cnt, int ot)
+ enum bptype type,
+ int cnt, int ot)
{
int i;
uint32_t wanted_mask, irw_mask;
static int
mips_linux_insert_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond)
{
struct pt_watch_regs regs;
static int
mips_linux_remove_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond)
{
int retval;
/* Convert GDB's TYPE to an IRW mask. */
uint32_t
-mips_linux_watch_type_to_irw (int type)
+mips_linux_watch_type_to_irw (enum target_hw_bp_type type)
{
switch (type)
{
{
CORE_ADDR addr;
int len;
- int type;
+ enum target_hw_bp_type type;
struct mips_watchpoint *next;
};
CORE_ADDR addr, int len, uint32_t irw);
void mips_linux_watch_populate_regs (struct mips_watchpoint *current_watches,
struct pt_watch_regs *regs);
-uint32_t mips_linux_watch_type_to_irw (int type);
+uint32_t mips_linux_watch_type_to_irw (enum target_hw_bp_type type);
int mips_linux_read_watch_registers (long lwpid,
struct pt_watch_regs *watch_readback,
static ptid_t do_attach (ptid_t ptid);
static int procfs_can_use_hw_breakpoint (struct target_ops *self,
- int, int, int);
+ enum target_hw_bp_type, int, int);
static int procfs_insert_hw_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond);
static int procfs_remove_hw_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond);
static int procfs_stopped_by_watchpoint (struct target_ops *ops);
static int
-procfs_hw_watchpoint (int addr, int len, int type)
+procfs_hw_watchpoint (int addr, int len, enum target_hw_bp_type type)
{
procfs_break brk;
switch (type)
{
- case 1: /* Read. */
+ case hw_read:
brk.type = _DEBUG_BREAK_RD;
break;
- case 2: /* Read/Write. */
+ case hw_access:
brk.type = _DEBUG_BREAK_RW;
break;
default: /* Modify. */
static int
procfs_can_use_hw_breakpoint (struct target_ops *self,
- int type, int cnt, int othertype)
+ enum bptype type,
+ int cnt, int othertype)
{
return 1;
}
static int
procfs_remove_hw_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond)
{
return procfs_hw_watchpoint (addr, -1, type);
static int
procfs_insert_hw_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond)
{
return procfs_hw_watchpoint (addr, len, type);
{"^", UNOP_IND, PREC_SUFFIX, 1},
{"@", UNOP_ADDR, PREC_PREFIX, 0},
{"sizeof", UNOP_SIZEOF, PREC_PREFIX, 0},
- {NULL, 0, 0, 0}
+ {NULL, OP_NULL, PREC_PREFIX, 0}
};
\f
enum pascal_primitive_types {
static int
ppc_linux_can_use_hw_breakpoint (struct target_ops *self,
- int type, int cnt, int ot)
+ enum bptype type, int cnt, int ot)
{
int total_hw_wp, total_hw_bp;
gdb_byte gprs[128*16];
};
-static int
+static enum register_status
ppu2spu_unwind_register (void *src, int regnum, gdb_byte *buf)
{
struct ppu2spu_data *data = src;
}
/* Handle the return-value conventions for Decimal Floating Point values. */
-static int
+static enum return_value_convention
get_decimal_float_return_value (struct gdbarch *gdbarch, struct type *valtype,
struct regcache *regcache, gdb_byte *readbuf,
const gdb_byte *writebuf)
bfd *, int *);
static int procfs_can_use_hw_breakpoint (struct target_ops *self,
- int, int, int);
+ enum bptype, int, int);
static void procfs_info_proc (struct target_ops *, const char *,
enum info_proc_what);
static int
procfs_can_use_hw_breakpoint (struct target_ops *self,
- int type, int cnt, int othertype)
+ enum bptype type,
+ int cnt, int othertype)
{
/* Due to the way that proc_set_watchpoint() is implemented, host
and target pointers must be of the same size. If they are not,
static int
procfs_insert_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond)
{
if (!target_have_steppable_watchpoint
static int
procfs_remove_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len,
+ enum target_hw_bp_type type,
struct expression *cond)
{
return procfs_set_watchpoint (inferior_ptid, addr, 0, 0, 0);
struct partial_symbol **psym;
struct partial_symbol **bound, **gbound, **sbound;
int keep_going = 1;
- int result = PST_SEARCHED_AND_NOT_FOUND;
+ enum psymtab_search_status result = PST_SEARCHED_AND_NOT_FOUND;
int i;
if (ps->searched_flag != PST_NOT_SEARCHED)
static int
m32r_can_use_hw_watchpoint (struct target_ops *self,
- int type, int cnt, int othertype)
+ enum bptype type,
+ int cnt, int othertype)
{
return sdi_desc != NULL && cnt < max_access_breaks;
}
static int
m32r_insert_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len, enum target_hw_bp_type type,
struct expression *cond)
{
int i;
static int
mips_can_use_watchpoint (struct target_ops *self,
- int type, int cnt, int othertype)
+ enum bptype type, int cnt, int othertype)
{
return cnt < MAX_LSI_BREAKPOINTS && strcmp (target_shortname, "lsi") == 0;
}
static int
mips_insert_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len, enum target_hw_bp_type type,
struct expression *cond)
{
- if (mips_set_breakpoint (addr, len, type))
+ /* These enum types are compatible by design. */
+ enum break_type btype = (enum break_type) type;
+
+ if (mips_set_breakpoint (addr, len, btype))
return -1;
return 0;
static int
mips_remove_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len, enum target_hw_bp_type type,
struct expression *cond)
{
- if (mips_clear_breakpoint (addr, len, type))
+ /* These enum types are compatible by design. */
+ enum break_type btype = (enum break_type) type;
+
+ if (mips_clear_breakpoint (addr, len, btype))
return -1;
return 0;
return memory_remove_breakpoint (ops, gdbarch, bp_tgt);
}
-static int
+static enum Z_packet_type
watchpoint_to_Z_packet (int type)
{
switch (type)
}
static int
-remote_insert_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
- struct expression *cond)
+remote_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
+ enum target_hw_bp_type type, struct expression *cond)
{
struct remote_state *rs = get_remote_state ();
char *endbuf = rs->buf + get_remote_packet_size ();
static int
-remote_remove_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
- struct expression *cond)
+remote_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
+ enum target_hw_bp_type type, struct expression *cond)
{
struct remote_state *rs = get_remote_state ();
char *endbuf = rs->buf + get_remote_packet_size ();
static int
remote_check_watch_resources (struct target_ops *self,
- int type, int cnt, int ot)
+ enum bptype type, int cnt, int ot)
{
if (type == bp_hardware_breakpoint)
{
static int
s390_insert_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len, enum target_hw_bp_type type,
struct expression *cond)
{
struct lwp_info *lp;
static int
s390_remove_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
+ CORE_ADDR addr, int len, enum target_hw_bp_type type,
struct expression *cond)
{
struct lwp_info *lp;
static int
s390_can_use_hw_breakpoint (struct target_ops *self,
- int type, int cnt, int othertype)
+ enum bptype type, int cnt, int othertype)
{
return type == bp_hardware_watchpoint;
}
struct tdesc_arch_data *tdesc_data = NULL;
struct gdbarch *gdbarch;
struct gdbarch_tdep *tdep;
- int tdep_abi;
+ enum s390_abi_kind tdep_abi;
enum s390_vector_abi_kind vector_abi;
int have_upper = 0;
int have_linux_v1 = 0;
/* Override the to_can_use_hw_breakpoint routine. */
static int
spu_can_use_hw_breakpoint (struct target_ops *self,
- int type, int cnt, int othertype)
+ enum bptype type, int cnt, int othertype)
{
return 0;
}
target_debug_do_print (host_address_to_string (X))
#define target_debug_print_const_struct_btrace_target_info_p(X) \
target_debug_do_print (host_address_to_string (X))
+#define target_debug_print_enum_target_hw_bp_type(X) \
+ target_debug_do_print (plongest (X))
+#define target_debug_print_enum_bptype(X) \
+ target_debug_do_print (plongest (X))
static void
target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)
}
static int
-delegate_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int arg3)
+delegate_can_use_hw_breakpoint (struct target_ops *self, enum bptype arg1, int arg2, int arg3)
{
self = self->beneath;
return self->to_can_use_hw_breakpoint (self, arg1, arg2, arg3);
}
static int
-tdefault_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int arg3)
+tdefault_can_use_hw_breakpoint (struct target_ops *self, enum bptype arg1, int arg2, int arg3)
{
return 0;
}
static int
-debug_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int arg3)
+debug_can_use_hw_breakpoint (struct target_ops *self, enum bptype arg1, int arg2, int arg3)
{
int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_can_use_hw_breakpoint (...)\n", debug_target.to_shortname);
fprintf_unfiltered (gdb_stdlog, "<- %s->to_can_use_hw_breakpoint (", debug_target.to_shortname);
target_debug_print_struct_target_ops_p (&debug_target);
fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_int (arg1);
+ target_debug_print_enum_bptype (arg1);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_int (arg2);
fputs_unfiltered (", ", gdb_stdlog);
}
static int
-delegate_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+delegate_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
{
self = self->beneath;
return self->to_remove_watchpoint (self, arg1, arg2, arg3, arg4);
}
static int
-tdefault_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+tdefault_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
{
return -1;
}
static int
-debug_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+debug_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
{
int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_remove_watchpoint (...)\n", debug_target.to_shortname);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_int (arg2);
fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_int (arg3);
+ target_debug_print_enum_target_hw_bp_type (arg3);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_struct_expression_p (arg4);
fputs_unfiltered (") = ", gdb_stdlog);
}
static int
-delegate_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+delegate_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
{
self = self->beneath;
return self->to_insert_watchpoint (self, arg1, arg2, arg3, arg4);
}
static int
-tdefault_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+tdefault_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
{
return -1;
}
static int
-debug_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+debug_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum target_hw_bp_type arg3, struct expression *arg4)
{
int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_insert_watchpoint (...)\n", debug_target.to_shortname);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_int (arg2);
fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_int (arg3);
+ target_debug_print_enum_target_hw_bp_type (arg3);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_struct_expression_p (arg4);
fputs_unfiltered (") = ", gdb_stdlog);
struct inferior;
#include "infrun.h" /* For enum exec_direction_kind. */
+#include "breakpoint.h" /* For enum bptype. */
/* This include file defines the interface between the main part
of the debugger, and the part which is target-specific, or
#include "btrace.h"
#include "command.h"
+#include "break-common.h" /* For enum target_hw_bp_type. */
+
enum strata
{
dummy_stratum, /* The lowest of the low */
int (*to_supports_stopped_by_hw_breakpoint) (struct target_ops *)
TARGET_DEFAULT_RETURN (0);
- int (*to_can_use_hw_breakpoint) (struct target_ops *, int, int, int)
+ int (*to_can_use_hw_breakpoint) (struct target_ops *,
+ enum bptype, int, int)
TARGET_DEFAULT_RETURN (0);
int (*to_ranged_break_num_registers) (struct target_ops *)
TARGET_DEFAULT_RETURN (-1);
/* Documentation of what the two routines below are expected to do is
provided with the corresponding target_* macros. */
- int (*to_remove_watchpoint) (struct target_ops *,
- CORE_ADDR, int, int, struct expression *)
+ int (*to_remove_watchpoint) (struct target_ops *, CORE_ADDR, int,
+ enum target_hw_bp_type, struct expression *)
TARGET_DEFAULT_RETURN (-1);
- int (*to_insert_watchpoint) (struct target_ops *,
- CORE_ADDR, int, int, struct expression *)
+ int (*to_insert_watchpoint) (struct target_ops *, CORE_ADDR, int,
+ enum target_hw_bp_type, struct expression *)
TARGET_DEFAULT_RETURN (-1);
int (*to_insert_mask_watchpoint) (struct target_ops *,
status = safe_frame_unwind_memory (next_frame, instbuf_start,
instbuf, instbuf_size);
if (status == 0)
- memory_error (status, next_addr);
+ memory_error (TARGET_XFER_E_IO, next_addr);
}
reverse_frame_valid = 0;
{
int colno;
int width;
- int alignment;
+ enum ui_align alignment;
char *col_name;
char *colhdr;
struct ui_out_hdr *next;
extern void _initialize_ui_out (void);
static void append_header_to_list (struct ui_out *uiout, int width,
- int alignment, const char *col_name,
+ enum ui_align alignment, const char *col_name,
const char *colhdr);
static int get_next_header (struct ui_out *uiout, int *colno, int *width,
- int *alignment, char **colhdr);
+ enum ui_align *alignment, char **colhdr);
static void clear_header_list (struct ui_out *uiout);
static void clear_table (struct ui_out *uiout);
static void verify_field (struct ui_out *uiout, int *fldno, int *width,
- int *align);
+ enum ui_align *align);
/* exported functions (ui_out API) */
{
int fldno;
int width;
- int align;
+ enum ui_align align;
verify_field (uiout, &fldno, &width, &align);
}
{
int fldno;
int width;
- int align;
+ enum ui_align align;
verify_field (uiout, &fldno, &width, &align);
{
int fldno;
int width;
- int align;
+ enum ui_align align;
verify_field (uiout, &fldno, &width, &align);
{
int fldno;
int width;
- int align;
+ enum ui_align align;
verify_field (uiout, &fldno, &width, &align);
{
int fldno;
int width;
- int align;
+ enum ui_align align;
verify_field (uiout, &fldno, &width, &align);
va_list args;
int fldno;
int width;
- int align;
+ enum ui_align align;
/* Will not align, but has to call anyway. */
verify_field (uiout, &fldno, &width, &align);
static void
append_header_to_list (struct ui_out *uiout,
int width,
- int alignment,
+ enum ui_align alignment,
const char *col_name,
const char *colhdr)
{
get_next_header (struct ui_out *uiout,
int *colno,
int *width,
- int *alignment,
+ enum ui_align *alignment,
char **colhdr)
{
/* There may be no headers at all or we may have used all columns. */
available/applicable). */
static void
-verify_field (struct ui_out *uiout, int *fldno, int *width, int *align)
+verify_field (struct ui_out *uiout, int *fldno, int *width,
+ enum ui_align *align)
{
struct ui_out_level *current = current_level (uiout);
char *text;
var->num_children = -1;
var->parent = NULL;
var->children = NULL;
- var->format = 0;
+ var->format = FORMAT_NATURAL;
var->root = NULL;
var->updated = 0;
var->print_value = NULL;
of the type TYPE. Return 0 on success, -1 on failure. */
static int
-x86_insert_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
- struct expression *cond)
+x86_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
+ enum target_hw_bp_type type, struct expression *cond)
{
struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (inferior_ptid));
address ADDR, whose length is LEN bytes, and for accesses of the
type TYPE. Return 0 on success, -1 on failure. */
static int
-x86_remove_watchpoint (struct target_ops *self,
- CORE_ADDR addr, int len, int type,
- struct expression *cond)
+x86_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
+ enum target_hw_bp_type type, struct expression *cond)
{
struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (inferior_ptid));
static int
x86_can_use_hw_breakpoint (struct target_ops *self,
- int type, int cnt, int othertype)
+ enum bptype type, int cnt, int othertype)
{
return 1;
}
.spill_location = -1, \
.spill_size = (spillsz), \
.unused = 0, \
- .call_abi = 0, \
+ .call_abi = CallAbiDefault, \
.debug_interrupt_level = XCHAL_DEBUGLEVEL, \
.icache_line_bytes = XCHAL_ICACHE_LINESIZE, \
.dcache_line_bytes = XCHAL_DCACHE_LINESIZE, \