Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » JDIDebugModel.creatMethodBreakpoint
JDIDebugModel.creatMethodBreakpoint [message #211714] Sat, 06 August 2005 06:00 Go to next message
Eclipse UserFriend
Hello,
I use JDIDebugModel.
createMethodBreakpoint(IResource resource, String typePattern, String
methodName, String methodSignature, boolean entry, boolean exit, boolean
nativeOnly, int lineNumber, int charStart, int charEnd, int hitCount,
boolean register, Map attributes)
with
typePattern =
ICompilationUnit.findPrimaryType().getFullyQualifiedName();/ /also tried to
append "*"
methodName = null;
methodSignature = null
entry = true
exit=false
nativeOnly=false
lineNumber = cu.lineNumber(MethodDeclaration.getStartPosition());//also
tried cu.lineNumber(MethodDeclaration.getNam().getStartPosition())
charStart= MethodDeclaration.getStartPosition();//also tried -1
charEnd =
MethodDeclaration.getStartPosition()+MethodDeclaration.getLe ngth();//also
tried -1
hitcount = 0
register = false
attributes = null

to create entry methodbreakpoints programmatically. But breakpoints for
methods of inner classes are never hit or all methods (with the same name)
where hit without care of the linenumber or charStart and charEnd
parameters.

How can I create method breakpints without specifieing the methodSignature
(which is very hard to generate for me) but with a line n umber or charStart
and charEnd or both?

Are methodbreakpoints ignoring the lineNumber, charStart and charEnd
parameters for a hit?

What lineNumber, charStart and charEnd are expected form the method above?
For lineNumber I tried
cu.lineNumber(MethodDeclaration.getNam().getStartPosition()) ,
cu.lineNumber(MethodDeclaration.getStartPosition()) and
cu.lineNumber(MethodDeclaration.getStartPosition()()+MethodD eclaration.getLength());
For charStart I tried MethodDeclaration.getStartPosition() (so with leading
comments) but also MethodDeclaration.getName().getStartPosition().



And I have an other Question:
I use IJavaBreakpointListener.breakpointHit(IJavaThread thread,
IJavaBreakpoint breakpoint) to get a IJavaStackFrame from the thread
parameter. But from IJavaStackFrame.getCharStart() and
IJavaStackFrame.getCharEnd() I get allways only -1. Why?
And IJavaStackFrame.getLineNumber() points to the last line of a method.
Why?

Thanks for help!!
Re: JDIDebugModel.creatMethodBreakpoint [message #211750 is a reply to message #211714] Mon, 08 August 2005 07:49 Go to previous message
Eclipse UserFriend
I discovered, that I can programmatically creat general method breakpoints.
With "general" I mean only one method breakpoint per compilation unit with
the primary unit type name as type pattern and all other parameters are null
(for methodname, methodSignature) or -1 (for line, charStart and charEnd).
(See JDIDebugModel.createMethodBreakpoint(...)).
This method breakpoint is hit through every call of a method in the
compilation unit (even for methods in inner classes!).

But unfortunately I can not create a general line breakpoint. A breakpoint,
that is hit for every executed line or statement in the compilation unit. I
tried to use JDIDebugModel.createLineBreakpoint() with parameters like
above. But it seems a line breakpoint with a line = -1 will never be hit.

Is there any other way to get a notification about what line is currently
executed?
I experimented with step over and step into but that not work for me.

Can someone explain me what a stratum is? And what a stratum breakpoint is?
And how it works?
It is possible to get the currently executed line with a "general" stratum
breakpoint or a target pattern breakpoint? (examples, what parameters?)

Of course I could try to set for every line a line breakpoint, but that
would lead to creation of hunderet or thousend line breakpoints...thats too
slow, too much memory consumption.
Previous Topic:How to retrieve anonymous IType from IType
Next Topic:only one method visible in java editor
Goto Forum:
  


Current Time: Wed May 07 16:15:48 EDT 2025

Powered by FUDForum. Page generated in 0.03947 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top