Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6213035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:37:25+00:00 2026-05-24T06:37:25+00:00

I have the following piece of code: void func() { try { f1() }

  • 0

I have the following piece of code:

void func()
{
  try
  {
    f1()
  }
  finally()
  {
     if (resource != null)
       resource.close();
  }
}

I put three breakpoints: call to f1(), inside f1(), on the if statement in the finally block.

It appears that the breakpoint in finally block is not being hit. If after hitting the breakpoint inside f1() I step using the next command, I indeed end up going through the finally block.

Also If I put breakpoints on both the lines of the finally block, the breakpoint is indeed hit for the first one.

Not sure if this is due to a bug in JDB. Can someone tell me if this is a known issue or if I am missing something?

I am using JDK 6 on Linux.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:37:26+00:00Added an answer on May 24, 2026 at 6:37 am

    I don’t quite understand what unexpected behavior you’re seeing, but JDB has no problem debugging if’s, finally’s, or if’s inside of finally’s. If you’re seeing apparent breakpoints being skipped, then most likely you’re looking at source code that differs from the bytecode that’s running. It’s possible to check the line numbers in the bytecode by disassembling it with

    javap -c -l <simple class name>
    

    in the same directory as the class file. It can also be run as

    javap -c -l -classpath <build dir> <fully qualified class name>
    

    It will show all of the instructions that each method contains with a numeric label. There will be a “LineNumberTable” that associates those labels to source code line numbers. Note: there are usually many bytecode instructions per source code line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following piece of code pattern: void M1(string s, string v) {
I have the following piece of code which replaces template markers such as %POST_TITLE%
I have the following piece of code in Visual C++ 2005 : : class
I have trouble with the following piece of code. When I go through with
I have the following piece of code in my Spring MVC application: @RequestMapping(value =
I have the following piece of code in a file that I opened in
Hello I have the following piece of code and it won't post the data
Right now I have the following piece of code: RSpec::Matchers.define :include_an_html_tag do |tag| tag
I have the following piece of JS code within a function that responds to
I have the following piece of JS code within a function that responds to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.