[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
|
Re: [jdt-debug-dev] JavaMethodEntryBreakpoints
|
Thanks a lot, Darin!
Now it works. I used "(Ljava.lang.String;)V" instead of
"(Ljava/lang/String;)V" which caused the problem just as you
said.
Philipp
You should use
qualified type signature format for method signatures. We compare against
the runtime (resolved) signature, not the development time (unresolved)
signature. The resource you specify does not effect the installation of
the breakpoint - it only defines what resource the associated breakpoint
marker will be persisted with in the workspace. Generally, if the
associated java element (method, type, etc.), is contained in a file in
the workspace - that resource should be specified. For elemnets not in
the workspace, it is up to the client to specify an arbitrary resource -
for example the workspace root, or associated project.
I tried an example to suspend in junit.samples.VectorTest. I
added the constructor "VectorTest(String)" contructor, and
created a breakpoint like this:
JDIDebugModel.createMethodEntryBreakpoint(resource,
"junit.samples.VectorTest",
"<init>",
"(Ljava/lang/String;)V",
-1, -1, -1, 0, true, attributes);
This worked OK for me.
Darin
Philipp.Bouillon@xxxxxxxxxxx (Philipp
Bouillon)
Sent by: jdt-debug-dev-admin@xxxxxxxxxxx
04/24/2003 12:00 PM
Please respond to jdt-debug-dev
To:
jdt-debug-dev@xxxxxxxxxxx
cc:
Subject: Re: [jdt-debug-dev]
JavaMethodEntryBreakpoints
Sorry, but I forgot to mention that
the same routine works for any other method (not constructors, that
is).
Philipp
Thanks for the advice, but even after
I changed "FileReader" to "<init>", the
bahavior does not change: the breakpoint is created (it is shown in the
"breakpoint"-list of the debugging perspective), but if I
select "debug as JUnit Test", the execution is _not_
interrupted upon reaching the breakpoint (and it is definitely
reached).
However, I found out, that I was using the wrong resource. But I changed
"FileReader" to "DummyTest" (which is a JUnit test
class created in the default package) and tried to set a breakpoint on
its constructor using the described method. And that did not work either
(same behavior). If I set the breakpoint manually (i.e. by double
clicking), it works fine.
So again, this is my statement:
JDIDebugModel.createMethodEntryBreakpoint(resource,
"DummyTest",
"<init>",
"(QString;)V", // It's really QString;
here, not "Ljava.lang.String;" as in java.io.FileReader
0, -1, -1, 0,
true,
attributes);
The breakpoint appears in the breakpoint list, but execution is not
paused upon reaching it. Why?
And, something completely different: How _do_ I get the correct resource
of any java file that does not neccessarily have to be in my workspace
(if you know a quick how-to, I'd appreciate hearing it, however, I have
not looked into that problem yet, and I suppose it could really be
simple).
Once again, I thank you very much for your help and your patience.
Philipp Bouillon
(Forgot to mention)...For a
method breakpoint, the line numebrs/source positions are simply used to
render the breakpoint in the
editor.
Darin
Darin
Wright/Ottawa/IBM@IBMCA
Sent by:
jdt-debug-dev-admin@xxxxxxxxxxx
04/24/2003 09:29 AM
Please respond to
jdt-debug-dev
To:
jdt-debug-dev@xxxxxxxxxxx
cc:
Subject: Re: [jdt-debug-dev]
JavaMethodEntryBreakpoints
It looks like you are specifying the wrong name for the method - i.e.
"FileReader". If you are referring to a constructor, you should
use "<init>".
Darin
Philipp.Bouillon@xxxxxxxxxxx
Sent by:
jdt-debug-dev-admin@xxxxxxxxxxx
04/24/2003 09:08 AM
Please respond to
jdt-debug-dev
To:
jdt-debug-dev@xxxxxxxxxxx
cc:
Subject: [jdt-debug-dev]
JavaMethodEntryBreakpoints
Hello,
I am trying to programatically set a JavaMethodEntryBreakpoint.
Can this be done _without_ knowing the line number of the method
definition? It does not seem to work for me.
This is, what I do:
I have an IResource object and a name of a method, where I'd like
to
set a breakpoint. Say, for example "java.io.FileReader" (and
let's
suppose, that I do not have the source code for that class).
Aside: If I do have the source code, it's no problem at all -- I
determine the source range and the line number, and I can set the
breakpoint just perfectly.
So, what can I do now?
I tried a JDIDebugModel.createMethodEntryBreakpoint(resource,
"java.io.FileReader", "FileReader",
"(Ljava.lang.String;)V", 0, -1,
-1,
0, true, attributes);
But that did not work (I also tried -1 as line number). Is it
because
of the signature, or did I miss something else?
Thanks for your help,
Philipp Bouillon
_______________________________________________
jdt-debug-dev mailing list
jdt-debug-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/jdt-debug-dev
PGP-PublicKey:
http://philipp.bouillon.bei.t-online.de/PGPPublic.htm
PGP-Fingerprint: DCF4 3600 5DDB A23B 4DCD 121D D626 3131 71F2 EA9F
PGP-PublicKey:
http://philipp.bouillon.bei.t-online.de/PGPPublic.htm
PGP-Fingerprint: DCF4 3600 5DDB A23B 4DCD 121D D626 3131 71F2 EA9F
PGP-PublicKey:
http://philipp.bouillon.bei.t-online.de/PGPPublic.htm
PGP-Fingerprint: DCF4 3600 5DDB A23B 4DCD 121D D626 3131 71F2
EA9F