+Fri Oct 2 19:42:31 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * c-lang.c (emit_char c_printchar c_printstr), c-lang.h (c_printstr)
+ ch-lang.c (chill_printstr chill_printchar) c-valprint.c (c_val_print)
+ ch-valprint.c (chill_val_print) expprint.c (print_subexp) f-lang.c
+ (f_printstr f_printchar emit_char) f-valprint.c (f_val_print) jv-lang.c
+ (java_printchar java_emit_char) jv-valprint.c (java_value_print
+ java_val_print) language.c (unk_lang_printchar unk_lang_printstr
+ unk_lang_emit_char) language.h (struct language_defn LA_PRINT_STRING
+ LA_EMIT_CHAR) m2-lang.c (m2_printstr m2_printchar emit_char) printcmd.c
+ (print_formatted) scm-lang.c (scm_printstr) valprint.c
+ (val_print_string) value.h (val_print_string): Add emit_char routines
+ to language_desc struct to allow finer control over language specific
+ character output issues. Add character width arg to printstr routines
+ to allow handling of wchar_t/Unicode strings. Fix c_printstr to handle
+ wide characters. Supply width argument to LA_PRINT_STRING and
+ val_print_string.
+
+ * jv-lang.c (java_object_type dynamics_objfile java_link_class_type
+ get_dynamics_objfile get_java_object_type) jv-lang.h
+ (get_java_object_type): Make lots of things static.
+
+ * expprint.c (dump_prefix_expression dump_subexp): Move opcode name
+ printing to common routine (op_name).
+ * (dump_subexp): Add support for OP_SCOPE.
+
Fri Oct 2 16:25:54 1998 Stan Shebs <shebs@andros.cygnus.com>
* configure.host (i[3456]86-*-windows): Remove, no longer used.
#include "language.h"
#include "c-lang.h"
-static void emit_char PARAMS ((int, GDB_FILE *, int));
+static void c_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
/* Print the character C on STREAM as part of the contents of a literal
string whose delimiter is QUOTER. Note that that format for printing
characters and strings is language specific. */
static void
-emit_char (c, stream, quoter)
+c_emit_char (c, stream, quoter)
register int c;
GDB_FILE *stream;
int quoter;
{
-
c &= 0xFF; /* Avoid sign bit follies */
if (PRINT_LITERAL_FORM (c))
int c;
GDB_FILE *stream;
{
- fputs_filtered ("'", stream);
- emit_char (c, stream, '\'');
- fputs_filtered ("'", stream);
+ fputc_filtered ('\'', stream);
+ LA_EMIT_CHAR (c, stream, '\'');
+ fputc_filtered ('\'', stream);
}
/* Print the character string STRING, printing at most LENGTH characters.
- Printing stops early if the number hits print_max; repeat counts
- are printed as appropriate. Print ellipses at the end if we
- had to stop before printing LENGTH characters, or if FORCE_ELLIPSES. */
+ LENGTH is -1 if the string is nul terminated. Each character is WIDTH bytes
+ long. Printing stops early if the number hits print_max; repeat counts are
+ printed as appropriate. Print ellipses at the end if we had to stop before
+ printing LENGTH characters, or if FORCE_ELLIPSES. */
void
-c_printstr (stream, string, length, force_ellipses)
+c_printstr (stream, string, length, width, force_ellipses)
GDB_FILE *stream;
char *string;
unsigned int length;
+ int width;
int force_ellipses;
{
register unsigned int i;
/* If the string was not truncated due to `set print elements', and
the last byte of it is a null, we don't print that, in traditional C
style. */
- if ((!force_ellipses) && length > 0 && string[length-1] == '\0')
+ if (!force_ellipses
+ && length > 0
+ && extract_unsigned_integer (string + (length - 1) * width, width) == '\0')
length--;
if (length == 0)
unsigned int rep1;
/* Number of repetitions we have detected so far. */
unsigned int reps;
+ unsigned long current_char;
QUIT;
need_comma = 0;
}
+ current_char = extract_unsigned_integer (string + i * width, width);
+
rep1 = i + 1;
reps = 1;
- while (rep1 < length && string[rep1] == string[i])
+ while (rep1 < length
+ && extract_unsigned_integer (string + rep1 * width, width)
+ == current_char)
{
++rep1;
++reps;
fputs_filtered ("\", ", stream);
in_quotes = 0;
}
- c_printchar (string[i], stream);
+ LA_PRINT_CHAR (current_char, stream);
fprintf_filtered (stream, " <repeats %u times>", reps);
i = rep1 - 1;
things_printed += repeat_count_threshold;
fputs_filtered ("\"", stream);
in_quotes = 1;
}
- emit_char (string[i], stream, '"');
+ LA_EMIT_CHAR (current_char, stream, '"');
++things_printed;
}
}
evaluate_subexp_standard,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
+ c_emit_char, /* Print a single char */
c_create_fundamental_type, /* Create fundamental type in this language */
c_print_type, /* Print a type using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
evaluate_subexp_standard,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
+ c_emit_char, /* Print a single char */
c_create_fundamental_type, /* Create fundamental type in this language */
c_print_type, /* Print a type using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
evaluate_subexp_standard,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
+ c_emit_char, /* Print a single char */
c_create_fundamental_type, /* Create fundamental type in this language */
c_print_type, /* Print a type using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
extern void c_printchar PARAMS ((int, GDB_FILE*));
-extern void c_printstr PARAMS ((GDB_FILE *, char *, unsigned int, int));
+extern void c_printstr PARAMS ((GDB_FILE *stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses));
extern struct type * c_create_fundamental_type PARAMS ((struct objfile*, int));
len = temp_len;
}
- LA_PRINT_STRING (stream, valaddr, len, 0);
+ LA_PRINT_STRING (stream, valaddr, len, eltlen, 0);
i = len;
}
else
/* For a pointer to char or unsigned char, also print the string
pointed to, unless pointer is null. */
+ /* FIXME: need to handle wchar_t here... */
+
if (TYPE_LENGTH (elttype) == 1
&& TYPE_CODE (elttype) == TYPE_CODE_INT
&& (format == 0 || format == 's')
&& addr != 0)
{
- i = val_print_string (addr, 0, stream);
+ i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
}
else if (cp_is_vtbl_member(type))
{
chill_create_fundamental_type PARAMS ((struct objfile *, int));
static void
-chill_printstr PARAMS ((GDB_FILE *, char *, unsigned int, int));
+chill_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
static void
chill_printchar PARAMS ((int, GDB_FILE *));
*/
static void
-chill_printstr (stream, string, length, force_ellipses)
+chill_printstr (stream, string, length, width, force_ellipses)
GDB_FILE *stream;
char *string;
unsigned int length;
+ int width;
int force_ellipses;
{
register unsigned int i;
evaluate_subexp_chill,
chill_printchar, /* print a character constant */
chill_printstr, /* function to print a string constant */
+ NULL, /* Function to print a single char */
chill_create_fundamental_type,/* Create fundamental type in this language */
chill_print_type, /* Print a type using appropriate syntax */
chill_val_print, /* Print a value using appropriate syntax */
&& /* If print_max is UINT_MAX, the alloca below will fail.
In that case don't try to print the string. */
print_max < UINT_MAX)
- {
- i = val_print_string (addr, 0, stream);
- }
+ i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
+
/* Return number of characters printed, plus one for the
terminating null if we have "reached the end". */
return (i + (print_max && i != print_max));
case TYPE_CODE_STRING:
i = TYPE_LENGTH (type);
- LA_PRINT_STRING (stream, valaddr, i, 0);
+ LA_PRINT_STRING (stream, valaddr, i, 1, 0);
/* Return number of characters printed, plus one for the terminating
null if we have "reached the end". */
return (i + (print_max && i != print_max));
segfault. */
return length;
}
- LA_PRINT_STRING (stream, data_addr, length, 0);
+ LA_PRINT_STRING (stream, data_addr, length, 1, 0);
return length;
default:
break;
#endif
static struct type *f_create_fundamental_type PARAMS ((struct objfile *, int));
-static void f_printstr PARAMS ((FILE *, char *, unsigned int, int));
-static void f_printchar PARAMS ((int, FILE *));
-static void emit_char PARAMS ((int, FILE *, int));
+static void f_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
+static void f_printchar PARAMS ((int c, GDB_FILE *stream));
+static void f_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
/* Print the character C on STREAM as part of the contents of a literal
string whose delimiter is QUOTER. Note that that format for printing
be replaced with a true F77 version. */
static void
-emit_char (c, stream, quoter)
+f_emit_char (c, stream, quoter)
register int c;
- FILE *stream;
+ GDB_FILE *stream;
int quoter;
{
c &= 0xFF; /* Avoid sign bit follies */
FILE *stream;
{
fputs_filtered ("'", stream);
- emit_char (c, stream, '\'');
+ LA_EMIT_CHAR (c, stream, '\'');
fputs_filtered ("'", stream);
}
be replaced with a true F77 version. */
static void
-f_printstr (stream, string, length, force_ellipses)
+f_printstr (stream, string, length, width, force_ellipses)
FILE *stream;
char *string;
unsigned int length;
+ int width;
int force_ellipses;
{
register unsigned int i;
fputs_filtered ("'", stream);
in_quotes = 1;
}
- emit_char (string[i], stream, '"');
+ LA_EMIT_CHAR (string[i], stream, '"');
++things_printed;
}
}
evaluate_subexp_standard,
f_printchar, /* Print character constant */
f_printstr, /* function to print string constant */
+ f_emit_char, /* Function to print a single character */
f_create_fundamental_type, /* Create fundamental type in this language */
f_print_type, /* Print a type using appropriate syntax */
f_val_print, /* Print a value using appropriate syntax */
{
case TYPE_CODE_STRING:
f77_get_dynamic_length_of_aggregate (type);
- LA_PRINT_STRING (stream, valaddr, TYPE_LENGTH (type), 0);
+ LA_PRINT_STRING (stream, valaddr, TYPE_LENGTH (type), 1, 0);
break;
case TYPE_CODE_ARRAY:
&& TYPE_CODE (elttype) == TYPE_CODE_INT
&& (format == 0 || format == 's')
&& addr != 0)
- i = val_print_string (addr, 0, stream);
+ i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
/* Return number of characters printed, plus one for the
terminating null if we have "reached the end". */
/* Java language support routines for GDB, the GNU debugger.
- Copyright 1997 Free Software Foundation, Inc.
+ Copyright 1997, 1998 Free Software Foundation, Inc.
This file is part of GDB.
struct type *java_double_type;
struct type *java_void_type;
-struct type *java_object_type;
+static void java_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
/* This objfile contains symtabs that have been dynamically created
to record dynamically loaded Java classes and dynamically
compiled java methods. */
-struct objfile *dynamics_objfile = NULL;
-struct type *java_link_class_type PARAMS((struct type*, value_ptr));
+static struct objfile *dynamics_objfile = NULL;
-struct objfile *
+static struct type *java_link_class_type PARAMS ((struct type *, value_ptr));
+
+static struct objfile *
get_dynamics_objfile ()
{
if (dynamics_objfile == NULL)
return type;
}
-struct type*
+static struct type *java_object_type;
+
+struct type *
get_java_object_type ()
{
return java_object_type;
error ("not implemented - java_value_string"); /* FIXME */
}
-static void java_printchar PARAMS ((int c, GDB_FILE *stream));
+/* Print the character C on STREAM as part of the contents of a literal
+ string whose delimiter is QUOTER. Note that that format for printing
+ characters and strings is language specific. */
static void
-java_printchar (c, stream)
+java_emit_char (c, stream, quoter)
int c;
GDB_FILE *stream;
+ int quoter;
{
- fputc_filtered ('\'', stream);
-
switch (c)
{
case '\\':
fprintf_filtered (stream, "\\u%.4x", (unsigned int) c);
break;
}
-
- fputc_filtered ('\'', stream);
}
static value_ptr
java_parse,
java_error,
evaluate_subexp_java,
- java_printchar, /* Print a character constant */
+ c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
+ java_emit_char, /* Function to print a single character */
java_create_fundamental_type, /* Create fundamental type in this language */
java_print_type, /* Print a type using appropriate syntax */
java_val_print, /* Print a value using appropriate syntax */
extern struct type *java_array_type PARAMS ((struct type*, int));
-extern struct type *get_java_object_type ();
+extern struct type *get_java_object_type PARAMS ((void));
extern struct type * java_lookup_class PARAMS((char *));
return 0;
}
+ /* If it's type String, print it */
+
+ if (TYPE_CODE (type) == TYPE_CODE_PTR
+ && TYPE_TARGET_TYPE (type)
+ && TYPE_NAME (TYPE_TARGET_TYPE (type))
+ && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "java.lang.String") == 0
+ && (format == 0 || format == 's')
+ && address != 0)
+ {
+ value_ptr data_val;
+ CORE_ADDR data;
+ value_ptr boffset_val;
+ unsigned long boffset;
+ value_ptr count_val;
+ unsigned long count;
+ value_ptr mark;
+
+ mark = value_mark (); /* Remember start of new values */
+
+ data_val = value_struct_elt (&val, NULL, "data", NULL, NULL);
+ data = value_as_pointer (data_val);
+
+ boffset_val = value_struct_elt (&val, NULL, "boffset", NULL, NULL);
+ boffset = value_as_pointer (boffset_val);
+
+ count_val = value_struct_elt (&val, NULL, "count", NULL, NULL);
+ count = value_as_pointer (count_val);
+
+ value_free_to_mark (mark); /* Release unnecessary values */
+
+ val_print_string (data + boffset, count, 2, stream);
+
+ return 0;
+ }
+
return (val_print (type, VALUE_CONTENTS (val), address,
stream, format, 1, 0, pretty));
}
fprintf_filtered (stream, "}");
}
+/* Print data of type TYPE located at VALADDR (within GDB), which came from
+ the inferior at address ADDRESS, onto stdio stream STREAM according to
+ FORMAT (a letter or 0 for natural format). The data at VALADDR is in
+ target byte order.
+
+ If the data are a string pointer, returns the number of string characters
+ printed.
+
+ If DEREF_REF is nonzero, then dereference references, otherwise just print
+ them like pointers.
+
+ The PRETTY parameter controls prettyprinting. */
+
int
java_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
- pretty)
+ pretty)
struct type *type;
char *valaddr;
CORE_ADDR address;
enum val_prettyprint pretty;
{
register unsigned int i = 0; /* Number of characters printed */
- struct type *elttype;
+ struct type *target_type;
CORE_ADDR addr;
CHECK_TYPEDEF (type);
fputs_filtered ("null", stream);
return i;
}
- elttype = check_typedef (TYPE_TARGET_TYPE (type));
- {
- print_unpacked_pointer:
- elttype = check_typedef (TYPE_TARGET_TYPE (type));
+ target_type = check_typedef (TYPE_TARGET_TYPE (type));
- if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
- {
- /* Try to print what function it points to. */
- print_address_demangle (addr, stream, demangle);
- /* Return value is irrelevant except for string pointers. */
- return (0);
- }
+ if (TYPE_CODE (target_type) == TYPE_CODE_FUNC)
+ {
+ /* Try to print what function it points to. */
+ print_address_demangle (addr, stream, demangle);
+ /* Return value is irrelevant except for string pointers. */
+ return (0);
+ }
- if (addressprint && format != 's')
- {
- fputs_filtered ("@", stream);
- print_longest (stream, 'x', 0, (ULONGEST) addr);
- }
- return i;
+ if (addressprint && format != 's')
+ {
+ fputs_filtered ("@", stream);
+ print_longest (stream, 'x', 0, (ULONGEST) addr);
}
+
+ return i;
case TYPE_CODE_CHAR:
format = format ? format : output_format;
if (format)
set_type_range PARAMS ((void));
static void
-unk_lang_printchar PARAMS ((int, GDB_FILE *));
+unk_lang_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
static void
-unk_lang_printstr PARAMS ((GDB_FILE *, char *, unsigned int, int));
+unk_lang_printchar PARAMS ((int c, GDB_FILE *stream));
+
+static void
+unk_lang_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
static struct type *
unk_lang_create_fundamental_type PARAMS ((struct objfile *, int));
error ("Attempted to parse an expression with unknown language");
}
+static void
+unk_lang_emit_char (c, stream, quoter)
+ register int c;
+ GDB_FILE *stream;
+ int quoter;
+{
+ error ("internal error - unimplemented function unk_lang_emit_char called.");
+}
+
static void
unk_lang_printchar (c, stream)
register int c;
}
static void
-unk_lang_printstr (stream, string, length, force_ellipses)
+unk_lang_printstr (stream, string, length, width, force_ellipses)
GDB_FILE *stream;
char *string;
unsigned int length;
+ int width;
int force_ellipses;
{
error ("internal error - unimplemented function unk_lang_printstr called.");
evaluate_subexp_standard,
unk_lang_printchar, /* Print character constant */
unk_lang_printstr,
+ unk_lang_emit_char,
unk_lang_create_fundamental_type,
unk_lang_print_type, /* Print a type using appropriate syntax */
unk_lang_val_print, /* Print a value using appropriate syntax */
evaluate_subexp_standard,
unk_lang_printchar, /* Print character constant */
unk_lang_printstr,
+ unk_lang_emit_char,
unk_lang_create_fundamental_type,
unk_lang_print_type, /* Print a type using appropriate syntax */
unk_lang_val_print, /* Print a value using appropriate syntax */
evaluate_subexp_standard,
unk_lang_printchar, /* Print character constant */
unk_lang_printstr,
+ unk_lang_emit_char,
unk_lang_create_fundamental_type,
unk_lang_print_type, /* Print a type using appropriate syntax */
unk_lang_val_print, /* Print a value using appropriate syntax */
void (*la_error) PARAMS ((char *));
/* Evaluate an expression. */
- struct value * (*evaluate_exp) PARAMS ((struct type*, struct expression *,
+ struct value * (*evaluate_exp) PARAMS ((struct type *, struct expression *,
int *, enum noside));
- void (*la_printchar) PARAMS ((int, GDB_FILE *));
+ void (*la_printchar) PARAMS ((int ch, GDB_FILE *stream));
- void (*la_printstr) PARAMS ((GDB_FILE *, char *, unsigned int, int));
+ void (*la_printstr) PARAMS ((GDB_FILE *stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses));
+
+ void (*la_emitchar) PARAMS ((int ch, GDB_FILE *stream, int quoter));
struct type *(*la_fund_type) PARAMS ((struct objfile *, int));
#define LA_PRINT_CHAR(ch, stream) \
(current_language->la_printchar(ch, stream))
-#define LA_PRINT_STRING(stream, string, length, force_ellipses) \
- (current_language->la_printstr(stream, string, length, force_ellipses))
+#define LA_PRINT_STRING(stream, string, length, width, force_ellipses) \
+ (current_language->la_printstr(stream, string, length, width, force_ellipses))
+#define LA_EMIT_CHAR(ch, stream, quoter) \
+ (current_language->la_emitchar(ch, stream, quoter))
/* Test a character to decide whether it can be printed in literal form
or needs to be printed in another representation. For example,
#include "c-lang.h"
static struct type *m2_create_fundamental_type PARAMS ((struct objfile *, int));
-static void m2_printstr PARAMS ((GDB_FILE *, char *, unsigned int, int));
+static void m2_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
static void m2_printchar PARAMS ((int, GDB_FILE *));
-static void emit_char PARAMS ((int, GDB_FILE *, int));
+static void m2_emit_char PARAMS ((int, GDB_FILE *, int));
/* Print the character C on STREAM as part of the contents of a literal
string whose delimiter is QUOTER. Note that that format for printing
*/
static void
-emit_char (c, stream, quoter)
+m2_emit_char (c, stream, quoter)
register int c;
GDB_FILE *stream;
int quoter;
GDB_FILE *stream;
{
fputs_filtered ("'", stream);
- emit_char (c, stream, '\'');
+ LA_EMIT_CHAR (c, stream, '\'');
fputs_filtered ("'", stream);
}
be replaced with a true Modula version. */
static void
-m2_printstr (stream, string, length, force_ellipses)
+m2_printstr (stream, string, length, width, force_ellipses)
GDB_FILE *stream;
char *string;
unsigned int length;
+ int width;
int force_ellipses;
{
register unsigned int i;
fputs_filtered ("\"", stream);
in_quotes = 1;
}
- emit_char (string[i], stream, '"');
+ LA_EMIT_CHAR (string[i], stream, '"');
++things_printed;
}
}
evaluate_subexp_standard,
m2_printchar, /* Print character constant */
m2_printstr, /* function to print string constant */
+ m2_emit_char, /* Function to print a single character */
m2_create_fundamental_type, /* Create fundamental type in this language */
m2_print_type, /* Print a type using appropriate syntax */
m2_val_print, /* Print a value using appropriate syntax */
switch (format)
{
case 's':
+ /* FIXME: Need to handle wchar_t's here... */
next_address = VALUE_ADDRESS (val)
- + val_print_string (VALUE_ADDRESS (val), 0, gdb_stdout);
+ + val_print_string (VALUE_ADDRESS (val), -1, 1, gdb_stdout);
next_section = VALUE_BFD_SECTION (val);
break;
/* These are the types that $__ will get after an examine command of one
of these sizes. */
+static struct type *examine_i_type;
+
static struct type *examine_b_type;
static struct type *examine_h_type;
static struct type *examine_w_type;
if (format == 's' || format == 'i')
size = 'b';
- if (size == 'b')
+ if (format == 'i')
+ val_type = examine_i_type;
+ else if (size == 'b')
val_type = examine_b_type;
else if (size == 'h')
val_type = examine_h_type;
/* Note that print_formatted sets next_address for the next
object. */
last_examine_address = next_address;
- last_examine_value = value_at (val_type, next_address, sect);
+ /* The value to be displayed is not fetched greedily.
+ Instead, to avoid the posibility of a fetched value not
+ being used, its retreval is delayed until the print code
+ uses it. When examining an instruction stream, the
+ disassembler will perform its own memory fetch using just
+ the address stored in LAST_EXAMINE_VALUE. FIXME: Should
+ the disassembler be modified so that LAST_EXAMINE_VALUE
+ is left with the byte sequence from the last complete
+ instruction fetched from memory? */
+ last_examine_value = value_at_lazy (val_type, next_address, sect);
print_formatted (last_examine_value, format, size);
}
printf_filtered ("\n");
(LONGEST) last_examine_address));
/* Make contents of last address examined available to the user as $__.*/
- set_internalvar (lookup_internalvar ("__"), last_examine_value);
+ /* If the last value has not been fetched from memory then don't
+ fetch it now - instead mark it by voiding the $__ variable. */
+ if (VALUE_LAZY (last_examine_value))
+ set_internalvar (lookup_internalvar ("__"),
+ allocate_value (builtin_type_void));
+ else
+ set_internalvar (lookup_internalvar ("__"), last_examine_value);
}
}
if (find_pc_partial_function (pc, &name, &low, &high) == 0)
error ("No function contains program counter for selected frame.\n");
low += FUNCTION_START_OFFSET;
- high -= 1;
}
else if (!(space_index = (char *) strchr (arg, ' ')))
{
if (find_pc_partial_function (pc, &name, &low, &high) == 0)
error ("No function contains specified address.\n");
low += FUNCTION_START_OFFSET;
- high -= 1;
- if (overlay_debugging)
- {
- section = find_pc_overlay (pc);
- if (pc_in_unmapped_range (pc, section))
- {
- /* find_pc_partial_function will have returned low and high
- relative to the symbolic (mapped) address range. Need to
- translate them back to the unmapped range where PC is. */
-
- low = overlay_unmapped_address (low, section);
- high = overlay_unmapped_address (high, section);
- }
- }
}
else
{
*space_index = '\0';
low = parse_and_eval_address (arg);
high = parse_and_eval_address (space_index + 1);
- high -= 1;
}
printf_filtered ("Dump of assembler code ");
pc_masked = pc;
#endif
- while (pc_masked <= high)
+ while (pc_masked < high)
{
QUIT;
print_address (pc_masked, gdb_stdout);
&setprintlist),
&showprintlist);
+ /* For examine/instruction a single byte quantity is specified as
+ the data. This avoids problems with value_at_lazy() requiring a
+ valid data type (and rejecting VOID). */
+ examine_i_type = init_type (TYPE_CODE_INT, 1, 0, "examine_i_type", NULL);
+
examine_b_type = init_type (TYPE_CODE_INT, 1, 0, "examine_b_type", NULL);
examine_h_type = init_type (TYPE_CODE_INT, 2, 0, "examine_h_type", NULL);
examine_w_type = init_type (TYPE_CODE_INT, 4, 0, "examine_w_type", NULL);
int *, enum noside));
static value_ptr scm_lookup_name PARAMS ((char *));
static int in_eval_c PARAMS ((void));
-static void scm_printstr PARAMS ((GDB_FILE *, char *, unsigned int, int));
+static void scm_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
extern struct type ** CONST_PTR (c_builtin_types[]);
}
static void
-scm_printstr (stream, string, length, force_ellipses)
+scm_printstr (stream, string, length, width, force_ellipses)
GDB_FILE *stream;
char *string;
unsigned int length;
+ int width;
int force_ellipses;
{
fprintf_filtered (stream, "\"%s\"", string);
scm_parse,
c_error,
evaluate_subexp_scm,
- scm_printchar, /* Print a character constant */
+ scm_printchar, /* Print a character constant */
scm_printstr, /* Function to print string constant */
- NULL, /* Create fundamental type in this language */
+ NULL, /* Function to print a single character */
+ NULL, /* Create fundamental type in this language */
c_print_type, /* Print a type using appropriate syntax */
scm_val_print, /* Print a value using appropriate syntax */
scm_value_print, /* Print a top-level value */