No debug information in h2.jar?

91 views
Skip to first unread message

Laird Nelson

unread,
Nov 1, 2011, 10:16:58 AM11/1/11
to h2-da...@googlegroups.com
I noticed that the org.h2.build.Build class (no Ant? no Maven?) never adds a "-g" option if the compile method is told to build classes with debug information present.  I had to edit the source of Build.java to supply a "-g" option so I could debug the server.  FYI.  I'm happy to report these issues in a bug database if there is one.

Best,
Laird

Thomas Mueller

unread,
Nov 4, 2011, 2:14:23 AM11/4/11
to h2-da...@googlegroups.com
Hi,

> I noticed that the org.h2.build.Build class (no Ant? no Maven?) never adds a
> "-g" option

No, it uses the default settings, which means the "line numbers" debug
info is available. In 99% of the cases this is enough.

> I had to edit the source of Build.java to supply a
> "-g" option so I could debug the server.

No, you don't need that: line numbers debug info that is present in
the default jar file is sufficient for debugging. You need to point
the IDE to the source jar file, which is available for download on
Maven, for example:
http://repo2.maven.org/maven2/com/h2database/h2/1.3.161/ -
h2-1.3.161-sources.jar

To analyze stack traces, you can also use the online "Error Analyzer":
http://h2database.com/html/sourceError.html

Regards,
Thomas

Laird Nelson

unread,
Nov 4, 2011, 2:34:04 AM11/4/11
to h2-da...@googlegroups.com
On Fri, Nov 4, 2011 at 2:14 AM, Thomas Mueller <thomas.to...@gmail.com> wrote:
No, you don't need that: line numbers debug info that is present in
the default jar file is sufficient for debugging.

With respect, yes I did, and no, it was not.  I needed the variable values, which were not showing up in Netbeans 7 when it was pointed at the -sources jar (which I asked Netbeans to download, which it did successfully).

Best,
Laird

--
http://about.me/lairdnelson

Thomas Mueller

unread,
Nov 7, 2011, 1:53:26 PM11/7/11
to h2-da...@googlegroups.com
Hi,

> I needed the variable values,
> which were not showing up in Netbeans 7 when it was pointed at the -sources
> jar (which I asked Netbeans to download, which it did successfully).

OK, in that case the easiest solution is probably to compile H2
yourself in the IDE.

The default H2 jar file includes line number debug info, this is very
helpful when analyzing exception stack traces, or when profiling.

I don't want to include variable debug info in the default jar files,
and providing additional jar files or build options would confuse
people more than help... Only very few people want to debug the
database engine itself, and those who do can compile H2 themselves in
the IDE, I think that's not too much to ask.

Regards,
Thomas

Laird Nelson

unread,
Nov 7, 2011, 2:03:12 PM11/7/11
to h2-da...@googlegroups.com
On Mon, Nov 7, 2011 at 1:53 PM, Thomas Mueller <thomas.to...@gmail.com> wrote:
I don't want to include variable debug info in the default jar files,
and providing additional jar files or build options would confuse
people more than help... Only very few people want to debug the
database engine itself, and those who do can compile H2 themselves in
the IDE, I think that's not too much to ask.

No, but it would be nice if in your home-grown build system it were possible to pass -g options.  No big deal; I whipped up a Maven pom.xml for future needs and now build H2 with that.

Best,
Laird

--
http://about.me/lairdnelson

Reply all
Reply to author
Forward
0 new messages