Discussion:
JBuilder 2005 Exception Breakpoint
(too old to reply)
Michael Thelen
2005-01-18 14:41:46 UTC
Permalink
Hello!

I have the following problem. If I have exception, that I catch within
the code there is nothing shown in the debug-mode. But not all my caught
excepions print out something readable. So I tried to define my onw
exception breakpoint, but I don't get stacktrace nor any other
information on the exception.

Is there any chance to set this up within Jbuilder or do I always need
to put something like <ex.printStackTrace(System.err);> within the catch
block.

Thanks for help!

Mike
Kevin Dean [TeamB]
2005-01-18 18:27:38 UTC
Permalink
As far as I know, setting an exception breakpoint doesn't actually give you
access to the exception itself (stack trace, etc). I agree with you that it
would be a good idea. I've submitted it as a request for enhancement.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
Post by Michael Thelen
Hello!
I have the following problem. If I have exception, that I catch within the
code there is nothing shown in the debug-mode. But not all my caught
excepions print out something readable. So I tried to define my onw
exception breakpoint, but I don't get stacktrace nor any other information
on the exception.
Is there any chance to set this up within Jbuilder or do I always need to
put something like <ex.printStackTrace(System.err);> within the catch
block.
Thanks for help!
Mike
Michael Thelen
2005-01-18 21:06:10 UTC
Permalink
Post by Kevin Dean [TeamB]
As far as I know, setting an exception breakpoint doesn't actually give you
access to the exception itself (stack trace, etc). I agree with you that it
would be a good idea. I've submitted it as a request for enhancement.
Huuuh, can't believe that there isn't a way. You can evaluate an
expression, if you set up a new breakpoint. But indeed there an no
implicit objects like i.e. in JSP. There is no information about that in
the JBuilder help.

But there must be an advantage of using the debug-mode. If I have to
introduce a debug variable, I would need to set it to false in all Java
classes or I will have the overhead after compiling.

Is there a possibilty to only have code executed in debug mode and in
normal mode it is not compiled, like in VC++? What is a standard way of
handling something like this?

Greets
Mike
Kevin Dean [TeamB]
2005-01-19 03:10:04 UTC
Permalink
Unfortunately, Java doesn't really have any concept of conditional
compilation.

A thought that occurred to me is that at least the stack trace is visible
when you stop on an exception breakpoint. It's not perfect, but the stack
frame tab in the debugger should give you some information.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
Post by Michael Thelen
Post by Kevin Dean [TeamB]
As far as I know, setting an exception breakpoint doesn't actually give
you access to the exception itself (stack trace, etc). I agree with you
that it would be a good idea. I've submitted it as a request for
enhancement.
Huuuh, can't believe that there isn't a way. You can evaluate an
expression, if you set up a new breakpoint. But indeed there an no
implicit objects like i.e. in JSP. There is no information about that in
the JBuilder help.
But there must be an advantage of using the debug-mode. If I have to
introduce a debug variable, I would need to set it to false in all Java
classes or I will have the overhead after compiling.
Is there a possibilty to only have code executed in debug mode and in
normal mode it is not compiled, like in VC++? What is a standard way of
handling something like this?
Greets
Mike
Loading...