From 5707ea9fad0ff4b51cc2c913af218c0a0b8278e9 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Mon, 23 Nov 1992 19:57:29 +0000 Subject: * language.h (PRINT_LITERAL_FORM): New macro that takes character and decides if it should be printed in literal form or some other form, based on it's ASCII value and setting of sevenbit_strings. * {c-exp.y, m2-exp.y} (emit_char): Use new PRINT_LITERAL_FORM macro, change indentation style. **** start-sanitize-chill **** * ch-exp.y (chill_printchar): Use new PRINT_LITERAL_FORM macro. * ch-exp.y (chill_printstr): First cut at real function instead of error stub. **** end-sanitize-chill **** --- gdb/language.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gdb/language.h') diff --git a/gdb/language.h b/gdb/language.h index 0e240f5..862323a 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -222,6 +222,15 @@ set_language PARAMS ((enum language)); #define local_printstr(stream, string, length, force_ellipses) \ (current_language->la_printstr(stream, string, length, force_ellipses)) +/* Test a character to decide whether it can be printed in literal form + or needs to be printed in another representation. For example, + in C the literal form of the character with octal value 141 is 'a' + and the "other representation" is '\141'. The "other representation" + is program language dependent. */ + +#define PRINT_LITERAL_FORM(c) \ + ((c)>=0x20 && ((c)<0x7F || (c)>=0xA0) && (!sevenbit_strings || (c)<0x80)) + /* Return a format string for printf that will print a number in one of the local (language-specific) formats. Result is static and is overwritten by the next call. Takes printf options like "08" or "l" -- cgit v1.1