Ladebug's international support is dependent on the support available in the underlying system. International support is provided through the global locale of the debugger, which is set automatically from the external user environment when you invoke the debugger.
The locale information can be printed using the debugger variable
$lc_ctype
. This (read-only) variable specifies the
value of the current LC_CTYPE locale category in the debugger, which
is used for all data interpretations.
Ladebug's international support provides the features described in Section C.1 through Section C.3.
Ladebug supports the input of local language characters in user commands. It analyzes user input commands to recognize and process locale-based text (including multibyte characters) in language specific expressions: file names, function names, variable names and values, debugger variable names and values, alias names and parameters, and the debugger prompt.
This support is based on the specific capabilities of the programming language of the debugged unit and of the global debugger locale.
Ladebug prints all character data according to the current global locale set in the debugger.
Ladebug checks the character to be printed to see if it is a special
character that is printed as an escaped expression (for example,
(char)8
is printed as \\t
). Ladebug
then checks the XPG4 appropriate functions to find out if the
character is a printable character in the current locale. If it is,
the character is printed as is. Otherwise, the character is printed
in octal notation (for example, (char)1
is printed as
\\001
).
Ladebug prints wcharacters of type wchar_t
and wide
strings of type wchar_t *
in readable format, similar
to their literals L'X' and L"XYZ" (where X, Y ,Z are character codes
encoded in the current global locale).
Wide character/string input is accomplished by entering literals in the forms accepted by C and C++ compilers.
The display of these entities is made available through extensions to the following debugger commands:
startaddress, endaddress / mode
startaddress / count mode
Specify C mode (uppercase) to print each sizeof (wchar_
t
) as a wide character.
Specify S mode (uppercase) to print the contents of memory as a wide string.
Use the following command to print the result of the expression for wide characters or wide strings:
$ print expression [,...]
Wide characters in C and C++ are interpreted as unsigned integers
by the Digital UNIX compilers and set as such in the symbol tables
of object files. As a result, Ladebug can't distinguish between an
unsigned int
data and a wchar_t
in the
symbol table. You must specify the debugger variable $wchar_
t
to determine the user-preferred output format for unsigned
integer expressions (either as integers or as wide characters
/strings). If $wchar_t
has a non-zero value, a wide
character is printed in the format of L'X' in accordance with
the codeset of the current locale. A wide string is printed in an
L"XXXX" format.
Using the following form,
$ printf [format [expression,...]]
specify format specifier %C (uppercase) to print a wide character and format specifier %S (uppercase) to print a wide string.
Non printable wide characters (as determined by XPG4 library
iswprint()
function) will be printed as escaped
character expressions.