-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark and Eric,

On 3/15/2011 5:14 AM, Mark Thomas wrote:
> On 14/03/2011 20:53, Eric Sheridan wrote:
>> SmapParser parser = new SmapParser(inputStream);
>> Smap smap = parser.parse();
>> int jspLineNumber = smap.getJspLineNumber(javaLineNumber);
>>
>> Does any such code exist? If so, would you mind pointing me to
>> it? If not, any alternative solutions to looking up the original JSP
>> line number given that I am working with Apache Jasper?
> 
> Not that I can think of, but that could be a valuable feature for Jasper
> if you were interested in writing a patch. See [1] for more background.
> There would be several benefits to being able parse SMAP info.

This sounds like something that could be done with a bit of hacking. I
didn't find anything Googling around, either. I did find something
called jclasslib that can be used for inspecting Java .class files but
it's most built as a bytecode browser and decompiler: much more that we
really need.

This information is evidently available via JVMDI, so the JVM must be
loading it somehow. Maybe poking around in OpenJDK would yield some
fruitful results.

The syntax for the Source Maps is pretty simple: the tough part will be
reading it from a Class file because of all the cruft you have to sift
through just to get to the part you want.

I could pretty easily write some code to extract the SMAP extension from
the .class file. It's not hard to ignore a lot of the .class content.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1/jMwACgkQ9CaO5/Lv0PCqcACgiMO65f4Aikj9BtUKkb3TZKIW
EJwAoJBQ7gsGuLYv6Y50YW45dBv4YnQ+
=7HCt
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to