watch Command | Command-line Debugging for UDFs | Teradata Vantage - watch - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantage™

This command replaces the standard GDB watch command, which is not suitable for multi-threaded, multi-process, distributed execution. A thread can have up to four watched addresses. Defining a watchpoint uses the next available of the four watch slots. This command directly allocates a hardware debug register for the current thread such that when the condition occurs on the specified address, the thread will stop.

This applies on a per-thread basis. Watchpoints are implicitly removed when the UDF for which they are set exits. They must be reestablished for each UDF, even if it runs on a thread that also ran a previous UDF.

Syntax

watch[/modelocation

Syntax Elements

mode
Specifies the kind of memory access to watch for:
  • d deletes a watchpoint
  • r memory read access
  • w memory write access
  • x instruction execute access
The number of bytes to watch defaults to the size of the location specified, but that can be overridden by preceding the mode letter with 1, 2, 4, or 8. Those are the only sizes that can be watched.
A mode of ‘d’ deletes a previously specified watchpoint. Instead of a location to watch, this must be followed by a watchpoint number (0, 1, 2 or 3).
Although hardware execution watchpoints are supported, they are rarely used because normal GDB breakpoints are generally more effective.
location
An expression that evaluates to the address of the location that is to be monitored.

Usage Notes

You can make watchpoints apply to every UDF with a breakpoint set on entry to the function. This sets the desired watchpoint and continues:

(gdb) break funcname
Breakpoint 1 at ...
(gdb) command 1
> silent
> watch location/w
> continue
>end
(gdb)