If you want to set a breakpoint on a location or variable that is not within the current scope, there are two ways to do it:
Both methods achieve the same result, but the Advanced Breakpoint dialog box handles many details for you and does not require you to learn any special syntax.
To break on a location outside the current scope
The Advanced Breakpoint dialog box appears.
For example, to set a breakpoint at a line number in another source file, specify only the source file. To set a breakpoint in a dynamic-link library (DLL), you must specify the function, source file, and DLL. The DLL filename goes in the Executable File text box.)
The information that you specified appears in the Break At text box in the Breakpoints dialog box.
To use advanced breakpoints syntax, you must qualify a breakpoint location or variable with a special context operator, as follows:
The context operator is a pair of braces ({}) containing two commas, and some combination of function name, source filename, and executable filename. If you omit either function or exe, the two commas cannot be omitted. The following syntax, for example, is illegal:
{File.c, File.exe
} .143
— Bad
If you omit both source and exe, however, you can omit the commas. The following syntax is legal:
{Fun
} .143
The location can be any line number, function, or memory address at which you can set a breakpoint. For example,
If the source or exe filename includes a comma, an embedded space, or a brace, you must use quotation marks around the filename so that the context parser can properly recognize the string. Single quotation marks are considered to be part of a Windows NT/Windows 95 filename, so you must use double quotation marks. For example,
{,”
a long, long, name.c”
, } .143
Another form of advanced breakpoints syntax uses the exclamation point instead of the context operator:
source!.location
This form of advanced breakpoint syntax does not include a function name or .EXE specifier. If you use this syntax to specify a filename that contains an exclamation point, you must surround the filename with double quotes:
“File.!c”!.115
You can also set data breakpoints. For more information, see Setting Breakpoints When Values Change or Become True.