diff options
author | Stu Grossman <grossman@cygnus> | 1994-09-16 22:57:37 +0000 |
---|---|---|
committer | Stu Grossman <grossman@cygnus> | 1994-09-16 22:57:37 +0000 |
commit | 637b166117dbbd3df6eedaec2873a45b4d10b3cc (patch) | |
tree | 2bd4a6d9d5e8a31d2b58bbf41a81052b74198074 /gdb/gdbtk.c | |
parent | 2d0546410d0e67caa4b51e755968070389681a44 (diff) | |
download | gdb-637b166117dbbd3df6eedaec2873a45b4d10b3cc.zip gdb-637b166117dbbd3df6eedaec2873a45b4d10b3cc.tar.gz gdb-637b166117dbbd3df6eedaec2873a45b4d10b3cc.tar.bz2 |
* defs.h (QUIT): Call interactive_hook to allow GUI to interrupt.
Also, add decl for symtab_to_filename.
* gdbtk.c: Replace calls to full_filename with symtab_to_filename.
* gdbtk.tcl: New routine pc_to_line replaces in line code. New
routine decr replaces in line code.
* (create_file_win): Use catch to handle open failures more
elegantly. Also, create special window to display file open
failure message. Move opening of file prior to creation of text
widget.
* (create_asm_win): Add PC as argument. We now base disassembly
on PC instead of function name, since function names can be
ambiguous (usually seen with shared libs). Also, use catch to
simplify code where we don't care about failures.
* source.c (symtab_to_filename): New. Returns the file
associated with a symtab.
* top.c: Define interactive_hook. Called during QUIT to animate
the GUI.
Diffstat (limited to 'gdb/gdbtk.c')
-rw-r--r-- | gdb/gdbtk.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c index e3a2ce7..9843b43 100644 --- a/gdb/gdbtk.c +++ b/gdb/gdbtk.c @@ -129,6 +129,7 @@ gdbtk_query (args) return val; } +#if 0 static char * full_filename(symtab) struct symtab *symtab; @@ -163,6 +164,7 @@ full_filename(symtab) return filename; } +#endif static void breakpoint_notify(b, action) @@ -180,7 +182,7 @@ breakpoint_notify(b, action) sal = find_pc_line (b->address, 0); - filename = full_filename (sal.symtab); + filename = symtab_to_filename (sal.symtab); sprintf (bpnum, "%d", b->number); sprintf (line, "%d", sal.line); @@ -200,9 +202,6 @@ breakpoint_notify(b, action) gdbtk_fputs (interp->result); gdbtk_fputs ("\n"); } - - if (filename) - free (filename); } static void @@ -293,7 +292,7 @@ gdb_loc (clientData, interp, argc, argv) find_pc_partial_function (pc, &funcname, NULL, NULL); Tcl_AppendElement (interp, funcname); - filename = full_filename (sal.symtab); + filename = symtab_to_filename (sal.symtab); Tcl_AppendElement (interp, filename); sprintf (buf, "%d", sal.line); @@ -302,9 +301,6 @@ gdb_loc (clientData, interp, argc, argv) sprintf (buf, "0x%x", pc); Tcl_AppendElement (interp, buf); /* PC */ - if (filename) - free(filename); - return TCL_OK; } @@ -396,6 +392,15 @@ cleanup_init (ignored) interp = NULL; } +/* Come here during long calculations to check for GUI events. Usually invoked + via the QUIT macro. */ + +static void +gdbtk_interactive () +{ + /* Tk_DoOneEvent (TK_DONT_WAIT|TK_IDLE_EVENTS); */ +} + static void gdbtk_init () { @@ -445,6 +450,7 @@ gdbtk_init () delete_breakpoint_hook = gdbtk_delete_breakpoint; enable_breakpoint_hook = gdbtk_enable_breakpoint; disable_breakpoint_hook = gdbtk_disable_breakpoint; + interactive_hook = gdbtk_interactive; discard_cleanups (old_chain); |