[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [platform-debug-dev] RE: How to call a (local ?) method from a Watch expression
|
Hi,
Thanks for the information Luc, I was able to use the Display view to find out that I needed to fully qualify the class name - my code module had an include statement for the relevant package, but the Watch Expression evaluator (and the Display view evaluator) didn't know how to find the method that I was calling without the full name.
Apologies for not responding earlier, but our comms lines were down all last week - you have NO idea how irritating that is, until it happens to you.
Regards.
Mike
-----Original Message-----
From: Luc Bourlier [mailto:eclipse@xxxxxxxxxx]
Sent: 21 November 2003 16:10
To: platform-debug-dev@xxxxxxxxxxx
Subject: Re: [platform-debug-dev] RE: How to call a (local ?) method
from a Watch expression
Q1) What limitations exist on the evaluation of Watch Expressions ?
Q1a) is there a document defining them ?
The java evaluation engine manage about all the java spec. It doesn't manage try-catch statements, assert statements and switch-case statements. There is no document about it, you should get a explicite message d'error if you try to use one these statement.
Q2) Is there a way of finding out what <error(s) during the evaluation> actually means in this (or any other) case ?
Depends of the version of Eclipse you use. In 3.0, just expand the tree element, its children are the error messages generated during the evaluation. In 2.1.x, there no direct way to get the errors messages. A way to get the error messages is to try the same evaluation in the display view, it will display the errors.
Q3) Is there some way of wrapping the call to allow the Watch Expression parser to accept it ?
If you want to use a non-managed statement, wrap it in a method in you class, or in a static method in a utility class.
Q4) Would it work if the method was in a seperate .jar file ?
The Java evaluation engine uses the java build path defined in the project to compile the snippet, and the classpath of the VM on which you running your application to execute the snippet. So it will work only if the .jar file is both in the build path and in the classpath.
HTH,
Luc
Mike Parfitt wrote:
>
>
>> -----Original Message-----
>>From: Mike Parfitt
>>Sent: 21 November 2003 08:55
>>To: 'platform-debug-dev@xxxxxxxxxxx'
>>Subject: How to call a (local ?) method from a Watch expression
>>
>>If this is the wrong forum, please advise - (my first posting)
>>
>>Within a project I have added a static method which successfully uses the Reflection API to dump (to a file) a formatted print of any given object to a specified (recursive) depth.
>>
>>When I call it from the java code that executes as a result of an incoming request it works fine, but this requires me to have modified the code ahead of the test to insert the relevant call(s).
>>
>>What I would like to do, is call it when I am debugging and halted at a checkpoint, or at some subsequent statement that I have stepped to using F5 or F6 etc.
>>
>>When I put a call into a Watch Expression I get <error(s) during the evaluation> both when the return type is void and when it is a primitive type (int) - I have also tried modifying the number of \ characters after the drive letter in the string defining the file name, but the error(s) remain.
>>
>>The logic around Watch Expressions must be evaluating expressions on the fly, so I don't understand why it can't execute mine. I can't be the first to try calling a method in my own project from a Watch Expression - perhaps this is inherently unfeasible, or perhaps there is a document that I haven't found that shows how to do it.
>>
>>So,
>>
>>Q1) What limitations exist on the evaluation of Watch Expressions ?
>> Q1a) is there a document defining them ?
>>Q2) Is there a way of finding out what <error(s) during the evaluation> actually means in this (or any other) case ?
>>Q3) Is there some way of wrapping the call to allow the Watch Expression parser to accept it ?
>>Q4) Would it work if the method was in a seperate .jar file ?
>>
>>Many Thanks
>>
>>Mike Parfitt
>>
>>
>
>
>Mike Parfitt
>Developer
>JMH Demica Ltd
>Crowne House,
>56-58 Southwark Street
>London
>SE1 1UN
>
>
_______________________________________________
platform-debug-dev mailing list
platform-debug-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-debug-dev
Mike Parfitt
Developer
JMH Demica Ltd
Crowne House,
56-58 Southwark Street
London
SE1 1UN
Direct: +44 (0) 20 7450 2539
Switchboard: +44 (0) 20 7450 2500
Fax: +44 (0) 20 7407 5825
Web: http://www.jmhdemica.com
This document should only be read by those persons to whom it is
addressed and is not intended to be relied upon by any person
without subsequent written confirmation of its contents. JMH
Demica accepts no liability for the consequences for any person
acting, or refraining from acting, on such information prior to
the receipt by those persons of subsequent written confirmation
(by letter or fax). If you have received this email message in
error, please notify the sender immediately by telephone. Please
also delete the message from your computer. Any form of
reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this email message is
prohibited. The contents of this email message do not
necessarily reflect the opinions of JMH Demica. Citadel is the
registered trademark of JMH Demica. Copyright JMH Demica all
rights reserved.