Re: regexps
[email protected] Thu, 17 Apr 2003 13:59:51 +0200
| Newsgroups | gmane.comp.java.jswat.user |
|---|---|
| Message-ID | <[email protected]> |
Nathan Fiedler <[email protected]> writes: > The regexp package (java.util.regex) in Java is pretty close to the > standard. There are books that go into great depth, and I recommend > "Mastering Regular Expressions" by Jeffrey Friedl. A good Perl book will > also discuss regular expressions, so that would be another place to > look. > > Given the generally thorough coverage by other publications, I have kept > the information in JSwat to a minimum. Fortunately, if you don't know > regular expressions, you don't have to in order to use the jswat > commands. > > n > > On Fri, 2003-02-28 at 01:48, Joseph R. Kiniry wrote: >> Does anyone have any definitive examples of using regexps in jswat to >> specify thread and objects for watchpoints and similar? The included and >> online docs mention that it can be done and that jswat uses Java's regexp >> package, but I have yet to get it to work for non-trivial examples (e.g., >> the thread name starts with character 'c'). >> >> Joe Hi Nathan, Sorry for the delayed response. Nathan Fiedler <[email protected]> writes: > Ah, now I see what you were asking for. The watchpoints do not take > regular expressions, and I'm not sure what made you think they did. If > there's an error in the help/docs, please point it out to me. It was just my over-analyzing things, nothing specific in the docs triggered my query that I can recall. > What you are probably referring to, regarding a regex that only matches > at the start or end, is in specifiying class names for breakpoints. They > accept an asterisk on either end of the class name. Perhaps you would > like that to be enhanced to use the Java regex package? The shorthand '*' at the beginning or end of a string is fine, though it is somewhat at odds with the standard regexp syntax. What I would really like is the ability to modify (create, enable/disable, etc.) breakpoints and watchpoints with regexps. More generally, anywhere a string can be specified in a command, a regexp should be accepted. This would be a boon for all complex system's debugging. When dealing with large numbers of threads, complex method signatures, complex watchpoints, etc., specifying everything now "by hand", as it were, sometimes is so time-consuming that I just don't do it at all. This feature would simplify the specification of breakpoints as well. E.g., if there is only a single method named "f" in a class "C", even if that method has a horrendous signature, it would be sufficient to specify a breakpoint with "stop C.f" which would be a shorthand for "stop C.f(*)" which is a shorthand for "stop C.f(<signature>)". Another feature I'd like is to be able to view a basic type as another type. For example, sometimes to manipulate Unicode characters one must use ints. In this situation I'd like to be able to see the Unicode character represented by an int in the locals panel. I have filed these two suggestions in the jSwat Bugzilla as RFEs. I have the source and the ability to make this change to experiment with such an interface, I just don't think I have the time right now. Perhaps in a few weeks after I get a new version of ESC/Java out the door... Best, Joe Kiniry