extern void set_breakpoint_count (int);
extern int breakpoint_count;
+/* This variable determines where memory used for disassembly is read from.
+ * See note in gdbtk.h for details.
+ */
+int disassemble_from_exec = -1;
+
/*
* Declarations for routines exported from this file
Tcl_LinkVar (interp, "gdb_context_id",
(char *) &gdb_context,
TCL_LINK_INT | TCL_LINK_READ_ONLY);
+
+ /* Determine where to disassemble from */
+ Tcl_LinkVar (gdbtk_interp, "disassemble-from-exec", (char *) &disassemble_from_exec,
+ TCL_LINK_INT);
Tcl_PkgProvide(interp, "Gdbtk", GDBTK_VERSION);
return TCL_OK;
* the Tcl result.
*/
- val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
+ val_print (VALUE_TYPE (val), VALUE_CONTENTS (val),
+ VALUE_EMBEDDED_OFFSET(val), VALUE_ADDRESS (val),
gdb_stdout, 0, 0, 0, 0);
do_cleanups (old_chain);
int objc;
Tcl_Obj *CONST objv[];
{
-
+ int from_tty = 0;
+
if (objc < 2)
{
Tcl_SetStringObj (result_ptr->obj_ptr, "wrong # args", -1);
return TCL_ERROR;
}
+ if (objc == 3)
+ {
+ if (Tcl_GetBooleanFromObj (NULL, objv[2], &from_tty) != TCL_OK) {
+ Tcl_SetStringObj (result_ptr->obj_ptr, "from_tty must be a boolean.",
+ -1);
+ return TCL_ERROR;
+ }
+ }
+
if (running_now || load_in_progress)
return TCL_OK;
load_in_progress = 1;
}
- execute_command (Tcl_GetStringFromObj (objv[1], NULL), 1);
+ execute_command (Tcl_GetStringFromObj (objv[1], NULL), from_tty);
if (load_in_progress)
{
if (static_only && p->block != STATIC_BLOCK)
continue;
- elem = Tcl_NewListObj (0, NULL);
+ /* Strip off some C++ special symbols, like RTTI and global
+ constructors/destructors. */
+ if ((p->symbol != NULL && !STREQN (SYMBOL_NAME (p->symbol), "__tf", 4)
+ && !STREQN (SYMBOL_NAME (p->symbol), "_GLOBAL_", 8))
+ || p->msymbol != NULL)
+ {
+ elem = Tcl_NewListObj (0, NULL);
- if (p->msymbol == NULL)
- Tcl_ListObjAppendElement (interp, elem,
- Tcl_NewStringObj (SYMBOL_SOURCE_NAME (p->symbol), -1));
- else
- Tcl_ListObjAppendElement (interp, elem,
- Tcl_NewStringObj (SYMBOL_SOURCE_NAME (p->msymbol), -1));
+ if (p->msymbol == NULL)
+ Tcl_ListObjAppendElement (interp, elem,
+ Tcl_NewStringObj (SYMBOL_SOURCE_NAME (p->symbol), -1));
+ else
+ Tcl_ListObjAppendElement (interp, elem,
+ Tcl_NewStringObj (SYMBOL_SOURCE_NAME (p->msymbol), -1));
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, elem);
+ Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, elem);
+ }
}
if (ss != NULL)
int regnum;
/* Note that the test for a valid register must include checking the
- reg_names array because NUM_REGS may be allocated for the union of the
- register sets within a family of related processors. In this case, the
- trailing entries of reg_names will change depending upon the particular
- processor being debugged. */
+ REGISTER_NAME because NUM_REGS may be allocated for the union of
+ the register sets within a family of related processors. In this
+ case, some entries of REGISTER_NAME will change depending upon
+ the particular processor being debugged. */
if (objc == 0) /* No args, just do all the regs */
{
for (regnum = 0;
regnum < NUM_REGS
- && reg_names[regnum] != NULL
- && *reg_names[regnum] != '\000';
+ && REGISTER_NAME (regnum) != NULL
+ && *REGISTER_NAME (regnum) != '\000';
regnum++)
func (regnum, argp);
if (regnum >= 0
&& regnum < NUM_REGS
- && reg_names[regnum] != NULL
- && *reg_names[regnum] != '\000')
+ && REGISTER_NAME (regnum) != NULL
+ && *REGISTER_NAME (regnum) != '\000')
func (regnum, argp);
else
{
void *argp; /* Ignored */
{
Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (reg_names[regnum], -1));
+ Tcl_NewStringObj (REGISTER_NAME (regnum), -1));
}
/* This implements the tcl command gdb_fetch_registers
char raw_buffer[MAX_REGISTER_RAW_SIZE];
char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
int format = (int)fp;
+ int optim;
if (format == 'N')
format = 0;
- if (read_relative_register_raw_bytes (regnum, raw_buffer))
+ /* read_relative_register_raw_bytes returns a virtual frame pointer
+ (FRAME_FP (selected_frame)) if regnum == FP_REGNUM instead
+ of the real contents of the register. To get around this,
+ use get_saved_register instead. */
+ get_saved_register (raw_buffer, &optim, (CORE_ADDR *) NULL, selected_frame,
+ regnum, (enum lval_type *) NULL);
+ if (optim)
{
Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
Tcl_NewStringObj ("Optimized out", -1));
}
}
else
- val_print (REGISTER_VIRTUAL_TYPE (regnum), virtual_buffer, 0,
+ val_print (REGISTER_VIRTUAL_TYPE (regnum), virtual_buffer, 0, 0,
gdb_stdout, format, 1, 0, Val_pretty_default);
}
di_initialized = 1;
}
- di.mach = tm_print_insn_info.mach;
+ di.mach = TARGET_PRINT_INSN_INFO->mach;
if (TARGET_BYTE_ORDER == BIG_ENDIAN)
di.endian = BFD_ENDIAN_BIG;
else
print_address_numeric (fi->pc, 1, gdb_stdout);
printf_filtered (" in ");
}
- printf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang,
+ fprintf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang,
DMGL_ANSI);
#endif
objv[0] = Tcl_NewStringObj (funname != NULL ? funname : "??", -1);
if (objc != 2)
error ("wrong # args");
-#ifdef WINNT
+#ifdef __CYGWIN__
{
char pathname[256], *ptr;
- cygwin32_conv_to_full_win32_path (Tcl_GetStringFromObj(objv[1], NULL), pathname);
+ cygwin32_conv_to_full_win32_path (Tcl_GetStringFromObj (objv[1], NULL), pathname);
for (ptr = pathname; *ptr; ptr++)
{
if (*ptr == '\\')