/* Print values for GNU debugger GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1995
+ Copyright 1986, 87, 88, 89, 90, 91, 93, 94, 95, 1998
Free Software Foundation, Inc.
This file is part of GDB.
int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info *));
disassemble_info tm_print_insn_info;
-/* Functions exported for general use: */
+/* Prototypes for exported functions. */
void output_command PARAMS ((char *, int));
+void _initialize_printcmd PARAMS ((void));
-/* Prototypes for local functions. */
+/* Prototypes for local functions. */
static void delete_display PARAMS ((int));
static int print_insn PARAMS ((CORE_ADDR, GDB_FILE *));
+static void sym_info PARAMS ((char *, int));
+
\f
/* Decode a format specification. *STRING_PTR should point to it.
OFORMAT and OSIZE are used as defaults for the format and size
extern int objectprint;
struct type *type;
expr = parse_expression (exp);
- old_chain = make_cleanup (free_current_contents, &expr);
+ old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+ &expr);
cleanup = 1;
val = evaluate_expression (expr);
}
expr = parse_expression (exp);
- old_chain = make_cleanup (free_current_contents, &expr);
+ old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
val = evaluate_expression (expr);
{
struct expression *expr = parse_expression (exp);
register struct cleanup *old_chain
- = make_cleanup (free_current_contents, &expr);
+ = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
evaluate_expression (expr);
do_cleanups (old_chain);
}
break;
case LOC_REGISTER:
- printf_filtered ("a variable in register %s", reg_names[val]);
+ printf_filtered ("a variable in register %s", REGISTER_NAME (val));
break;
case LOC_STATIC:
break;
case LOC_REGPARM:
- printf_filtered ("an argument in register %s", reg_names[val]);
+ printf_filtered ("an argument in register %s", REGISTER_NAME (val));
break;
case LOC_REGPARM_ADDR:
- printf_filtered ("address of an argument in register %s", reg_names[val]);
+ printf_filtered ("address of an argument in register %s", REGISTER_NAME (val));
break;
case LOC_ARG:
case LOC_BASEREG:
printf_filtered ("a variable at offset %ld from register %s",
- val, reg_names[basereg]);
+ val, REGISTER_NAME (basereg));
break;
case LOC_BASEREG_ARG:
printf_filtered ("an argument at offset %ld from register %s",
- val, reg_names[basereg]);
+ val, REGISTER_NAME (basereg));
break;
case LOC_TYPEDEF:
But don't clobber a user-defined command's definition. */
if (from_tty)
*exp = 0;
- old_chain = make_cleanup (free_current_contents, &expr);
+ old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+ &expr);
val = evaluate_expression (expr);
if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_REF)
val = value_ind (val);
char *arg;
int from_tty;
{
- register char *f;
+ register char *f = NULL;
register char *s = arg;
- char *string;
+ char *string = NULL;
value_ptr *val_args;
char *substrings;
char *current_substring;
struct cleanup *old_cleanups;
val_args = (value_ptr *) xmalloc (allocated_args * sizeof (value_ptr));
- old_cleanups = make_cleanup (free_current_contents, &val_args);
+ old_cleanups = make_cleanup ((make_cleanup_func) free_current_contents,
+ &val_args);
if (s == 0)
error_no_arg ("format-control string and values to print");
char *name;
CORE_ADDR pc, pc_masked;
char *space_index;
- asection *section;
name = NULL;
if (!arg)
CORE_ADDR memaddr;
GDB_FILE *stream;
{
- /* If there's no disassembler, something is very wrong. */
- if (tm_print_insn == NULL)
- abort ();
-
if (TARGET_BYTE_ORDER == BIG_ENDIAN)
- tm_print_insn_info.endian = BFD_ENDIAN_BIG;
+ TARGET_PRINT_INSN_INFO->endian = BFD_ENDIAN_BIG;
else
- tm_print_insn_info.endian = BFD_ENDIAN_LITTLE;
+ TARGET_PRINT_INSN_INFO->endian = BFD_ENDIAN_LITTLE;
- if (target_architecture != NULL)
- tm_print_insn_info.mach = target_architecture->mach;
+ if (TARGET_ARCHITECTURE != NULL)
+ TARGET_PRINT_INSN_INFO->mach = TARGET_ARCHITECTURE->mach;
/* else: should set .mach=0 but some disassemblers don't grok this */
- return (*tm_print_insn) (memaddr, &tm_print_insn_info);
+ return TARGET_PRINT_INSN (memaddr, TARGET_PRINT_INSN_INFO);
}
\f