public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] prep for Tcl/Tk 8.3 upgrade
@ 2001-05-14 17:23 Ian Roxborough
  2001-05-15  3:57 ` Eray Ozkural (exa)
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ian Roxborough @ 2001-05-14 17:23 UTC (permalink / raw)
  To: insight

Hi,

I've been working on getting Insight working with Tcl/Tk 8.3
and here is my first patch on the matter.

More to follow (but I'm trying to make as few changes as possible).

This patch addresses minor C API changes in Tcl.

ChangeLog:

2001-05-14  Ian Roxborough <irox@redhat.com>

	* generic/gdbtk-hooks.c (x_event): Minor
	API changes with Tcl version update.
	Use the Tcl_ObjGetVar2 call with Tcl8.3.
	(gdbtk_trace_find): Use Tcl_GlobalEvalObj
	call with Tcl8.3.

Index: generic/gdbtk-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-hooks.c,v
retrieving revision 1.13
diff -u -r1.13 gdbtk-hooks.c
--- gdbtk-hooks.c	2001/05/10 22:34:54	1.13
+++ gdbtk-hooks.c	2001/05/14 23:49:42
@@ -462,7 +462,7 @@
       int val;
       if (varname == NULL)
 	{
-#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 1
+#if TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION < 1 || TCL_MINOR_VERSION > 2)
 	  Tcl_Obj *varnamestrobj = Tcl_NewStringObj ("download_cancel_ok", -1);
 	  varname = Tcl_ObjGetVar2 (gdbtk_interp, varnamestrobj, NULL, TCL_GLOBAL_ONLY);
 #else
@@ -733,7 +733,7 @@
 			Tcl_NewStringObj ("gdbtk_tcl_trace_find_hook", -1));
   Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewStringObj (arg, -1));
   Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewIntObj (from_tty));
-#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 1
+#if TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION < 1 || TCL_MINOR_VERSION > 2)
   if (Tcl_GlobalEvalObj (gdbtk_interp, cmdObj) != TCL_OK)
     report_error ();
 #else


-- 
What would Jenna Bush do?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] prep for Tcl/Tk 8.3 upgrade
  2001-05-14 17:23 [PATCH] prep for Tcl/Tk 8.3 upgrade Ian Roxborough
@ 2001-05-15  3:57 ` Eray Ozkural (exa)
  2001-05-15  7:42   ` Christopher Faylor
  2001-05-15 12:25 ` Fernando Nasser
       [not found] ` <20010514212318.A17911@redhat.com>
  2 siblings, 1 reply; 9+ messages in thread
From: Eray Ozkural (exa) @ 2001-05-15  3:57 UTC (permalink / raw)
  To: Ian Roxborough; +Cc: insight

Hi Ian,

The debian insight-5.0 package compiles and runs with tcl/tk 8.3
I've made just a few changes as you will notice. Please examine
the patch at

http://http.us.debian.org/debian/pool/main/i/insight/

Those should include changes in C API. I'd be pleased if you'd
consider these changes :)

These are against the 5.0, but should be applicable to development
version.

Thanks,

Ian Roxborough wrote:
> 
> Hi,
> 
> I've been working on getting Insight working with Tcl/Tk 8.3
> and here is my first patch on the matter.
> 
> More to follow (but I'm trying to make as few changes as possible).
> 
> This patch addresses minor C API changes in Tcl.

-- 
Eray Ozkural (exa)
Comp. Sci. Dept., Bilkent University, Ankara
e-mail: erayo@cs.bilkent.edu.tr
www: http://www.cs.bilkent.edu.tr/~erayo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] prep for Tcl/Tk 8.3 upgrade
  2001-05-15  3:57 ` Eray Ozkural (exa)
@ 2001-05-15  7:42   ` Christopher Faylor
  2001-05-15  7:59     ` Fernando Nasser
  0 siblings, 1 reply; 9+ messages in thread
From: Christopher Faylor @ 2001-05-15  7:42 UTC (permalink / raw)
  To: Eray Ozkural (exa); +Cc: Ian Roxborough, insight

On Tue, May 15, 2001 at 01:53:21PM +0300, Eray Ozkural (exa) wrote:
>Hi Ian,
>
>The debian insight-5.0 package compiles and runs with tcl/tk 8.3
>I've made just a few changes as you will notice. Please examine
>the patch at
>
> http://http.us.debian.org/debian/pool/main/i/insight/
>
>Those should include changes in C API. I'd be pleased if you'd
>consider these changes :)
>
>These are against the 5.0, but should be applicable to development
>version.

And you accomodated the cygwin/windows target, right?  Somehow I doubt
that that is a primary concern for debian but I am sure that Ian is
taking Cygwin into consideration.

cgf

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] prep for Tcl/Tk 8.3 upgrade
  2001-05-15  7:42   ` Christopher Faylor
@ 2001-05-15  7:59     ` Fernando Nasser
  0 siblings, 0 replies; 9+ messages in thread
From: Fernando Nasser @ 2001-05-15  7:59 UTC (permalink / raw)
  To: Christopher Faylor; +Cc: Eray Ozkural (exa), Ian Roxborough, insight

Christopher Faylor wrote:
> 
> On Tue, May 15, 2001 at 01:53:21PM +0300, Eray Ozkural (exa) wrote:
> >Hi Ian,
> >
> >The debian insight-5.0 package compiles and runs with tcl/tk 8.3
> >I've made just a few changes as you will notice. Please examine
> >the patch at
> >
> > http://http.us.debian.org/debian/pool/main/i/insight/
> >
> >Those should include changes in C API. I'd be pleased if you'd
> >consider these changes :)
> >
> >These are against the 5.0, but should be applicable to development
> >version.
> 
> And you accomodated the cygwin/windows target, right?  Somehow I doubt
> that that is a primary concern for debian but I am sure that Ian is
> taking Cygwin into consideration.
> 

We may need an assignment form as well.  But Eray can help looking at
the Ian's patches and maybe pointing out areas that we have missed.



-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] prep for Tcl/Tk 8.3 upgrade
  2001-05-14 17:23 [PATCH] prep for Tcl/Tk 8.3 upgrade Ian Roxborough
  2001-05-15  3:57 ` Eray Ozkural (exa)
@ 2001-05-15 12:25 ` Fernando Nasser
  2001-05-16  6:08   ` Andrew Cagney
       [not found] ` <20010514212318.A17911@redhat.com>
  2 siblings, 1 reply; 9+ messages in thread
From: Fernando Nasser @ 2001-05-15 12:25 UTC (permalink / raw)
  To: Ian Roxborough
  Cc: insight, gdb, Michael Snyder, Eli Zaretskii, Elena Zannoni,
	Jim Blandy, Chris Faylor, Kevin Buettner

Ian Roxborough wrote:
> 
> Hi,
> 
> I've been working on getting Insight working with Tcl/Tk 8.3
> and here is my first patch on the matter.
> 
> More to follow (but I'm trying to make as few changes as possible).
> 
> This patch addresses minor C API changes in Tcl.
> 

Whatever you say Ian.

We must ask Andrew to add you to the write after approval list (at least
for gdbtk files) or this will be a nightmare (one of us will have to
check in all of your patches, one by one).

Andrew, can we add Ian (one of the Source Navigator maintainers) to our
list of write after approval?

Thanks,
Fernando



> ChangeLog:
> 
> 2001-05-14  Ian Roxborough <irox@redhat.com>
> 
>         * generic/gdbtk-hooks.c (x_event): Minor
>         API changes with Tcl version update.
>         Use the Tcl_ObjGetVar2 call with Tcl8.3.
>         (gdbtk_trace_find): Use Tcl_GlobalEvalObj
>         call with Tcl8.3.
> 
> Index: generic/gdbtk-hooks.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-hooks.c,v
> retrieving revision 1.13
> diff -u -r1.13 gdbtk-hooks.c
> --- gdbtk-hooks.c       2001/05/10 22:34:54     1.13
> +++ gdbtk-hooks.c       2001/05/14 23:49:42
> @@ -462,7 +462,7 @@
>        int val;
>        if (varname == NULL)
>         {
> -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 1
> +#if TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION < 1 || TCL_MINOR_VERSION > 2)
>           Tcl_Obj *varnamestrobj = Tcl_NewStringObj ("download_cancel_ok", -1);
>           varname = Tcl_ObjGetVar2 (gdbtk_interp, varnamestrobj, NULL, TCL_GLOBAL_ONLY);
>  #else
> @@ -733,7 +733,7 @@
>                         Tcl_NewStringObj ("gdbtk_tcl_trace_find_hook", -1));
>    Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewStringObj (arg, -1));
>    Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewIntObj (from_tty));
> -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 1
> +#if TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION < 1 || TCL_MINOR_VERSION > 2)
>    if (Tcl_GlobalEvalObj (gdbtk_interp, cmdObj) != TCL_OK)
>      report_error ();
>  #else
> 
> --
> What would Jenna Bush do?

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] prep for Tcl/Tk 8.3 upgrade
  2001-05-15 12:25 ` Fernando Nasser
@ 2001-05-16  6:08   ` Andrew Cagney
  2001-05-16  7:14     ` Keith Seitz
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Cagney @ 2001-05-16  6:08 UTC (permalink / raw)
  To: Fernando Nasser
  Cc: Ian Roxborough, insight, gdb, Michael Snyder, Eli Zaretskii,
	Elena Zannoni, Jim Blandy, Chris Faylor, Kevin Buettner

> We must ask Andrew to add you to the write after approval list (at least
> for gdbtk files) or this will be a nightmare (one of us will have to
> check in all of your patches, one by one).
> 
> Andrew, can we add Ian (one of the Source Navigator maintainers) to our
> list of write after approval?


To be added to the GDB maintainers file, Ian would need to post a 
reasonable patch for GDB to the GDB list.

There was a proposal to create an Insight maintainers file co-ordinated 
by the Insight maintainers.  Right now things are a little wierd.  I'm 
not responsible for Insight but that isn't clear since Insight is listed 
in the GDB MAINTAINERS file.

	Andrew


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] prep for Tcl/Tk 8.3 upgrade
  2001-05-16  6:08   ` Andrew Cagney
@ 2001-05-16  7:14     ` Keith Seitz
  2001-05-16 15:55       ` Fernando Nasser
  0 siblings, 1 reply; 9+ messages in thread
From: Keith Seitz @ 2001-05-16  7:14 UTC (permalink / raw)
  To: Andrew Cagney
  Cc: Fernando Nasser, Ian Roxborough, insight, gdb, Michael Snyder,
	Eli Zaretskii, Elena Zannoni, Jim Blandy, Chris Faylor,
	Kevin Buettner

On Wed, 16 May 2001, Andrew Cagney wrote:

> There was a proposal to create an Insight maintainers file co-ordinated
> by the Insight maintainers.  Right now things are a little wierd.  I'm
> not responsible for Insight but that isn't clear since Insight is listed
> in the GDB MAINTAINERS file.

Yes, I was working on this at one time (and forgot all about it). If it is
agreeable to everyone else, I will remove most of the Insight/gdbtk
references in gdb/MAINTAINERS and move them to gdb/gdbtk/MAINTAINERS.

The idea was to largely keep the same policies. Everyone with write
authority in gdb would automatically have write-after-approval in gdbtk.

Let me know.
Keith


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] prep for Tcl/Tk 8.3 upgrade
  2001-05-16  7:14     ` Keith Seitz
@ 2001-05-16 15:55       ` Fernando Nasser
  0 siblings, 0 replies; 9+ messages in thread
From: Fernando Nasser @ 2001-05-16 15:55 UTC (permalink / raw)
  To: Keith Seitz
  Cc: Andrew Cagney, Fernando Nasser, Ian Roxborough, insight, gdb,
	Michael Snyder, Eli Zaretskii, Elena Zannoni, Jim Blandy,
	Chris Faylor, Kevin Buettner

Keith Seitz wrote:
> 
> On Wed, 16 May 2001, Andrew Cagney wrote:
> 
> > There was a proposal to create an Insight maintainers file co-ordinated
> > by the Insight maintainers.  Right now things are a little wierd.  I'm
> > not responsible for Insight but that isn't clear since Insight is listed
> > in the GDB MAINTAINERS file.
> 
> Yes, I was working on this at one time (and forgot all about it). If it is
> agreeable to everyone else, I will remove most of the Insight/gdbtk
> references in gdb/MAINTAINERS and move them to gdb/gdbtk/MAINTAINERS.
> 
> The idea was to largely keep the same policies. Everyone with write
> authority in gdb would automatically have write-after-approval in gdbtk.
> 
> Let me know.
> Keith

I agree.


-- 
Fernando Nasser
Red Hat Canada Ltd.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] Tcl/Tk8.3 upgrade
       [not found] ` <20010514212318.A17911@redhat.com>
@ 2001-06-20 16:37   ` Ian Roxborough
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Roxborough @ 2001-06-20 16:37 UTC (permalink / raw)
  To: insight

Hi,

so this is my main patch for Insight.

This is aimed at removing Insights depenacies on
Cygnus local changes to Tcl/Tk.

I didn't change the package name to Insight, I
made the changes required but it kept giving
me an error message (can't find Insight package)
so I left that out. Probably a job for somebody
who knows more about Insight than I.

The patch will work fine on current Tcl (hey, you
could even start removing local hacks there if
you wanted to) and Tcl8.3 (hopefully Tcl8.4 as well).

The last patch I sent in didn't get applied so it's
rolled into this one.

Please test this patch and let me know of any problems,
question or changes needed.  Once applied you won't
notice the Tcl/Tk upgrade happen.

Thanks,

   Ian.


Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.1366
diff -u -r1.1366 ChangeLog
--- ChangeLog	2001/06/19 20:30:10	1.1366
+++ ChangeLog	2001/06/20 22:57:49
@@ -1,3 +1,8 @@
+2001-06-19  Ian Roxborough  <irox@redhat.com>
+
+	* Makefile.in: Changed all references to the install directory
+	"gdbtcl" to read "insight1.0".
+
 2001-06-19  Andrew Cagney  <ac131313@redhat.com>
 
 	* cli-out.c: Include "gdb_assert.h'.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.90
diff -u -r1.90 Makefile.in
--- Makefile.in	2001/06/10 00:47:02	1.90
+++ Makefile.in	2001/06/20 22:57:56
@@ -772,7 +772,7 @@
 		  true ; \
 		fi ; \
 		rm -f $(bindir)/$$transformed_name$(EXEEXT) $(man1dir)/$$transformed_name.1
-	rm -rf $(datadir)/gdbtcl
+	rm -rf $(datadir)/insight1.0
 	@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do 
 
 # We do this by grepping through sources.  If that turns out to be too slow,
@@ -1361,35 +1361,35 @@
 # It should now be possible to run GDBtk from the build directory
 # without the link in place.
 all-gdbtk:
-	@if test ! -d gdbtcl/images ; then \
+	@if test ! -d insight1.0/images ; then \
 	  if test "$(LN_S)" = "ln -s" ; then \
-	    echo linking ${srcdir}/gdbtk/library to gdbtcl ; \
-	    rm -f gdbtcl ; \
-	    test ! -r gdbtcl || exit 1 ; \
-	    $(LN_S) ${srcdir}/gdbtk/library gdbtcl ; \
+	    echo linking ${srcdir}/gdbtk/library to insight1.0 ; \
+	    rm -f insight1.0 ; \
+	    test ! -r insight1.0 || exit 1 ; \
+	    $(LN_S) ${srcdir}/gdbtk/library insight1.0 ; \
 	  else \
 	    echo "Warning:" ; \
-	    echo "Unable to link ${srcdir}/gdbtk/library to gdbtcl." ; \
+	    echo "Unable to link ${srcdir}/gdbtk/library to insight1.0." ; \
 	    echo "You will need to do a \`make install' before you are" ; \
 	    echo "able to run the GUI." ; \
 	  fi ; \
 	else true ; fi
 
 clean-gdbtk:
-	rm -f gdbtcl
+	rm -f insight1.0
 
 install-gdbtk:
-	$(SHELL) $(srcdir)/../mkinstalldirs $(datadir)/gdbtcl ; \
+	$(SHELL) $(srcdir)/../mkinstalldirs $(datadir)/insight1.0 ; \
 	$(SHELL) $(srcdir)/../mkinstalldirs \
-		$(datadir)/gdbtcl/images \
-		$(datadir)/gdbtcl/images2 ; \
-	$(SHELL) $(srcdir)/../mkinstalldirs $(datadir)/gdbtcl/help \
-		$(datadir)/gdbtcl/help/images \
-		$(datadir)/gdbtcl/help/trace ; \
+		$(datadir)/insight1.0/images \
+		$(datadir)/insight1.0/images2 ; \
+	$(SHELL) $(srcdir)/../mkinstalldirs $(datadir)/insight1.0/help \
+		$(datadir)/insight1.0/help/images \
+		$(datadir)/insight1.0/help/trace ; \
 	cd $(srcdir)/gdbtk/library ; \
 	for i in *.tcl *.itcl *.ith *.itb images/*.gif images2/*.gif images/icons.txt images2/icons.txt tclIndex help/*.html  help/trace/*.html help/trace/index.toc help/images/*.gif; \
 	  do \
-		$(INSTALL_DATA) $$i $(datadir)/gdbtcl/$$i ; \
+		$(INSTALL_DATA) $$i $(datadir)/insight1.0/$$i ; \
 	  done ;
 
 gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
@@ -1403,7 +1403,7 @@
 	$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
         $(ITK_CFLAGS) $(TIX_CFLAGS) \
 	$(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
-		$(srcdir)/gdbtk/generic/gdbtk.c -DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\"
+		$(srcdir)/gdbtk/generic/gdbtk.c -DGDBTK_LIBRARY=\"$(datadir)/insight1.0\"
 
 gdbtk-bp.o: $(srcdir)/gdbtk/generic/gdbtk-bp.c \
 	$(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
@@ -1411,7 +1411,7 @@
 	$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
 	$(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS)   \
 	$(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-bp.c \
-	-DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\"
+	-DGDBTK_LIBRARY=\"$(datadir)/insight1.0\"
 
 gdbtk-cmds.o: $(srcdir)/gdbtk/generic/gdbtk-cmds.c \
 	$(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
@@ -1421,7 +1421,7 @@
 	$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS)	\
 	$(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS)		\
 	$(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-cmds.c		\
-	-DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\"
+	-DGDBTK_LIBRARY=\"$(datadir)/insight1.0\"
 
 gdbtk-hooks.o: $(srcdir)/gdbtk/generic/gdbtk-hooks.c \
 	$(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \
@@ -1429,7 +1429,7 @@
 	$(bfd_h) $(symfile_h) objfiles.h $(target_h) $(gdb_string_h) $(tracepoint_h)
 	$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \
 	$(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
-		$(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\"
+		$(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(datadir)/insight1.0\"
 
 gdbtk-register.o: $(srcdir)/gdbtk/generic/gdbtk-register.c \
 	$(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
@@ -1437,7 +1437,7 @@
 	$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
 	$(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS)   \
 	$(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-register.c \
-	-DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\"
+	-DGDBTK_LIBRARY=\"$(datadir)/insight1.0\"
 
 gdbtk-stack.o: $(srcdir)/gdbtk/generic/gdbtk-stack.c \
 	$(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
@@ -1447,7 +1447,7 @@
 	$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
 	$(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS)   \
 	$(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-stack.c \
-	-DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\"
+	-DGDBTK_LIBRARY=\"$(datadir)/insight1.0\"
 
 gdbtk-varobj.o: $(srcdir)/gdbtk/generic/gdbtk-varobj.c \
 	$(srcdir)/gdbtk/generic/gdbtk.h \
Index: gdbtk/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/ChangeLog,v
retrieving revision 1.100
diff -u -r1.100 ChangeLog
--- ChangeLog	2001/06/18 17:13:26	1.100
+++ ChangeLog	2001/06/20 22:58:03
@@ -1,3 +1,19 @@
+2001-06-18  Ian Roxborough  <irox@redhat.com>
+
+	* generic/gdbtk.c (gdbtk_init): If Insight isn't
+	being ran from inside a directory called "bin",
+	assume that we are being ran from the build
+	directory and set the *_LIBRARY variables to point
+	to (hopefully) the correct source directory.
+
+2001-05-14  Ian Roxborough  <irox@redhat.com>
+
+	* generic/gdbtk-hooks.c (x_event): Minor
+	API changes with Tcl version update.
+	Use the Tcl_ObjGetVar2 call with Tcl8.3.
+	(gdbtk_trace_find): Use Tcl_GlobalEvalObj
+	call with Tcl8.3.
+
 2001-06-18  Keith Seitz  <keiths@redhat.com>
 
 	* library/managedwin.itb (_create): When creating a
Index: gdbtk/generic/gdbtk-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-hooks.c,v
retrieving revision 1.16
diff -u -r1.16 gdbtk-hooks.c
--- gdbtk-hooks.c	2001/06/13 20:01:42	1.16
+++ gdbtk-hooks.c	2001/06/20 22:58:04
@@ -460,7 +460,7 @@
       int val;
       if (varname == NULL)
 	{
-#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 1
+#if TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION < 1 || TCL_MINOR_VERSION > 2)
 	  Tcl_Obj *varnamestrobj = Tcl_NewStringObj ("download_cancel_ok", -1);
 	  varname = Tcl_ObjGetVar2 (gdbtk_interp, varnamestrobj, NULL, TCL_GLOBAL_ONLY);
 #else
@@ -731,7 +731,7 @@
 			Tcl_NewStringObj ("gdbtk_tcl_trace_find_hook", -1));
   Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewStringObj (arg, -1));
   Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewIntObj (from_tty));
-#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 1
+#if TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION < 1 || TCL_MINOR_VERSION > 2)
   if (Tcl_GlobalEvalObj (gdbtk_interp, cmdObj) != TCL_OK)
     report_error ();
 #else
Index: gdbtk/generic/gdbtk.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk.c,v
retrieving revision 1.15
diff -u -r1.15 gdbtk.c
--- gdbtk.c	2001/06/07 14:43:01	1.15
+++ gdbtk.c	2001/06/20 22:58:06
@@ -365,6 +365,9 @@
 {
   struct cleanup *old_chain;
   char *s;
+  int element_count;
+  char **exec_path;
+  CONST char *internal_exec_name;
 
   /* If there is no DISPLAY environment variable, Tk_Init below will fail,
      causing gdb to abort.  If instead we simply return here, gdb will
@@ -388,6 +391,87 @@
   if (!gdbtk_interp)
     error ("Tcl_CreateInterp failed");
 
+  /* We need to check if we are being ran from
+     a bin directory, if not then we may have to
+     set some environment variables. */
+
+  internal_exec_name = Tcl_GetNameOfExecutable ();
+
+  Tcl_SplitPath (internal_exec_name, &element_count, &exec_path);
+
+  if (strcmp (exec_path[element_count - 2],"bin") != 0)
+    {
+      /* We check to see if TCL_LIBRARY, TK_LIBRARY,
+	 ITCL_LIBRARY, ITK_LIBRARY, TIX_LIBRARY and maybe
+	 a couple other environment variables have been
+	 set (we don't want to override the User's settings).
+         If the *_LIBRARY variable is not set, point it at
+         the source directory. */
+
+      static char set_libs_path_script[] = "\
+          set srcDir [file dirname [file dirname $env(TCL_LIBRARY)]];\n\
+\
+          if {![info exists env(TCL_LIBRARY)]} {\n\
+              set env(TCL_LIBRARY) [file join $srcDir tcl library]\n\
+          }\n\
+\
+          if {![info exists env(TK_LIBRARY)]} {\n\
+              set env(TK_LIBRARY) [file join $srcDir tk library]\n\
+          }\n\
+\
+          if {![info exists env(ITCL_LIBRARY)]} {\n\
+              set env(ITCL_LIBRARY) [file join $srcDir itcl itcl library]\n\
+          }\n\
+\
+          if {![info exists env(ITK_LIBRARY)]} {\n\
+              set env(ITK_LIBRARY) [file join $srcDir itcl itk library]\n\
+          }\n\
+\
+          if {![info exists env(TIX_LIBRARY)]} {\n\
+              set env(TIX_LIBRARY) [file join $srcDir tix library]\n\
+          }\n\
+\
+          if {![info exists env(GDBTK_LIBRARY)]} {\n\
+              set env(GDBTK_LIBRARY) [file join $srcDir gdb gdbtk library]\n\
+          }\n";
+
+      Tcl_Obj *commandObj;
+
+
+      /* Before we can run our script we must set TCL_LIBRARY. */
+      if (Tcl_GetVar2 (gdbtk_interp, "env", "TCL_LIBRARY", TCL_GLOBAL_ONLY) == NULL)
+        {
+          Tcl_DString lib_pathDString;
+          static char *tcl_src_dir[] = {"src", "tcl", "library"};
+          char *lib_path;
+
+          Tcl_DStringInit (&lib_pathDString);
+
+          /* Remove the build/gdb/gdb part of the path
+	     and add the src/tcl/library part. */
+
+          exec_path[element_count - 3] = tcl_src_dir[0];
+          exec_path[element_count - 2] = tcl_src_dir[1];
+          exec_path[element_count - 1] = tcl_src_dir[2];
+
+          Tcl_JoinPath (element_count, exec_path, &lib_pathDString);
+
+	  lib_path = xmalloc(Tcl_DStringLength (&lib_pathDString) + 1);
+	  strcpy(lib_path, Tcl_DStringValue (&lib_pathDString));
+	  Tcl_DStringFree (&lib_pathDString);
+
+	  Tcl_SetVar2 (gdbtk_interp, "env", "TCL_LIBRARY", lib_path, TCL_GLOBAL_ONLY);
+          xfree (lib_path);
+	}
+
+      commandObj = Tcl_NewStringObj (set_libs_path_script, -1);
+      Tcl_IncrRefCount (commandObj);
+      Tcl_EvalObj (gdbtk_interp, commandObj);
+      Tcl_DecrRefCount (commandObj);
+    }
+
+  Tcl_Free (exec_path);
+
   if (Tcl_Init (gdbtk_interp) != TCL_OK)
     error ("Tcl_Init failed: %s", gdbtk_interp->result);
 
@@ -467,7 +551,7 @@
       error ("Gdbtk_Init failed: %s", gdbtk_interp->result);
     }
 
-  Tcl_StaticPackage (gdbtk_interp, "Gdbtk", Gdbtk_Init, NULL);
+  Tcl_StaticPackage (gdbtk_interp, "Insight", Gdbtk_Init, NULL);
 
   /* This adds all the hooks that call up from the bowels of gdb
    *  back into Tcl-land...
@@ -511,7 +595,7 @@
 proc gdbtk_find_main {} {\n\
     global Paths GDBTK_LIBRARY\n\
     rename gdbtk_find_main {}\n\
-    tcl_findLibrary gdb 1.0 {} main.tcl GDBTK_LIBRARY GDBTK_LIBRARY gdbtk/library gdbtcl {}\n\
+    tcl_findLibrary insight 1.0 {} main.tcl GDBTK_LIBRARY GDBTKLIBRARY\n\
     set Paths(appdir) $GDBTK_LIBRARY\n\
 }\n\
 gdbtk_find_main";
@@ -527,7 +611,7 @@
     } else {\n\
         set debug_startup 0\n\
     }\n\
-    tcl_findLibrary gdb 1.0 {} main.tcl GDBTK_LIBRARY GDBTK_LIBRARY gdbtk/library gdbtcl {} $debug_startup\n\
+    tcl_findLibrary insight 1.0 {} main.tcl GDBTK_LIBRARY GDBTK_LIBRARY\n\
     set Paths(appdir) $GDBTK_LIBRARY\n\
 }\n\
 gdbtk_find_main";
Index: testsuite/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v
retrieving revision 1.129
diff -u -r1.129 ChangeLog
--- ChangeLog	2001/06/14 00:12:31	1.129
+++ ChangeLog	2001/06/20 22:58:29
@@ -1,3 +1,8 @@
+2001-06-18  Ian Roxborough  <irox@redhat.com>
+
+	* lib/gdb.exp (gdbtk_start): Set ITK_LIBRARY before starting
+	gdb.
+
 2001-06-13  Jim Blandy  <jimb@redhat.com>
 
 	* lib/gdb.exp (gdb_test): Doc fix.
Index: testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.9
diff -u -r1.9 gdb.exp
--- gdb.exp	2001/06/14 00:12:32	1.9
+++ gdb.exp	2001/06/20 22:58:35
@@ -1673,6 +1673,7 @@
   set env(TK_LIBRARY) [to_tcl_path -abs [file join $abs_srcdir .. .. tk library]]
   set env(TIX_LIBRARY) [to_tcl_path -abs [file join $abs_srcdir .. .. tix library]]
   set env(ITCL_LIBRARY) [to_tcl_path -abs [file join $abs_srcdir .. .. itcl itcl library]]
+  set env(ITK_LIBRARY) [to_tcl_path -abs [file join $abs_srcdir .. .. itcl itk library]]
   set env(CYGNUS_GUI_LIBRARY) [to_tcl_path -abs [file join .. $abs_srcdir .. .. libgui library]]
   set env(DEFS) [to_tcl_path -abs [file join $abs_srcdir $subdir defs]]
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-06-20 16:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-14 17:23 [PATCH] prep for Tcl/Tk 8.3 upgrade Ian Roxborough
2001-05-15  3:57 ` Eray Ozkural (exa)
2001-05-15  7:42   ` Christopher Faylor
2001-05-15  7:59     ` Fernando Nasser
2001-05-15 12:25 ` Fernando Nasser
2001-05-16  6:08   ` Andrew Cagney
2001-05-16  7:14     ` Keith Seitz
2001-05-16 15:55       ` Fernando Nasser
     [not found] ` <20010514212318.A17911@redhat.com>
2001-06-20 16:37   ` [PATCH] Tcl/Tk8.3 upgrade Ian Roxborough

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).