#include "annotate.h"
#include "symfile.h" /* for overlay functions */
#include "objfiles.h" /* ditto */
+#include "completer.h" /* for completion functions */
#ifdef UI_OUT
#include "ui-out.h"
#endif
/* Innermost block required by this expression when evaluated */
struct block *block;
/* Status of this display (enabled or disabled) */
- enum enable status;
+ int enabled_p;
};
/* Chain of expressions whose values should be displayed
else if (format != 'f')
val_long = unpack_long (type, valaddr);
+ /* If the value is a pointer, and pointers and addresses are not the
+ same, then at this point, the value's length is TARGET_ADDR_BIT, not
+ TYPE_LENGTH (type). */
+ if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ len = TARGET_ADDR_BIT;
+
/* If we are printing it as unsigned, truncate it in case it is actually
a negative signed value (e.g. "print/u (short)-1" should print 65535
(if shorts are 16 bits) instead of 4294967295). */
case 'f':
if (len == sizeof (float))
- type = builtin_type_float;
+ type = builtin_type_float;
else if (len == sizeof (double))
- type = builtin_type_double;
+ type = builtin_type_double;
print_floating (valaddr, type, stream);
break;
#if defined(TUI)
if (tui_version && *exp == '$')
- display_it = ((TuiStatus) tuiDo (
- (TuiOpaqueFuncPtr) tui_vSetLayoutTo, exp) == TUI_FAILURE);
+ display_it = (tui_set_layout (exp) == TUI_FAILURE);
#endif
if (display_it)
new->next = display_chain;
new->number = ++display_number;
new->format = fmt;
- new->status = enabled;
+ new->enabled_p = 1;
display_chain = new;
if (from_tty && target_has_execution)
{
int within_current_scope;
- if (d->status == disabled)
+ if (d->enabled_p == 0)
return;
if (d->block)
for (d = display_chain; d; d = d->next)
if (d->number == num)
{
- d->status = disabled;
+ d->enabled_p = 0;
return;
}
printf_unfiltered ("No display number %d.\n", num);
for (d = display_chain; d; d = d->next)
{
- printf_filtered ("%d: %c ", d->number, "ny"[(int) d->status]);
+ printf_filtered ("%d: %c ", d->number, "ny"[(int) d->enabled_p]);
if (d->format.size)
printf_filtered ("/%d%c%c ", d->format.count, d->format.size,
d->format.format);
if (p == 0)
{
for (d = display_chain; d; d = d->next)
- d->status = enabled;
+ d->enabled_p = 1;
}
else
while (*p)
for (d = display_chain; d; d = d->next)
if (d->number == num)
{
- d->status = enabled;
+ d->enabled_p = 1;
goto win;
}
printf_unfiltered ("No display number %d.\n", num);
if (p == 0)
{
for (d = display_chain; d; d = d->next)
- d->status = disabled;
+ d->enabled_p = 0;
}
else
while (*p)
if (val)
{
- if (GDB_TARGET_IS_D10V
- && SYMBOL_CLASS (sym) == LOC_REGPARM && TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_PTR)
- TYPE_LENGTH (VALUE_TYPE (val)) = 2;
#ifdef UI_OUT
val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
VALUE_ADDRESS (val),
error ("No function contains program counter for selected frame.\n");
#if defined(TUI)
else if (tui_version)
- low = (CORE_ADDR) tuiDo ((TuiOpaqueFuncPtr) tui_vGetLowDisassemblyAddress,
- (Opaque) low,
- (Opaque) pc);
+ low = tuiGetLowDisassemblyAddress (low, pc);
#endif
low += FUNCTION_START_OFFSET;
}
error ("No function contains specified address.\n");
#if defined(TUI)
else if (tui_version)
- low = (CORE_ADDR) tuiDo ((TuiOpaqueFuncPtr) tui_vGetLowDisassemblyAddress,
- (Opaque) low,
- (Opaque) pc);
+ low = tuiGetLowDisassemblyAddress (low, pc);
#endif
#if 0
if (overlay_debugging)
}
#if defined(TUI)
- if (!tui_version ||
- m_winPtrIsNull (disassemWin) || !disassemWin->generic.isVisible)
+ if (!tui_is_window_visible (DISASSEM_WIN))
#endif
{
printf_filtered ("Dump of assembler code ");
#if defined(TUI)
else
{
- tuiDo ((TuiOpaqueFuncPtr) tui_vAddWinToLayout, DISASSEM_WIN);
- tuiDo ((TuiOpaqueFuncPtr) tui_vUpdateSourceWindowsWithAddr, low);
+ tui_show_assembly (low);
}
#endif
}
TARGET_PRINT_INSN_INFO->mach = TARGET_ARCHITECTURE->mach;
/* else: should set .mach=0 but some disassemblers don't grok this */
+ TARGET_PRINT_INSN_INFO->stream = stream;
+
return TARGET_PRINT_INSN (memaddr, TARGET_PRINT_INSN_INFO);
}
\f
void
_initialize_printcmd (void)
{
+ struct cmd_list_element *c;
+
current_display_number = -1;
add_info ("address", address_info,
Default count is 1. Default address is following last thing printed\n\
with this command or \"print\".", NULL));
- add_com ("disassemble", class_vars, disassemble_command,
- "Disassemble a specified section of memory.\n\
+ c = add_com ("disassemble", class_vars, disassemble_command,
+ "Disassemble a specified section of memory.\n\
Default is the function surrounding the pc of the selected frame.\n\
With a single argument, the function surrounding that address is dumped.\n\
Two arguments are taken as a range of memory to dump.");
+ c->completer = location_completer;
if (xdb_commands)
add_com_alias ("va", "disassemble", class_xdb, 0);
You can see these environment settings with the \"show\" command.", NULL));
/* "call" is the same as "set", but handy for dbx users to call fns. */
- add_com ("call", class_vars, call_command,
- "Call a function in the program.\n\
+ c = add_com ("call", class_vars, call_command,
+ "Call a function in the program.\n\
The argument is the function name and arguments, in the notation of the\n\
current working language. The result is printed and saved in the value\n\
history, if it is not void.");
+ c->completer = location_completer;
add_cmd ("variable", class_vars, set_command,
"Evaluate expression EXP and assign result to variable VAR, using assignment\n\
This may usually be abbreviated to simply \"set\".",
&setlist);
- add_com ("print", class_vars, print_command,
+ c = add_com ("print", class_vars, print_command,
concat ("Print value of expression EXP.\n\
Variables accessible are those of the lexical environment of the selected\n\
stack frame, plus all those whose scope is global or an entire file.\n\
"\n\
EXP may be preceded with /FMT, where FMT is a format letter\n\
but no count or size letter (see \"x\" command).", NULL));
+ c->completer = location_completer;
add_com_alias ("p", "print", class_vars, 1);
- add_com ("inspect", class_vars, inspect_command,
+ c = add_com ("inspect", class_vars, inspect_command,
"Same as \"print\" command, except that if you are running in the epoch\n\
environment, the value is printed in its own window.");
+ c->completer = location_completer;
add_show_from_set (
add_set_cmd ("max-symbolic-offset", no_class, var_uinteger,