Hi Jakob,
You are correct in assuming that in general jdb is low priority. We
mostly rely on it for testing jdi (there are quite a few jdb tests we
maintain mainly for this purpose), and also for doing some targeted
experimenting that might not be quite as easy to do with a full IDE. We
do welcome bug fixes and enhancements, but we need to weigh their cost
w.r.t. the time it takes to understand and review the changes, and also
consider the risk of breaking something. I don't see an issue with a
simple change like your empty command handling suggestion as being a
problem. However, conditional breakpoints seems like a stretch. It's not
a JDI feature, so will likely take quite a bit of work to support in
jdb. I don't see this as something we'd want to spend time on, but
others might disagree. Certainly it's open to discussion.
BTW, it looks like conditional expressions were at one point a
consideration for JDWP (and therefore could have been leveraged by JDI).
If you look in the EventRequest.set in the JDWP spec:
https://docs.oracle.com/javase/10/docs/specs/jdwp/jdwp-protocol.html#JDWP_EventRequest_Set
You'll find that modkind 2 is the filter for "Conditional on
expression". However, the argument type is exprID, which is not defined
anywhere, and the spec just says "For the future". The debug agent
actually accepts the filter and saves it along with the exprID, but when
it comes time to apply filters, it just ignores it:
case JDWP_REQUEST_MODIFIER(Conditional):
/***
if (... filter->u.Conditional.exprID ...) {
return JNI_FALSE;
}
***/
break;
thanks,
Chris
On 6/18/21 12:57 PM, daniel.daughe...@oracle.com wrote:
Forwarding to serviceability-dev@...
Dan
On 6/18/21 3:31 PM, Jakob Cornell wrote:
Hi all,
I'm hoping to become an OpenJDK contributor in order to make some
enhancements to JDB, which is my go-to tool for Java debugging. As an
example, JDB currently ignores empty commands, and I hope to make a
change so that entering an empty command results in the previous
command being rerun (as users coming from GDB will expect). I would
also be interested in investigating implementation of conditional
breakpoints, assuming JDI supports this (I'm not familiar with it).
I get the sense that these changes may not be priorities for the
OpenJDK development community (or perhaps may not even be desired),
and so I'm writing to try to get a sense of whether I'd be able to
find someone willing to sponsor changes like these. If the answer is
no then I shouldn't bother to look into creating patches. Can
anybody speak to the feasability of this? Also, is there a more
targeted mailing list I should use?
Thanks,
Jakob