* defs.h utils.c (fputc_filtered): New function. Does the obvious...
* jv-lang.c (java_printchar): Fix output of chars > 0xff. Fold java_emit_char into java_printchar. * language.h (PRINT_LITERAL_FORM): Reformat for readability.
This commit is contained in:
parent
7f44038a5f
commit
7b46dd00e4
3 changed files with 46 additions and 58 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Mon Sep 21 19:29:32 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
|
||||||
|
|
||||||
|
* defs.h utils.c (fputc_filtered): New function. Does the obvious...
|
||||||
|
* jv-lang.c (java_printchar): Fix output of chars > 0xff. Fold
|
||||||
|
java_emit_char into java_printchar.
|
||||||
|
* language.h (PRINT_LITERAL_FORM): Reformat for readability.
|
||||||
|
|
||||||
Mon Sep 21 14:38:03 1998 Catherine Moore <clm@cygnus.com>
|
Mon Sep 21 14:38:03 1998 Catherine Moore <clm@cygnus.com>
|
||||||
|
|
||||||
* config/arm/tm-arm.h (*_BREAKPOINT): Define both little endian
|
* config/arm/tm-arm.h (*_BREAKPOINT): Define both little endian
|
||||||
|
|
|
@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include "c-lang.h"
|
#include "c-lang.h"
|
||||||
#include "jv-lang.h"
|
#include "jv-lang.h"
|
||||||
#include "gdbcore.h"
|
#include "gdbcore.h"
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
struct type *java_int_type;
|
struct type *java_int_type;
|
||||||
struct type *java_byte_type;
|
struct type *java_byte_type;
|
||||||
|
@ -703,30 +704,20 @@ java_value_string (ptr, len)
|
||||||
error ("not implemented - java_value_string"); /* FIXME */
|
error ("not implemented - java_value_string"); /* FIXME */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print the character C on STREAM as part of the contents of a literal
|
static void java_printchar PARAMS ((int c, GDB_FILE *stream));
|
||||||
string whose delimiter is QUOTER. Note that that format for printing
|
|
||||||
characters and strings is language specific. */
|
|
||||||
|
|
||||||
void
|
static void
|
||||||
java_emit_char (c, stream, quoter)
|
java_printchar (c, stream)
|
||||||
register int c;
|
int c;
|
||||||
GDB_FILE *stream;
|
GDB_FILE *stream;
|
||||||
int quoter;
|
|
||||||
{
|
|
||||||
if (PRINT_LITERAL_FORM (c))
|
|
||||||
{
|
|
||||||
if (c == '\\' || c == quoter)
|
|
||||||
{
|
|
||||||
fputs_filtered ("\\", stream);
|
|
||||||
}
|
|
||||||
fprintf_filtered (stream, "%c", c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
fputc_filtered ('\'', stream);
|
||||||
|
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case '\n':
|
case '\\':
|
||||||
fputs_filtered ("\\n", stream);
|
case '\'':
|
||||||
|
fprintf_filtered (stream, "\\%c", c);
|
||||||
break;
|
break;
|
||||||
case '\b':
|
case '\b':
|
||||||
fputs_filtered ("\\b", stream);
|
fputs_filtered ("\\b", stream);
|
||||||
|
@ -734,36 +725,24 @@ java_emit_char (c, stream, quoter)
|
||||||
case '\t':
|
case '\t':
|
||||||
fputs_filtered ("\\t", stream);
|
fputs_filtered ("\\t", stream);
|
||||||
break;
|
break;
|
||||||
|
case '\n':
|
||||||
|
fputs_filtered ("\\n", stream);
|
||||||
|
break;
|
||||||
case '\f':
|
case '\f':
|
||||||
fputs_filtered ("\\f", stream);
|
fputs_filtered ("\\f", stream);
|
||||||
break;
|
break;
|
||||||
case '\r':
|
case '\r':
|
||||||
fputs_filtered ("\\r", stream);
|
fputs_filtered ("\\r", stream);
|
||||||
break;
|
break;
|
||||||
case '\033':
|
|
||||||
fputs_filtered ("\\e", stream);
|
|
||||||
break;
|
|
||||||
case '\007':
|
|
||||||
fputs_filtered ("\\a", stream);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
if (c < 256)
|
if (isprint (c))
|
||||||
fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
|
fputc_filtered (c, stream);
|
||||||
else
|
else
|
||||||
fprintf_filtered (stream, "\\u%.4x", (unsigned int) c);
|
fprintf_filtered (stream, "\\u%.4x", (unsigned int) c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
fputc_filtered ('\'', stream);
|
||||||
java_printchar (c, stream)
|
|
||||||
int c;
|
|
||||||
GDB_FILE *stream;
|
|
||||||
{
|
|
||||||
fputs_filtered ("'", stream);
|
|
||||||
java_emit_char (c, stream, '\'');
|
|
||||||
fputs_filtered ("'", stream);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static value_ptr
|
static value_ptr
|
||||||
|
|
|
@ -319,7 +319,9 @@ set_language PARAMS ((enum language));
|
||||||
is program language dependent. */
|
is program language dependent. */
|
||||||
|
|
||||||
#define PRINT_LITERAL_FORM(c) \
|
#define PRINT_LITERAL_FORM(c) \
|
||||||
((c)>=0x20 && ((c)<0x7F || (c)>=0xA0) && (!sevenbit_strings || (c)<0x80))
|
((c) >= 0x20 \
|
||||||
|
&& ((c) < 0x7F || (c) >= 0xA0) \
|
||||||
|
&& (!sevenbit_strings || (c) < 0x80))
|
||||||
|
|
||||||
/* Return a format string for printf that will print a number in one of
|
/* Return a format string for printf that will print a number in one of
|
||||||
the local (language-specific) formats. Result is static and is
|
the local (language-specific) formats. Result is static and is
|
||||||
|
|
Loading…
Add table
Reference in a new issue