+
+ * utils.c: (warning) added call to warning_hook
+
+ * source.c: (find_source_lines) modified to call warning in case
+ of source vs. executable time stamp mismatch. Simplified object
+ file check. Initialized mtime to 0.
+
+ * defs.h: added warning_hook prototype
+
+ * top.c: added warning_hook prototype.
+
* config/sparc/tm-sun4os4.h (IS_STATIC_TRANSFORM_NAME): Add missing
* breakpoint.c (breakpoint_re_set_one): Remove Ulrich Drepper's
patch of March 23 1998.
+>>>>>>> 1.4385
* mdebugread.c (parse_partial_symbols): If this is an .mdebug
#include <winuser.h>
#endif
+#include <sys/stat.h>
+
#include <tcl.h>
#include <tk.h>
#include <itcl.h>
static void gdbtk_flush PARAMS ((FILE *));
static void gdbtk_fputs PARAMS ((const char *, FILE *));
static int gdbtk_query PARAMS ((const char *, va_list));
+static void gdbtk_warning PARAMS ((const char *, va_list));
+static void gdbtk_ignorable_warning PARAMS ((const char *, va_list));
static char *gdbtk_readline PARAMS ((char *));
static void gdbtk_init PARAMS ((char *));
static void tk_command_loop PARAMS ((void));
in_fputs = 0;
}
+static void
+gdbtk_warning (warning, args)
+ const char *warning;
+ va_list args;
+{
+ char buf[200], *merge[2];
+ char *command;
+
+ vsprintf (buf, warning, args);
+ merge[0] = "gdbtk_tcl_warning";
+ merge[1] = buf;
+ command = Tcl_Merge (2, merge);
+ Tcl_Eval (interp, command);
+ Tcl_Free (command);
+}
+
+static void
+gdbtk_ignorable_warning (warning, args)
+ const char *warning;
+ va_list args;
+{
+ char buf[200], *merge[2];
+ char *command;
+
+ vsprintf (buf, warning, args);
+ merge[0] = "gdbtk_tcl_ignorable_warning";
+ merge[1] = buf;
+ command = Tcl_Merge (2, merge);
+ Tcl_Eval (interp, command);
+ Tcl_Free (command);
+}
+
static int
gdbtk_query (query, args)
const char *query;
command = Tcl_Merge (2, merge);
Tcl_Eval (interp, command);
Tcl_Free (command);
-
+
val = atol (interp->result);
return val;
}
command_loop_hook = tk_command_loop;
print_frame_info_listing_hook = gdbtk_print_frame_info;
query_hook = gdbtk_query;
+ warning_hook = gdbtk_warning;
flush_hook = gdbtk_flush;
create_breakpoint_hook = gdbtk_create_breakpoint;
delete_breakpoint_hook = gdbtk_delete_breakpoint;
return NULL;
}
+static int
+perror_with_name_wrapper (args)
+ char * args;
+{
+ perror_with_name (args);
+ return 1;
+}
/* gdb_loadfile loads a c source file into a text widget. */
char *ltable;
struct symtab *symtab;
struct linetable_entry *le;
+ long mtime = 0;
+ struct stat st;
+
if (objc != 4)
{
return TCL_ERROR;
}
+ if (fstat (fp->_file, &st) < 0)
+ {
+ catch_errors (perror_with_name_wrapper, "gdbtk: get time stamp", "",
+ RETURN_MASK_ALL);
+ return TCL_ERROR;
+ }
+
+ if (symtab && symtab->objfile && symtab->objfile->obfd)
+ mtime = bfd_get_mtime(symtab->objfile->obfd);
+ else if (exec_bfd)
+ mtime = bfd_get_mtime(exec_bfd);
+
+ if (mtime && mtime < st.st_mtime)
+ gdbtk_ignorable_warning("Source file is more recent than executable.\n", (va_list)0);
+
+
/* Source linenumbers don't appear to be in order, and a sort is */
/* too slow so the fastest solution is just to allocate a huge */
/* array and set the array entry for each linenumber */