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

  • SEARCH
  • Home
  • 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 9146009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:39:15+00:00 2026-06-17T10:39:15+00:00

I am trying to track a change of a value using watchpoint in a

  • 0

I am trying to track a change of a value using watchpoint in a Java program in Eclipse debugger. The class hierarchy is pretty complex and the value I am tracking is wrapped in container, which is used on many places.

To be more specific, there is a container SizeRequirement, which has a property minimum, which I am tracking. This class is used by many layout managers on many places for many components to define requirement for component’s sizes. I need to catch exact call, where the value changes/is set for one specific layout manager and one specific component in it. Is it possible to filter breakpoints by caller? I will try to explain the problem using some abstract code:

class ValueContainer {
  public String value;
}

class A {

  private ValueContainer valueContainer;

  public A () {
    valueContainer = new ValueContainer();
    valueContainer.value = "setByA";
  }

}

class B {

  private ValueContainer valueContainer;

  public B () {
    valueContainer = new ValueContainer();
    valueContainer.value = "setByB";
  }

}

I set a watchpoint on value and I only want breakpoint to suspend only when the value is set by class A and ignore calls by B.

To make things worse, class SizeRequirement is part of swing library and is deeply integrated in code, so I cannot use inheritance to replace it by some child on some exact place where I want to track it.

EDIT

So this is what I used as conditional breakpoint condition. Believe or not, it works. 🙂

    StackTraceElement[] arr = Thread.currentThread().getStackTrace();
    boolean contains = false;
    for(StackTraceElement e : arr) {
        if (e.getClassName().contains("A")) {
            contains = true;
            break;
        }
    }
  • 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-06-17T10:39:17+00:00Added an answer on June 17, 2026 at 10:39 am

    It’s pretty disgusting and probably slow, but you can use

    Thread.currentThread().getStackTrace()[2].getClassName().contains("A")
    

    as your breakpoint condition.

    Based on this bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=72961 I don’t think Eclipse will support it directly

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

Sidebar

Related Questions

I'm trying to track down a memory leak in a java process, using jmap
I am trying to track ip address of hotlinkers using php and htaccess. .htaccess
So I'm trying to track down a strange bug with NTLMv2 and Java. It
I am trying to create a java script function to keep track of the
I'm using ARM Cortex-A8 and trying to read the value from CCNT time counter
I'm trying to track down a memory leak in a PHP Program (Magento, if
I'm trying to track podcast data. They told me I have to use a
I'm trying to track the page views by inserting only unique values every 24h.But
I'm trying to track down an issue in our MFC code that looks like
I'm trying to track down a bug that occurs when I click a particular

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.