Re: question about catching TCL's output

From: sophie (mailsophie_at_163.com)
Date: 01/05/04


Date: Mon, 5 Jan 2004 18:24:05 +0800

I'm so appreciated to your patience to my question,and blush at my poor
expression.

Although it is hard to describe my problem clearly, I have to try again.
Because my question has little to do with tcl codes.

1) We have a debugger which is made of TCL and C languge, and it works well
independently.

2) Now we want to integrate it into an IDE(Eclipse).In fact,our way to
integrate has nothing to do with Eclipse, they(our IDE group members) use
Java's method of invoking another program(TCL) while running
one(Eclipse),and also using Java's method to communicate with TCL,give tcl
input and get its output to the display(I think this is standard output).

3)The question is when Java gets tcl's output, it can only get some of
them--the result string built up with such codes "interp->result = ...".
BUT the result string built up with "Tcl_AppendElement" can't be caught.

4)So I don't know why? Since they are both TCL's result strings and do be
returned to the dispaly when running debugger independently. I need some
help from the person who knows the details of TCL's implement.

Sorry for taking up your time.

"Don Porter" <dgp@email.nist.gov> 写入消息新闻
:slrnbvdlds.j07.dgp@clover.cam.nist.gov...
> sophie wrote:
> > But I'm afraid I didn't make my question clear. What I want is not the
> > constant string of TCL's result.In fact, our IDE will invoke
debugger(TCL)
> > as a thread and try to get the TCL's standard output to the
display.(That is
> > to say IDE can not use Tcl_GetStringResult() function to get the
result,
> > and our debugger is running independently.)
> >
> > Now the problem is that IDE can not get the result using
> > "Tcl_AppendElement" function to build , but it can get standard Error
> > output,for example "interp->result = "Error: can't load Debugging
files!";
> > ". So I'm confused with the difference between them. Since they are
both
> > TCL's result,although using different function to build( and debugger
can
> > run perfectly ),why IDE can get one,but not the other. And is there
anybody
> > having dealed with such kind of problem?
> >
> > Hope I have made my question clear enough, and thanks for reading.
>
> No, not to me anyway. Near as I can tell your description depends on
> quite a bit of context that is obvious to you, but a mystery to me.
> We also may be using the same words to mean different things.
>
> You say your IDE will "invoke debugger(TCL) as a thread". Do you really
> mean a child process will be lauched? I ask this because you then say
> you "try to get the TCL's standard output", and in my world a "standard
> output" refers to one of three standard channels of a process, stdin,
> stdout, and stderr. I think there may also be confusion between us
> concerning the result of a Tcl_Interp, and the output of a process,
> and the return code of a process.
>
> You also say "IDE can not get the result using "Tcl_AppendElement"
> function to build". I normally think of failure to build meaning
> a compile or link error, but the rest of your description doesn't
> sound like that. You also talk about "standard Error output, for
> example "interp->result = ...". First you should not be working
> with interp-result at all. If you need the string result of a
> Tcl_Interp, the right way to retrieve it is with Tcl_GetStringResult().
> Second, the Tcl_Interp result has nothing to do with the stderr
> of your process, unless they're connected in a way you haven't told
> us about.
>
> At this point, the best advice I can offer, is to try to avoid describing
> your problem. Instead, demonstrate the problem. To do this, post a
> sample of your code, tell us what you do with it step by step, tell us
> what you think it should so, and tell us what it does instead that you
> think is incorrect.
>
> I'm going on travel soon for a week, but I expect someone else will
> pick this up if you can provide a clear description of your needs
> and expectations.
>
> --
> | Don Porter Mathematical and Computational Sciences Division |
> | donald.porter@nist.gov Information Technology Laboratory |
> | http://math.nist.gov/~DPorter/ NIST |
> |______________________________________________________________________|


Loading