aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Seitz <keiths@cygnus>1998-01-23 20:54:35 +0000
committerKeith Seitz <keiths@cygnus>1998-01-23 20:54:35 +0000
commit11f91b2bbca1d68abb0f79a6ef6681daf06c4add (patch)
treea2870f7545ad55bdff7ec87303212a52b943bc3e
parent67f3b91e8be7ddb5815b1f49341a9af5c1f98a9f (diff)
downloadgdb-11f91b2bbca1d68abb0f79a6ef6681daf06c4add.zip
gdb-11f91b2bbca1d68abb0f79a6ef6681daf06c4add.tar.gz
gdb-11f91b2bbca1d68abb0f79a6ef6681daf06c4add.tar.bz2
* symfile.c: Define two new hooks for symbol reading: "pre_add_symbol_hook"
and "post_add_symbol_hook". These hooks are called before we begin reading symbols, and after we finish. (generic_load): Use new symbol reading hooks and get rid of compiler warning. * gdbtk.c (gdbtk_init): Add hooks for pre- and post-symbol reading. (gdbtk_pre_add_symbol): New function: the pre-add-symbol hook. (gdbtk_post_add_symbol): New function: the post-add-symbol hook. (find_file_in_dir): New function. Moved the guts of gdb_find_file_command into here to allow its use by others. (gdb_loc): Use find_file_in_dir to return the real path to the file (or "N/A" if we can't find it). * configure.in (TIX_LIB_EXT): Define new variable for those special cases when TCL_SHLIB_SUFFIX is not enough to specify the dependency. * configure: Regenerate.
-rw-r--r--gdb/ChangeLog-gdbtk20
-rwxr-xr-xgdb/configure25
-rw-r--r--gdb/configure.in9
-rw-r--r--gdb/gdbtk.c73
4 files changed, 102 insertions, 25 deletions
diff --git a/gdb/ChangeLog-gdbtk b/gdb/ChangeLog-gdbtk
index 55bdd34..152634d 100644
--- a/gdb/ChangeLog-gdbtk
+++ b/gdb/ChangeLog-gdbtk
@@ -1,3 +1,23 @@
+Wed Jan 22 10:37:02 1998 Keith Seitz <keiths@onions.cygnus.com>
+
+ * symfile.c: Define two new hooks for symbol reading: "pre_add_symbol_hook"
+ and "post_add_symbol_hook". These hooks are called before we begin reading
+ symbols, and after we finish.
+ (generic_load): Use new symbol reading hooks and get rid of compiler warning.
+
+ * gdbtk.c (gdbtk_init): Add hooks for pre- and post-symbol reading.
+ (gdbtk_pre_add_symbol): New function: the pre-add-symbol hook.
+ (gdbtk_post_add_symbol): New function: the post-add-symbol hook.
+ (find_file_in_dir): New function. Moved the guts of gdb_find_file_command
+ into here to allow its use by others.
+ (gdb_loc): Use find_file_in_dir to return the real path to the file
+ (or "N/A" if we can't find it).
+
+ * configure.in (TIX_LIB_EXT): Define new variable for those special cases
+ when TCL_SHLIB_SUFFIX is not enough to specify the dependency.
+
+ * configure: Regenerate.
+
Fri Jan 23 07:47:06 1998 Fred Fish <fnf@cygnus.com>
* Makefile.in (uninstall): Remove installed gdbtcl dir, if one
diff --git a/gdb/configure b/gdb/configure
index 0a2262e..ff655d9 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -3120,9 +3120,18 @@ fi
esac
if test "${TCL_SHARED_BUILD}" = "1"; then
TIX_LIB_EXT="${TCL_SHLIB_SUFFIX}"
+
+ # Can't win them all: SunOS 4 (others?) appends a version
+ # number after the ".so"
+ case "${host}" in
+ *-*-sunos4*)
+ TIX_LIB_EXT="${TIX_LIB_EXT}.1.0" ;;
+ esac
+
else
TIX_LIB_EXT=".a"
fi
+
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
TIXLIB="-L${tixdir} -ltix${TIXVERSION}"
TIX_DEPS="${tixdir}/libtix${TIXVERSION}${TIX_LIB_EXT}"
@@ -3305,7 +3314,7 @@ links="${links} nm.h"
fi
# start-sanitize-gdbtk
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:3309: checking whether ln -s works" >&5
+echo "configure:3318: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3340,19 +3349,19 @@ fi
echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:3344: checking for Cygwin32 environment" >&5
+echo "configure:3353: checking for Cygwin32 environment" >&5
if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3349 "configure"
+#line 3358 "configure"
#include "confdefs.h"
int main() {
return __CYGWIN32__;
; return 0; }
EOF
-if { (eval echo configure:3356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_cygwin32=yes
else
@@ -3369,19 +3378,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
CYGWIN32=
test "$am_cv_cygwin32" = yes && CYGWIN32=yes
echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:3373: checking for Mingw32 environment" >&5
+echo "configure:3382: checking for Mingw32 environment" >&5
if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3378 "configure"
+#line 3387 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:3385: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_mingw32=yes
else
@@ -3400,7 +3409,7 @@ test "$am_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3404: checking for executable suffix" >&5
+echo "configure:3413: checking for executable suffix" >&5
if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
diff --git a/gdb/configure.in b/gdb/configure.in
index 2089f29..2d41cd4 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -361,9 +361,18 @@ if test "${enable_gdbtk}" = "yes"; then
esac
if test "${TCL_SHARED_BUILD}" = "1"; then
TIX_LIB_EXT="${TCL_SHLIB_SUFFIX}"
+
+ # Can't win them all: SunOS 4 (others?) appends a version
+ # number after the ".so"
+ case "${host}" in
+ *-*-sunos4*)
+ TIX_LIB_EXT="${TIX_LIB_EXT}.1.0" ;;
+ esac
+
else
TIX_LIB_EXT=".a"
fi
+
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
TIXLIB="-L${tixdir} -ltix${TIXVERSION}"
TIX_DEPS="${tixdir}/libtix${TIXVERSION}${TIX_LIB_EXT}"
diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c
index c83ed35f..93a3eb3 100644
--- a/gdb/gdbtk.c
+++ b/gdb/gdbtk.c
@@ -88,6 +88,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
int gdbtk_load_hash PARAMS ((char *, unsigned long));
int (*ui_load_progress_hook) PARAMS ((char *, unsigned long));
+void (*pre_add_symbol_hook) PARAMS ((char *));
+void (*post_add_symbol_hook) PARAMS ((void));
static void null_routine PARAMS ((int));
static void gdbtk_flush PARAMS ((FILE *));
@@ -142,10 +144,13 @@ static int gdb_get_tracepoint_info PARAMS ((ClientData, Tcl_Interp *, int, Tcl_O
static int gdb_actions_command PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]));
static int gdb_prompt_command PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]));
static int gdb_find_file_command PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]));
+static char *find_file_in_dir PARAMS ((char *));
static int gdb_get_tracepoint_list PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]));
static void gdbtk_create_tracepoint PARAMS ((struct tracepoint *));
static void gdbtk_delete_tracepoint PARAMS ((struct tracepoint *));
static void tracepoint_notify PARAMS ((struct tracepoint *, const char *));
+void gdbtk_pre_add_symbol PARAMS ((char *));
+void gdbtk_post_add_symbol PARAMS ((void));
/* Handle for TCL interpreter */
@@ -484,7 +489,7 @@ gdb_get_breakpoint_info (clientData, interp, argc, argv)
filename = symtab_to_filename (sal.symtab);
if (filename == NULL)
- filename = "N/A";
+ filename = "";
Tcl_DStringAppendElement (result_ptr, filename);
find_pc_partial_function (b->address, &funcname, NULL, NULL);
Tcl_DStringAppendElement (result_ptr, funcname);
@@ -613,7 +618,9 @@ gdb_loc (clientData, interp, argc, argv)
find_pc_partial_function (pc, &funcname, NULL, NULL);
Tcl_DStringAppendElement (result_ptr, funcname);
+ /* Would it be better to use "find_file_in_dir"? */
filename = symtab_to_filename (sal.symtab);
+
if (filename == NULL)
filename = "N/A";
Tcl_DStringAppendElement (result_ptr, filename);
@@ -1955,6 +1962,8 @@ gdbtk_init ( argv0 )
readline_hook = gdbtk_readline;
readline_end_hook = gdbtk_readline_end;
ui_load_progress_hook = gdbtk_load_hash;
+ pre_add_symbol_hook = gdbtk_pre_add_symbol;
+ post_add_symbol_hook = gdbtk_post_add_symbol;
create_tracepoint_hook = gdbtk_create_tracepoint;
delete_tracepoint_hook = gdbtk_delete_tracepoint;
@@ -2688,7 +2697,6 @@ gdb_find_file_command (clientData, interp, objc, objv)
Tcl_Obj *CONST objv[];
{
char *file, *filename;
- struct symtab *st = NULL;
if (objc != 2)
{
@@ -2698,28 +2706,59 @@ gdb_find_file_command (clientData, interp, objc, objv)
return TCL_ERROR;
}
- /* try something simple first */
file = Tcl_GetStringFromObj (objv[1], NULL);
- if (access (file, R_OK) == 0)
- {
- Tcl_SetObjResult (interp, Tcl_NewStringObj (file, -1));
- return TCL_OK;
- }
+ filename = find_file_in_dir (file);
+
+ if (filename == NULL)
+ Tcl_SetResult (interp, "", TCL_STATIC);
+ else
+ Tcl_SetObjResult (interp, Tcl_NewStringObj (filename, -1));
+
+ return TCL_OK;
+}
+
+static char *
+find_file_in_dir (file)
+ char *file;
+{
+ struct symtab *st = NULL;
- /* We really need a symtab for this to work... */
- st = lookup_symtab (file);
- if (st != NULL)
+ if (file != NULL)
{
- filename = symtab_to_filename (st);
- if (filename != NULL)
+ /* try something simple first */
+ if (access (file, R_OK) == 0)
+ return file;
+
+ /* We really need a symtab for this to work... */
+ st = lookup_symtab (file);
+ if (st != NULL)
{
- Tcl_SetObjResult (interp, Tcl_NewStringObj (filename, -1));
- return TCL_OK;
+ file = symtab_to_filename (st);
+ if (file != NULL)
+ return file;
}
}
+
+ return NULL;
+}
- Tcl_SetResult (interp, "", TCL_STATIC);
- return TCL_OK;
+/* This hook is called whenever we are ready to load a symbol file so that
+ the UI can notify the user... */
+void
+gdbtk_pre_add_symbol (name)
+ char *name;
+{
+ char command[256];
+
+ sprintf (command, "gdbtk_tcl_pre_add_symbol %s", name);
+ Tcl_Eval (interp, command);
+}
+
+/* This hook is called whenever we finish loading a symbol file. */
+void
+gdbtk_post_add_symbol ()
+{
+ Tcl_Eval (interp, "gdbtk_tcl_post_add_symbol");
}
/* Come here during initialize_all_files () */