How to stop at the crash source statement when debugging with Eclipse ?

Discussion in 'Java' started by Jochen Brenzlinger, Mar 31, 2006.

  1. Assume I have a java project in Eclipse and start to debug it.
    The first stop is at main() function - ok. Then I hit F8 (=Resume)
    and the program runs until an unknown crash statement.

    The only information I got is the trace stack in the output window.
    But what I want is that the statement pointer in the debug source window
    jumps to exactly this (last) statement before the crash.
    When I can achieve this I can peek e.g. into certain variable values.

    Currently neither the statement exection pointer jumps to this critical statement
    nor there is a statement pointer at all.

    How do I get such a "jump-and-show-before-crash" in the source window ?

    Jochen
     
    Jochen Brenzlinger, Mar 31, 2006
    #1
    1. Advertising

  2. Re: How to stop at the crash source statement when debugging withEclipse ?

    Jochen Brenzlinger wrote:
    > Assume I have a java project in Eclipse and start to debug it.
    > The first stop is at main() function - ok. Then I hit F8 (=Resume)
    > and the program runs until an unknown crash statement.
    >
    > The only information I got is the trace stack in the output window.
    > But what I want is that the statement pointer in the debug source window
    > jumps to exactly this (last) statement before the crash.
    > When I can achieve this I can peek e.g. into certain variable values.
    >
    > Currently neither the statement exection pointer jumps to this critical statement
    > nor there is a statement pointer at all.
    >
    > How do I get such a "jump-and-show-before-crash" in the source window ?
    >
    > Jochen
    >


    In Eclipse terms, you want an "exception breakpoint".

    Under the "Run" menu, look for "Add Java Exception Breakpoint".

    Also, search the documentation for "exception breakpoint".

    Patricia
     
    Patricia Shanahan, Mar 31, 2006
    #2
    1. Advertising

  3. Jochen Brenzlinger

    Oliver Wong Guest

    "Jochen Brenzlinger" <> wrote in message
    news:442d3304$0$17575$-online.net...
    > Assume I have a java project in Eclipse and start to debug it.
    > The first stop is at main() function - ok. Then I hit F8 (=Resume)
    > and the program runs until an unknown crash statement.
    >
    > The only information I got is the trace stack in the output window.
    > But what I want is that the statement pointer in the debug source window
    > jumps to exactly this (last) statement before the crash.
    > When I can achieve this I can peek e.g. into certain variable values.
    >
    > Currently neither the statement exection pointer jumps to this critical
    > statement
    > nor there is a statement pointer at all.
    >
    > How do I get such a "jump-and-show-before-crash" in the source window ?


    This "crash" is actually an uncaught exception. You can configure the
    Eclipse debugger to stop at all thrown exceptions, or only thrown exceptions
    which are uncaught, or only thrown exceptions that are caught. To be safe,
    have it stop at all exceptions.

    Alos, if you're running the program via Eclipse, the stack trace should
    have a bunch of filenames and line numbers which act liek hyperlinks. If you
    click on the uppermost one, it'll take you to line in the source code where
    the exception is being thrown.

    - Oliver
     
    Oliver Wong, Mar 31, 2006
    #3
  4. Jochen Brenzlinger

    Daniel Rohe Guest

    Re: How to stop at the crash source statement when debugging withEclipse ?

    Jochen Brenzlinger schrieb:
    > Assume I have a java project in Eclipse and start to debug it.
    > The first stop is at main() function - ok. Then I hit F8 (=Resume)
    > and the program runs until an unknown crash statement.
    >
    > The only information I got is the trace stack in the output window.
    > But what I want is that the statement pointer in the debug source window
    > jumps to exactly this (last) statement before the crash.
    > When I can achieve this I can peek e.g. into certain variable values.
    >
    > Currently neither the statement exection pointer jumps to this critical statement
    > nor there is a statement pointer at all.
    >
    > How do I get such a "jump-and-show-before-crash" in the source window ?
    >
    > Jochen
    >


    You can look in the stack trace for the first class that you know is in
    your project and click on the provided link to get to the implementation
    of the method where the exception raises. Then set a breakpoint there
    and debug with F5 until you reach the point where the exception raises.

    Daniel
     
    Daniel Rohe, Apr 1, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt Theule

    Stop Debugging doesn't stop in ASP.NET

    Matt Theule, Jul 23, 2003, in forum: ASP .Net
    Replies:
    7
    Views:
    774
    Matt Theule
    Jul 24, 2003
  2. Son KwonNam
    Replies:
    11
    Views:
    2,646
    mr_organic
    Apr 9, 2004
  3. Will
    Replies:
    1
    Views:
    15,436
    Thomas Weidenfeller
    Nov 2, 2004
  4. Bernd Oninger
    Replies:
    1
    Views:
    944
    Oliver Wong
    Mar 31, 2006
  5. Harman Dhaliwal
    Replies:
    14
    Views:
    898
    ballpointpenthief
    May 28, 2006
Loading...

Share This Page