Tcl_Obj *CONST objv[]));
static int gdb_get_tracepoint_info PARAMS ((ClientData, Tcl_Interp *, int,
Tcl_Obj *CONST objv[]));
-static void gdbtk_create_breakpoint PARAMS ((struct breakpoint *));
static int gdbtk_dis_asm_read_memory PARAMS ((bfd_vma, bfd_byte *, int, disassemble_info *));
-static void gdbtk_create_tracepoint PARAMS ((struct tracepoint *));
-static void gdbtk_delete_breakpoint PARAMS ((struct breakpoint *));
-static void gdbtk_delete_tracepoint PARAMS ((struct tracepoint *));
-static void gdbtk_modify_breakpoint PARAMS ((struct breakpoint *));
-static void gdbtk_modify_tracepoint PARAMS ((struct tracepoint *));
-static void gdbtk_print_frame_info PARAMS ((struct symtab *, int, int, int));
-static void gdbtk_readline_end PARAMS ((void));
static int get_pc_register PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []));
char * get_prompt PARAMS ((void));
static void get_register PARAMS ((int, void *));
static void get_register_name PARAMS ((int, void *));
static int map_arg_registers PARAMS ((int, Tcl_Obj *CONST [], void (*) (int, void *), void *));
-static void pc_changed PARAMS ((void));
static int perror_with_name_wrapper PARAMS ((char *args));
static void register_changed_p PARAMS ((int, void *));
void TclDebug PARAMS ((const char *fmt, ...));
{
struct wrapped_call_args wrapped_args;
gdbtk_result new_result, *old_result_ptr;
- int length;
old_result_ptr = result_ptr;
result_ptr = &new_result;
Tcl_Obj *CONST objv[];
{
struct expression *expr;
- struct cleanup *old_chain;
+ struct cleanup *old_chain=NULL;
value_ptr val;
if (objc != 2)
struct cleanup *old_cleanups;
asection *s;
Tcl_Obj *ob[2];
- int i = 0;
char *filename = Tcl_GetStringFromObj (objv[1], NULL);
int objc;
Tcl_Obj *CONST objv[];
{
- Tcl_Obj *result;
struct symtabs_and_lines sals;
char *args, **canonical;
int objc;
Tcl_Obj *CONST objv[];
{
- Tcl_Obj *result;
struct symtabs_and_lines sals;
char *args, **canonical;
struct objfile *objfile;
struct partial_symtab *psymtab;
struct symtab *symtab;
- char *lastfile, *pathname, **files;
+ char *lastfile, *pathname=NULL, **files;
int files_size;
int i, numfiles = 0, len = 0;
- Tcl_Obj *mylist;
files_size = 1000;
files = (char **) xmalloc (sizeof (char *) * files_size);
-
+
if (objc > 2)
{
Tcl_WrongNumArgs (interp, 1, objv, "Usage: gdb_listfiles ?pathname?");
{
struct symbol_search *ss = NULL;
struct symbol_search *p;
- struct cleanup *old_chain;
- Tcl_Obj *list, *result, *CONST *switch_objv;
+ struct cleanup *old_chain = NULL;
+ Tcl_Obj *CONST *switch_objv;
int index, switch_objc, i;
- namespace_enum space;
- char *regexp, *val;
+ namespace_enum space = 0;
+ char *regexp;
int static_only, nfiles;
Tcl_Obj **file_list;
char **files;
struct blockvector *bv;
struct block *b;
struct symbol *sym;
- char buf[128];
int i,j;
Tcl_Obj *funcVals[2];
*/
if (disassemble_from_exec == -1)
- if (strcmp (target_shortname, "child") == 0
- || strcmp (target_shortname, "procfs") == 0
- || strcmp (target_shortname, "vxprocess") == 0)
- disassemble_from_exec = 0; /* It's a child process, read inferior mem */
- else
- disassemble_from_exec = 1; /* It's remote, read the exec file */
+ {
+ if (strcmp (target_shortname, "child") == 0
+ || strcmp (target_shortname, "procfs") == 0
+ || strcmp (target_shortname, "vxprocess") == 0)
+ disassemble_from_exec = 0; /* It's a child process, read inferior mem */
+ else
+ disassemble_from_exec = 1; /* It's remote, read the exec file */
+ }
if (disassemble_from_exec)
di.read_memory_func = gdbtk_dis_asm_read_memory;
Tcl_SetStringObj (result_ptr->obj_ptr, "Ambiguous line spec", -1);
return TCL_ERROR;
}
-
pc = sal.pc;
}
else
CORE_ADDR addr;
int nbytes, rnum, bpr;
long tmp;
- char format, c, *ptr, buff[128], aschar, *mbuf, *mptr, *cptr, *bptr;
+ char format, c, buff[128], aschar, *mbuf, *mptr, *cptr, *bptr;
struct type *val_type;
if (objc < 6 || objc > 7)
int objc;
Tcl_Obj *CONST objv[];
{
- char *file, *widget, *buf, msg[128];
- int linenumbers, ln, anum, lnum, ltable_size;
+ char *file, *widget;
+ int linenumbers, ln, lnum, ltable_size;
FILE *fp;
char *ltable;
struct symtab *symtab;
Tcl_DStringAppend (&cmd, "gdbtk_tcl_breakpoint create ", -1);
sprintf (buf, "%d", b->number);
Tcl_DStringAppendElement(&cmd, buf);
- sprintf (buf, "0x%x", sal.pc);
+ sprintf (buf, "0x%lx", (long)sal.pc);
Tcl_DStringAppendElement (&cmd, buf);
Tcl_DStringAppendElement (&cmd, Tcl_GetStringFromObj (objv[2], NULL));
Tcl_DStringAppendElement (&cmd, Tcl_GetStringFromObj (objv[1], NULL));
extern int Tktable_Init PARAMS ((Tcl_Interp *interp));
-static void null_routine PARAMS ((int));
static void gdbtk_init PARAMS ((char *));
void gdbtk_interactive PARAMS ((void));
static void cleanup_init PARAMS ((int));
static void tk_command PARAMS ((char *, int));
+void gdbtk_add_hooks PARAMS ((void));
int gdbtk_test PARAMS ((char *));
/*
#endif /* ! _WIN32 */
-static void
-null_routine(arg)
- int arg;
-{
-}
-
#ifdef _WIN32
/* On Windows, if we hold a file open, other programs can't write to
}
}
-/* This is called from execute_command, and provides a wrapper around
- various command routines in a place where both protocol messages and
- user input both flow through. Mostly this is used for indicating whether
- the target process is running or not.
-*/
-
-static void
-gdbtk_call_command (cmdblk, arg, from_tty)
- struct cmd_list_element *cmdblk;
- char *arg;
- int from_tty;
-{
- running_now = 0;
- if (cmdblk->class == class_run || cmdblk->class == class_trace)
- {
-
-/* HACK! HACK! This is to get the gui to update the tstart/tstop
- button only incase of tstart/tstop commands issued from the console
- We don't want to update the src window, so we need to have specific
- procedures to do tstart and tstop
- Unfortunately this will not display errors from tstart or tstop in the
- console window itself, but as dialogs.*/
-
- if (!strcmp(cmdblk->name, "tstart") && !No_Update)
- {
- Tcl_Eval (gdbtk_interp, "gdbtk_tcl_tstart");
- (*cmdblk->function.cfunc)(arg, from_tty);
- }
- else if (!strcmp(cmdblk->name, "tstop") && !No_Update)
- {
- Tcl_Eval (gdbtk_interp, "gdbtk_tcl_tstop");
- (*cmdblk->function.cfunc)(arg, from_tty);
- }
-/* end of hack */
- else
- {
- running_now = 1;
- if (!No_Update)
- Tcl_Eval (gdbtk_interp, "gdbtk_tcl_busy");
- (*cmdblk->function.cfunc)(arg, from_tty);
- running_now = 0;
- if (!No_Update)
- Tcl_Eval (gdbtk_interp, "gdbtk_tcl_idle");
- }
- }
- else
- (*cmdblk->function.cfunc)(arg, from_tty);
-}
-
/* gdbtk_init installs this function as a final cleanup. */
static void
{
struct cleanup *old_chain;
char *lib, *gdbtk_lib, *gdbtk_lib_tmp, *gdbtk_file;
- int i, found_main;
+ int found_main;
Tcl_Obj *auto_path_elem, *auto_path_name;
-#ifndef WINNT
- struct sigaction action;
- static sigset_t nullsigmask = {0};
-#endif
+
#ifdef IDE
/* start-sanitize-ide */
struct ide_event_handle *h;
gdbtk_lib = getenv ("GDBTK_LIBRARY");
if (!gdbtk_lib)
- if (access ("gdbtcl/main.tcl", R_OK) == 0)
- gdbtk_lib = "gdbtcl";
- else
- gdbtk_lib = GDBTK_LIBRARY;
-
+ {
+ if (access ("gdbtcl/main.tcl", R_OK) == 0)
+ gdbtk_lib = "gdbtcl";
+ else
+ gdbtk_lib = GDBTK_LIBRARY;
+ }
+
gdbtk_lib_tmp = xstrdup (gdbtk_lib);
found_main = 0;