adb - how to do nonstopping breakpoint?

Chris Torek chris at mimsy.umd.edu
Fri Oct 27 15:12:48 AEST 1989


In article <240 at melpar.UUCP> toppin at melpar.UUCP (Doug Toppin) writes:
>[the manual] implied this is possible with the following sentence
>in explaining the ':br' command:
>"If this command sets dot to zero then the breakpoint causes a stop."
>I read this as saying that if I do something that does not set dot
>to zero then execution will continue.

The manual is misleading.  (I will go edit the 4.4BSD version.)  adb
stops when:

 o  the count runs out; or
 o  the command is empty; or
 o  the command sets dot to zero.

Thus, to set a breakpoint that runs `forever':

	main+17,0:b <r0=D;1

`main+17' is the address of the breakpoint.  `0' as a count is the
nearest thing adb has to `infinity'.  Since `<r0' sets dot to whatever
is in r0, I appended the command `1' (semicolons separate multiple
commands).

Note that, e.g.,

	foo+12,8:b this/X

will print `this' 8 times, and then stop, when run via `:r', but will
print it 16 times, and then stop, when run via `,2:r'.

The new manual wording is (/x/ indicates italics):

  :b/c/ Set breakpoint at /address/.  The breakpoint is executed
	/count/-1 times before causing a stop, after which it stops
	unconditionally.  Each time the breakpoint is encountered the
	command /c/ is executed.  If this command is omitted or sets
	/dot/ to zero, the breakpoint causes a stop immediately,
	regardless of any remaining count.

Still perhaps overly concise, but less ambiguous.
-- 
`They were supposed to be green.'
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list