[comp.sys.amiga] MANX vs. Lattice memory breakpoints

papa@pollux.usc.edu (Marco Papa) (07/08/89)

OK. I've my foot in my mounth :-) I must have been drinking beer too much 
lately (I started again at DevCon '89). Anyway, Aztec's SDB DOES have a 
memory watchpoint command, though admittedly is the most primitive of
all. The syntax is:

>be ADDR (!= \ == [VAL])

So to monitor when a variable gets changed, you need to enter the initial
value, as in:

>be myarray[5] != 5

Or you might also set up a break when a variable reaches a particular value,
as in:

>be myarray[5] == 6

SDB does not call them "memory change Breakpoints" as in Aztec's DB, but
instead calls them "expression change" breakpoints.

This is what I call the simplest type of memory-breakpoint. Lattice's 
CodeProbe provides much more functionality for what they call "watch breaks":

1. you can set them on variables
2. you can set them on ranges (like the first 10 items of an array)
3. you can set them on structs and arrays by name (meaning the entire aggegate)
4. you can set them on formal parameters
5. you can set them on automatic variables
6. you can set them on ranges that are "dynamic", i.e. between the value
of an automatic variable and a static one, for example, with the former
changeable at run time.

As far as I can gather, Aztec's SDB supports only no. 1 of the above.

BTW, my current programs are still in MANX, but the support that Lattice is
putting into their products vs the un-support provided by MANX (not one update
since Feb. 88 and MANX 5.0 delayed until next fall, if at all)) is getting 
myself and other "commercials" on BIX to serioously considering switching 
to Lattice.

My humble apologies for being so abnoxious.

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
"There's Alpha, Beta, Gamma, Diga and Caligari!" -- Rick Unland
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) (07/08/89)

In article <18346@usc.edu> papa@pollux.usc.edu (Marco Papa) writes:
<OK. I've my foot in my mounth :-) I must have been drinking beer too much 
<lately (I started again at DevCon '89). Anyway, Aztec's SDB DOES have a 
<memory watchpoint command, though admittedly is the most primitive of
<all. The syntax is:
[stuff deleted]
<SDB does not call them "memory change Breakpoints" as in Aztec's DB, but
<instead calls them "expression change" breakpoints.

From the description, it looks like the SDB "expression change"
breakpoints are doing something different from CPR's watch breaks. To
wit, SDB just checks the expression after the generated code would
have changed it; CPR checks the memory after every instruction (or
something along those lines). If this assumption is false, ignore the
rest of this.

For general debugging, what SDB does is actually better - you can find
the piece of your code that is in error. On the other hand, for
finding stray pointer bugs (in my opinion, the hardest kind of bug to
find), you need what CPR is doing. It goes like this:

Verify code is correct at program startup. Run until you die, and
notice that code has changed. Restart, set watchpoint on code that
changed, and run until it changes. You now have a pointer to the code
that has the stray pointer bug in it.

	<mike
--
When all our dreams lay deformed and dead		Mike Meyer
We'll be two radioactive dancers			mwm@berkeley.edu
Spinning in different directions			ucbvax!mwm
And my love for you will be reduced to powder		mwm@ucbjade.BITNET

papa@pollux.usc.edu (Marco Papa) (07/08/89)

In article <26115@agate.BERKELEY.EDU> mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) writes:
>In article <18346@usc.edu> papa@pollux.usc.edu (Marco Papa) writes:
><OK. I've my foot in my mounth :-) I must have been drinking beer too much 
><lately (I started again at DevCon '89). Anyway, Aztec's SDB DOES have a 
><memory watchpoint command, though admittedly is the most primitive of
><all. The syntax is:
>[stuff deleted]
><SDB does not call them "memory change Breakpoints" as in Aztec's DB, but
><instead calls them "expression change" breakpoints.
>
>From the description, it looks like the SDB "expression change"
>breakpoints are doing something different from CPR's watch breaks. To
>wit, SDB just checks the expression after the generated code would
>have changed it; CPR checks the memory after every instruction (or
>something along those lines). If this assumption is false, ignore the
>rest of this.

Let me quote the SDB manual for clarity:

"With an expressoin breakpoint set, sdb detects either the function or 
the instruction that caoused the specified expression to evaluate as true
[i.e. a change in value in a variable], depending on whether the user's
program was activated using the g command or is single stepped using the s 
command, respectively.

When a user's program is activated wqith a g command and an expression
breakpoint is set, sdb evaluates the specidied expression upon entry to,
and exirt from EACH function.  It takes a breakpoint, e.g. interrupt
execution of the program and return control to the operator, when the 
expressionavaluates as true.

When an s command is used to signel-step a program and an expresion 
breakpoint is set, sdb evaluates the specified expression after each 
instruction is executed and takes a breakpoint when appropriate".

So y3es, the two type of breakpoints (SDB and CodeProbe) are not the same:
SDB will only tell you inside which "function" the expression changed.
Than you have to single step (and that could take forever if you have loops)
to find the individual instructin that performed the change.  With 
Codeprobe after EACH instruction the values of memory breakpoits are checked.
The result is that a LAttice program being memeory-breakpointed will run
quite slower than the original one, though it will easily pinpoint the
problem, while more work is needed to do the same with MANX.  This of course
does not consider that MANX cannot set breakpoints for ranges, arrays, structs,
formals and autos.

I hope this makes it a little more clear.

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
"There's Alpha, Beta, Gamma, Diga and Caligari!" -- Rick Unland
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

ddave@pnet02.cts.com (David Donley) (07/12/89)

papa@pollux.usc.edu (Marco Papa) writes:
>OK. I've my foot in my mounth :-) I must have been drinking beer too much 
>lately (I started again at DevCon '89). Anyway, Aztec's SDB DOES have a 
>memory watchpoint command, though admittedly is the most primitive of
>all. The syntax is:
>
>>be ADDR (!= \ == [VAL])
>
>So to monitor when a variable gets changed, you need to enter the initial
>value, as in:
>
>>be myarray[5] != 5
>
>Or you might also set up a break when a variable reaches a particular value,
>as in:
>
>>be myarray[5] == 6
>
>SDB does not call them "memory change Breakpoints" as in Aztec's DB, but
>instead calls them "expression change" breakpoints.
>
>This is what I call the simplest type of memory-breakpoint. Lattice's 
>CodeProbe provides much more functionality for what they call "watch breaks":
>
>1. you can set them on variables
>2. you can set them on ranges (like the first 10 items of an array)
>3. you can set them on structs and arrays by name (meaning the entire aggegate)
>4. you can set them on formal parameters
>5. you can set them on automatic variables
>6. you can set them on ranges that are "dynamic", i.e. between the value
>of an automatic variable and a static one, for example, with the former
>changeable at run time.
>
>As far as I can gather, Aztec's SDB supports only no. 1 of the above.
>
>BTW, my current programs are still in MANX, but the support that Lattice is
>putting into their products vs the un-support provided by MANX (not one update
>since Feb. 88 and MANX 5.0 delayed until next fall, if at all)) is getting 
>myself and other "commercials" on BIX to serioously considering switching 
>to Lattice.
>
>My humble apologies for being so abnoxious.
>
>-- Marco Papa 'Doc'
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
>"There's Alpha, Beta, Gamma, Diga and Caligari!" -- Rick Unland
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

MANX is not that primative...  You can put any equation you want in there, and
it will evaluate it.  It's not just a simple "Memory change breakpoint"