struct command_line **body_list;
};
-extern struct command_line *read_command_lines PARAMS ((void));
+extern struct command_line *read_command_lines PARAMS ((char *, int));
extern void free_command_lines PARAMS ((struct command_line **));
#ifdef HAVE_LONG_DOUBLE
typedef long double DOUBLEST;
-extern void floatformat_to_long_double PARAMS ((const struct floatformat *,
- char *, DOUBLEST *));
-extern void floatformat_from_long_double PARAMS ((const struct floatformat *,
- DOUBLEST *, char *));
-#define FLOATFORMAT_TO_DOUBLEST floatformat_to_long_double
-#define FLOATFORMAT_FROM_DOUBLEST floatformat_from_long_double
#else
typedef double DOUBLEST;
-#define FLOATFORMAT_TO_DOUBLEST floatformat_to_double
-#define FLOATFORMAT_FROM_DOUBLEST floatformat_from_double
#endif
+extern void floatformat_to_doublest PARAMS ((const struct floatformat *,
+ char *, DOUBLEST *));
+extern void floatformat_from_doublest PARAMS ((const struct floatformat *,
+ DOUBLEST *, char *));
extern DOUBLEST extract_floating PARAMS ((void *, int));
extern void store_floating PARAMS ((void *, int, DOUBLEST));
disassemble_info *info));
extern int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info*));
+extern disassemble_info tm_print_insn_info;
/* Hooks for alternate command interfaces. */
extern void (*print_frame_info_listing_hook) PARAMS ((struct symtab *s,
int line, int stopline,
int noerror));
-extern int (*query_hook) PARAMS (());
+extern int (*query_hook) PARAMS ((const char *, va_list));
extern void (*flush_hook) PARAMS ((FILE *stream));
extern void (*create_breakpoint_hook) PARAMS ((struct breakpoint *b));
extern void (*delete_breakpoint_hook) PARAMS ((struct breakpoint *bpt));
extern void (*target_output_hook) PARAMS ((char *));
extern void (*interactive_hook) PARAMS ((void));
extern void (*registers_changed_hook) PARAMS ((void));
+extern void (*readline_begin_hook) PARAMS ((char *, ...));
+extern char * (*readline_hook) PARAMS ((char *));
+extern void (*readline_end_hook) PARAMS ((void));
extern int (*target_wait_hook) PARAMS ((int pid,
struct target_waitstatus *status));
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "gdb_string.h"
/* Pointer to the target-dependent disassembly function. */
int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info *));
+disassemble_info tm_print_insn_info;
/* Prototypes for local functions. */
register int format;
int size;
{
- int len = TYPE_LENGTH (VALUE_TYPE (val));
+ struct type *type = check_typedef (VALUE_TYPE (val));
+ int len = TYPE_LENGTH (type);
if (VALUE_LVAL (val) == lval_memory)
next_address = VALUE_ADDRESS (val) + len;
default:
if (format == 0
- || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_ARRAY
- || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_STRING
- || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_STRUCT
- || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_UNION
- || VALUE_REPEATED (val))
+ || TYPE_CODE (type) == TYPE_CODE_ARRAY
+ || TYPE_CODE (type) == TYPE_CODE_STRING
+ || TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION)
value_print (val, gdb_stdout, format, Val_pretty_default);
else
- print_scalar_formatted (VALUE_CONTENTS (val), VALUE_TYPE (val),
+ print_scalar_formatted (VALUE_CONTENTS (val), type,
format, size, gdb_stdout);
}
}
GDB_FILE *stream;
{
LONGEST val_long;
- int len = TYPE_LENGTH (type);
+ unsigned int len = TYPE_LENGTH (type);
if (len > sizeof (LONGEST)
&& (format == 't'
|| format == 'd'
|| format == 'x'))
{
- /* We can't print it normally, but we can print it in hex.
- Printing it in the wrong radix is more useful than saying
- "use /x, you dummy". */
- /* FIXME: we could also do octal or binary if that was the
- desired format. */
- /* FIXME: we should be using the size field to give us a minimum
- field width to print. */
- val_print_type_code_int (type, valaddr, stream);
- return;
- }
+ if (! TYPE_UNSIGNED (type)
+ || ! extract_long_unsigned_integer (valaddr, len, &val_long))
+ {
+ /* We can't print it normally, but we can print it in hex.
+ Printing it in the wrong radix is more useful than saying
+ "use /x, you dummy". */
+ /* FIXME: we could also do octal or binary if that was the
+ desired format. */
+ /* FIXME: we should be using the size field to give us a
+ minimum field width to print. */
+ val_print_type_code_int (type, valaddr, stream);
+ return;
+ }
- if (format != 'f')
+ /* If we get here, extract_long_unsigned_integer set val_long. */
+ }
+ else if (format != 'f')
val_long = unpack_long (type, valaddr);
/* If we are printing it as unsigned, truncate it in case it is actually
while (count > 0)
{
+ QUIT;
print_address (next_address, gdb_stdout);
printf_filtered (":");
for (i = maxelts;
gdb_stdout);
break;
+ case LOC_UNRESOLVED:
+ {
+ struct minimal_symbol *msym;
+
+ msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, NULL);
+ if (msym == NULL)
+ printf_filtered ("unresolved");
+ else
+ {
+ printf_filtered ("static storage at address ");
+ print_address_numeric (SYMBOL_VALUE_ADDRESS (msym), 1, gdb_stdout);
+ }
+ }
+ break;
+
case LOC_OPTIMIZED_OUT:
printf_filtered ("optimized out");
break;
case LOC_REF_ARG:
{
long current_offset = SYMBOL_VALUE (sym);
-
arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
/* Compute address of next argument by adding the size of
if (argclass[nargs] == double_arg)
{
- if (TYPE_LENGTH (VALUE_TYPE (val_args[nargs])) == sizeof (float))
+ struct type *type = VALUE_TYPE (val_args[nargs]);
+ if (TYPE_LENGTH (type) == sizeof (float))
VALUE_TYPE (val_args[nargs]) = builtin_type_float;
- if (TYPE_LENGTH (VALUE_TYPE (val_args[nargs])) == sizeof (double))
+ if (TYPE_LENGTH (type) == sizeof (double))
VALUE_TYPE (val_args[nargs]) = builtin_type_double;
}
nargs++;
CORE_ADDR memaddr;
GDB_FILE *stream;
{
- disassemble_info info;
-
-#define GDB_INIT_DISASSEMBLE_INFO(INFO, STREAM) \
- (INFO).fprintf_func = (fprintf_ftype)fprintf_filtered, \
- (INFO).stream = (STREAM), \
- (INFO).read_memory_func = dis_asm_read_memory, \
- (INFO).memory_error_func = dis_asm_memory_error, \
- (INFO).print_address_func = dis_asm_print_address, \
- (INFO).insn_info_valid = 0
-
- GDB_INIT_DISASSEMBLE_INFO(info, stream);
-
/* If there's no disassembler, something is very wrong. */
if (tm_print_insn == NULL)
abort ();
- return (*tm_print_insn) (memaddr, &info);
+ if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ tm_print_insn_info.endian = BFD_ENDIAN_BIG;
+ else
+ tm_print_insn_info.endian = BFD_ENDIAN_LITTLE;
+ return (*tm_print_insn) (memaddr, &tm_print_insn_info);
}
\f
examine_h_type = init_type (TYPE_CODE_INT, 2, 0, "examine_h_type", NULL);
examine_w_type = init_type (TYPE_CODE_INT, 4, 0, "examine_w_type", NULL);
examine_g_type = init_type (TYPE_CODE_INT, 8, 0, "examine_g_type", NULL);
+
+ INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered);
+ tm_print_insn_info.read_memory_func = dis_asm_read_memory;
+ tm_print_insn_info.memory_error_func = dis_asm_memory_error;
+ tm_print_insn_info.print_address_func = dis_asm_print_address;
}