Board index » jbuilder » How to create a "Write Access" breakpoint?

How to create a "Write Access" breakpoint?


2003-08-15 10:46:59 PM
jbuilder3
hello:
Does anyone know how to create a "Write Access" breakpoint on a variable
in JB9.0? I want to use this function to track where a variable is modified.
thank you
-Daniel
 
 

Re:How to create a "Write Access" breakpoint?

There is no such breakpoint capability in JBuilder. However, at the risk
of stating the obvious, why not wrap the variable in getter and setter
methods and put a breakpoint in the setter method?
--
Check out our latest white papers at
www.datadevelopment.com/papers/index.html
BladeNET Scores With Borland Enterprise Tools
Team Development with JBuilder and Borland Enterprise Server
Dolphin Data Development Ltd.
www.datadevelopment.com/
"Daniel Mark" < XXXX@XXXXX.COM >wrote in message
Quote
hello:
Does anyone know how to create a "Write Access" breakpoint on a variable
in JB9.0? I want to use this function to track where a variable is
modified.


thank you
-Daniel


 

Re:How to create a "Write Access" breakpoint?

Hello Kevin:
I tried your suggestion before, but I found JB9.0 cannot let me step
into
the getter and setter function.
My code looks like this:
public class ColorBar extends JComponent {
....
int barWidth = ShowBarUtil.BARWIDTH;
....
public int getBarWidth() {
return barWidth;
// I try to set breakpoint here, but JB9.0 cannot let me step into.
}
...
}
public class ShowBarMouseInputAdapter extends MouseInputAdapter {
...
public ShowBarMouseInputAdapter(ColorBar colorBar) {
...
int width = colorBar.getBarWidth();
// I had used any format which didn't work too(int width =0; width =
colorBar.getBarWidth())
...
}
}
I set a breakpoint in line "int width = colorBar.getBarWidth();", but JB9.0
cannot
let me step into function getBarWidth()".
In my guess, I think I might do something wrong, so JB9.0 disabled that
function.
thank you again.
-Daniel
 

{smallsort}

Re:How to create a "Write Access" breakpoint?

I am just guessing that maybe the optimizer is just blowing that statement away
and that if you looked at the byte code, you might see that
the whole method was missing and that barWidth was set in at
unexpected time.
Daniel Mark wrote:
Quote
Hello Kevin:
I tried your suggestion before, but I found JB9.0 cannot let me step
into
the getter and setter function.
My code looks like this:

public class ColorBar extends JComponent {
....
int barWidth = ShowBarUtil.BARWIDTH;
....

public int getBarWidth() {
return barWidth;
// I try to set breakpoint here, but JB9.0 cannot let me step into.
}
...
}


public class ShowBarMouseInputAdapter extends MouseInputAdapter {
...
public ShowBarMouseInputAdapter(ColorBar colorBar) {
...
int width = colorBar.getBarWidth();
// I had used any format which didn't work too(int width =0; width =
colorBar.getBarWidth())
...

}
}



I set a breakpoint in line "int width = colorBar.getBarWidth();", but JB9.0
cannot
let me step into function getBarWidth()".
In my guess, I think I might do something wrong, so JB9.0 disabled that
function.


thank you again.
-Daniel



 

Re:How to create a "Write Access" breakpoint?

hello Ken:
May we disable the optimizer of JB9.0 if you suggestion was correct?
thx
-Daniel
"Ken Warner" < XXXX@XXXXX.COM >wrote in message
Quote
I am just guessing that maybe the optimizer is just blowing that statement
away
and that if you looked at the byte code, you might see that
the whole method was missing and that barWidth was set in at
unexpected time.

Daniel Mark wrote:
>Hello Kevin:
>I tried your suggestion before, but I found JB9.0 cannot let me step
>into
>the getter and setter function.
>My code looks like this:
>
>public class ColorBar extends JComponent {
>....
>int barWidth = ShowBarUtil.BARWIDTH;
>....
>
>public int getBarWidth() {
>return barWidth;
>// I try to set breakpoint here, but JB9.0 cannot let me step into.
>}
>...
>}
>
>
>public class ShowBarMouseInputAdapter extends MouseInputAdapter {
>...
>public ShowBarMouseInputAdapter(ColorBar colorBar) {
>...
>int width = colorBar.getBarWidth();
>// I had used any format which didn't work too(int width =0; width =
>colorBar.getBarWidth())
>...
>
>}
>}
>
>
>
>I set a breakpoint in line "int width = colorBar.getBarWidth();", but
JB9.0
>cannot
>let me step into function getBarWidth()".
>In my guess, I think I might do something wrong, so JB9.0 disabled that
>function.
>
>
>thank you again.
>-Daniel
>
>
>

 

Re:How to create a "Write Access" breakpoint?

hello Kevin:
I agree with you. I think I might do sth wrong.
thx
"Kevin Dean" < XXXX@XXXXX.COM >wrote in message
Quote
I must confess I've never seen that behaviour; I set breakpoints in
setters
quite regularly and have never seen that behaviour.

A more tedious method would be to put the cursor on the setter method name
and press Ctrl-Shift-Enter to find all references to it and set
breakpoints
on each.

--
Check out our latest white papers at
www.datadevelopment.com/papers/index.html

BladeNET Scores With Borland Enterprise Tools
Team Development with JBuilder and Borland Enterprise Server

Dolphin Data Development Ltd.
www.datadevelopment.com/

"Daniel Mark" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>Hello Kevin:
>I tried your suggestion before, but I found JB9.0 cannot let me step
>into
>the getter and setter function.
>My code looks like this:
>
>public class ColorBar extends JComponent {
>....
>int barWidth = ShowBarUtil.BARWIDTH;
>....
>
>public int getBarWidth() {
>return barWidth;
>// I try to set breakpoint here, but JB9.0 cannot let me step into.
>}
>...
>}
>
>
>public class ShowBarMouseInputAdapter extends MouseInputAdapter {
>...
>public ShowBarMouseInputAdapter(ColorBar colorBar) {
>...
>int width = colorBar.getBarWidth();
>// I had used any format which didn't work too(int width =0; width =
>colorBar.getBarWidth())
>...
>
>}
>}
>
>
>
>I set a breakpoint in line "int width = colorBar.getBarWidth();", but
JB9.0
>cannot
>let me step into function getBarWidth()".
>In my guess, I think I might do something wrong, so JB9.0 disabled that
>function.
>
>
>thank you again.
>-Daniel
>
>
>


 

Re:How to create a "Write Access" breakpoint?

Daniel Mark wrote:
Quote
hello:
Does anyone know how to create a "Write Access" breakpoint on a variable
in JB9.0? I want to use this function to track where a variable is modified.


thank you
-Daniel


You might achieve the effect you want by looking at your breakpoint
properties and setting a condition.
--
Regards,
Lori Olson (TeamB)
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html