* core-aout.c (fetch_core_registers): Cast core_reg_size to int
before testing against reg_ptr. * eval.c (evaluate_subexp_standard): Cast type of TYPE_FN_FIELD_VOFFSET to int. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer): Cast type of sizeof to int. * values.c (unpack_field_as_long, modify_field): Ditto. * valops.c (value_assign, call_function_by_hand): Ditto. * infcmd.c (do_registers_info): Ditto. * ser-tcp.c (tcp_open): Ditto * remote.c (putpkt): Ditto. * dcache.c (dcache_peek): Ditto. * dcache.c (dcache_poke): Ditto. * m2-exp.y (yylex): Ditto. * gnu-regex.c (re_match_2): Ditto. * f-lang.c (ADD_BF_SYMNUM, saved_bf_list_end, tmp_bf_ptr): Ifdef out unused macro definition and variables. * inftarg.c (proc_wait): Move from main.c to here, and make static. * valprint.c (val_print_string): Change bufsize from int to unsigned. * main.c (wait.h): Include * top.c (command_line_input): Remove unused variable "c". * f-typeprint.c (f_type_print_varspec_prefix): Add missing enum value TYPE_CODE_TYPEDEF to switch statement. (f_type_print_varspec_suffix): Add missing enum value TYPE_CODE_TYPEDEF to switch statement. * ch-exp.c (parse_primval): Add remaining enumeration values to switch statement, with no specific action. (ch_lex): Add LOC_UNRESOLVED in switch statement. (pushback_token): Ifdef out, since code using it is ifdef'd out. * stabsread.c (cleanup_undefined_types): Remove unused label "badtype". * objfiles.h (print_symbol_bcache_statistics): Add prototype. * maint.c (objfiles.h): Include. (maintenance_print_statistics): Remove unused variable "temp". * minsyms.c (lookup_minimal_symbol_solib_trampoline): Remove unused variable "found_file_symbol". * m2-exp.y (yylex): Add LOC_UNRESOLVED case to switch. * language.c (lang_bool_type): Use existing function local type variable rather than create block local variables. * solib.c (disable_break): Enclose in ifndef SVR4_SHARED_LIBS. * infptrace.c (wait.h, command.h): Include. * ser-tcp.c (gdb_string.h): Include * i386-tdep.c (codestream_seek): Change "place" to CORE_ADDR. (i386_get_frame_setup): Change "pc" from int to CORE_ADDR. * command.c (complete_on_enum): Make assignment used as truth value explictly check against NULL. (wait.h): Include. * infrun.c (wait_for_inferior): Ifdef out prologue_pc since code that uses it is ifdef'd out. * parser-defs.h: Add prototype for write_dollar_variable. * infrun.c: Add prototype for write_pc_pid. * breakpoint.h: Add prototype for re_enable_breakpoints_in_shlibs. * symmisc.c (bcache.h): Include. * bcache.h: Add prototype for print_bcache_statistics. * symfile.c: Include <time.h>. * printcmd.c (print_scalar_formatted): Change len to unsigned int. * valarith.c (value_equal): Cast result of TYPE_LENGTH to int. * valarith.c (value_binop): Change result_len, promoted_len1, and promoted_len2 to unsigned int. * valarith.c (value_subscripted_rvalue): Change elt_offs and elt_size to unsigned int. * valops.c (value_array): Change typelength to unsigned int. (destructor_name_p): Change len to unsigned int. * scm-lang.h (scm_parse): Add prototype for scm_unpack. * symfile.c (decrement_reading_symtab): Change return type to void. * valarith.c (value_subscript): Remove unused variable "word". (value_subscript): Remove unused variable "tint". * valops.c (auto_abandon): Ifdef out, since code using it is also ifdef'd out. * eval.c (init_array_element): Remove unused variable "val". * Makefile.in (values.o): Depends on scm-lang.h. (command.o): Depends upon wait_h. (ser-tcp.o): Depends upon gdb_string.h. (infptrace.o): Depends upon wait_h and command_h. (maint.o): Depends on objfiles.h and symfile.h. * values.c (allocate_repeat_value): Remove unused variable "element_type". (scm-lang.h): Include. * breakpoint.c (create_longjmp_breakpoint): Enclose in GET_LONGJMP_TARGET define, unused otherwise. * config/i386/nm-linux.h: Add prototypes for i386_insert_watchpoint, i386_remove_watchpoint and i386_stopped_by_watchpoint.
This commit is contained in:
parent
84f737e989
commit
b52cac6b76
32 changed files with 371 additions and 170 deletions
|
@ -1,3 +1,88 @@
|
||||||
|
Fri Mar 29 21:39:56 1996 Fred Fish <fnf@cygnus.com>
|
||||||
|
|
||||||
|
* core-aout.c (fetch_core_registers): Cast core_reg_size to int
|
||||||
|
before testing against reg_ptr.
|
||||||
|
* eval.c (evaluate_subexp_standard): Cast type of
|
||||||
|
TYPE_FN_FIELD_VOFFSET to int.
|
||||||
|
* findvar.c (extract_signed_integer, extract_unsigned_integer,
|
||||||
|
extract_long_unsigned_integer): Cast type of sizeof to int.
|
||||||
|
* values.c (unpack_field_as_long, modify_field): Ditto.
|
||||||
|
* valops.c (value_assign, call_function_by_hand): Ditto.
|
||||||
|
* infcmd.c (do_registers_info): Ditto.
|
||||||
|
* ser-tcp.c (tcp_open): Ditto
|
||||||
|
* remote.c (putpkt): Ditto.
|
||||||
|
* dcache.c (dcache_peek): Ditto.
|
||||||
|
* dcache.c (dcache_poke): Ditto.
|
||||||
|
* m2-exp.y (yylex): Ditto.
|
||||||
|
* gnu-regex.c (re_match_2): Ditto.
|
||||||
|
* f-lang.c (ADD_BF_SYMNUM, saved_bf_list_end, tmp_bf_ptr): Ifdef
|
||||||
|
out unused macro definition and variables.
|
||||||
|
* inftarg.c (proc_wait): Move from main.c to here, and make static.
|
||||||
|
* valprint.c (val_print_string): Change bufsize from int to unsigned.
|
||||||
|
* main.c (wait.h): Include
|
||||||
|
* top.c (command_line_input): Remove unused variable "c".
|
||||||
|
* f-typeprint.c (f_type_print_varspec_prefix): Add missing enum
|
||||||
|
value TYPE_CODE_TYPEDEF to switch statement.
|
||||||
|
(f_type_print_varspec_suffix): Add missing enum value
|
||||||
|
TYPE_CODE_TYPEDEF to switch statement.
|
||||||
|
* ch-exp.c (parse_primval): Add remaining enumeration values to
|
||||||
|
switch statement, with no specific action.
|
||||||
|
(ch_lex): Add LOC_UNRESOLVED in switch statement.
|
||||||
|
(pushback_token): Ifdef out, since code using it is ifdef'd out.
|
||||||
|
* stabsread.c (cleanup_undefined_types): Remove unused label
|
||||||
|
"badtype".
|
||||||
|
* objfiles.h (print_symbol_bcache_statistics): Add prototype.
|
||||||
|
* maint.c (objfiles.h): Include.
|
||||||
|
(maintenance_print_statistics): Remove unused variable "temp".
|
||||||
|
* minsyms.c (lookup_minimal_symbol_solib_trampoline): Remove
|
||||||
|
unused variable "found_file_symbol".
|
||||||
|
* m2-exp.y (yylex): Add LOC_UNRESOLVED case to switch.
|
||||||
|
* language.c (lang_bool_type): Use existing function local type
|
||||||
|
variable rather than create block local variables.
|
||||||
|
* solib.c (disable_break): Enclose in ifndef SVR4_SHARED_LIBS.
|
||||||
|
* infptrace.c (wait.h, command.h): Include.
|
||||||
|
* ser-tcp.c (gdb_string.h): Include
|
||||||
|
* i386-tdep.c (codestream_seek): Change "place" to CORE_ADDR.
|
||||||
|
(i386_get_frame_setup): Change "pc" from int to CORE_ADDR.
|
||||||
|
* command.c (complete_on_enum): Make assignment used as truth value
|
||||||
|
explictly check against NULL.
|
||||||
|
(wait.h): Include.
|
||||||
|
* infrun.c (wait_for_inferior): Ifdef out prologue_pc since code
|
||||||
|
that uses it is ifdef'd out.
|
||||||
|
* parser-defs.h: Add prototype for write_dollar_variable.
|
||||||
|
* infrun.c: Add prototype for write_pc_pid.
|
||||||
|
* breakpoint.h: Add prototype for re_enable_breakpoints_in_shlibs.
|
||||||
|
* symmisc.c (bcache.h): Include.
|
||||||
|
* bcache.h: Add prototype for print_bcache_statistics.
|
||||||
|
* symfile.c: Include <time.h>.
|
||||||
|
* printcmd.c (print_scalar_formatted): Change len to unsigned int.
|
||||||
|
* valarith.c (value_equal): Cast result of TYPE_LENGTH to int.
|
||||||
|
* valarith.c (value_binop): Change result_len, promoted_len1,
|
||||||
|
and promoted_len2 to unsigned int.
|
||||||
|
* valarith.c (value_subscripted_rvalue): Change elt_offs and
|
||||||
|
elt_size to unsigned int.
|
||||||
|
* valops.c (value_array): Change typelength to unsigned int.
|
||||||
|
(destructor_name_p): Change len to unsigned int.
|
||||||
|
* scm-lang.h (scm_parse): Add prototype for scm_unpack.
|
||||||
|
* symfile.c (decrement_reading_symtab): Change return type to void.
|
||||||
|
* valarith.c (value_subscript): Remove unused variable "word".
|
||||||
|
(value_subscript): Remove unused variable "tint".
|
||||||
|
* valops.c (auto_abandon): Ifdef out, since code using it is also
|
||||||
|
ifdef'd out.
|
||||||
|
* eval.c (init_array_element): Remove unused variable "val".
|
||||||
|
* Makefile.in (values.o): Depends on scm-lang.h.
|
||||||
|
(command.o): Depends upon wait_h.
|
||||||
|
(ser-tcp.o): Depends upon gdb_string.h.
|
||||||
|
(infptrace.o): Depends upon wait_h and command_h.
|
||||||
|
(maint.o): Depends on objfiles.h and symfile.h.
|
||||||
|
* values.c (allocate_repeat_value): Remove unused variable
|
||||||
|
"element_type".
|
||||||
|
(scm-lang.h): Include.
|
||||||
|
* breakpoint.c (create_longjmp_breakpoint): Enclose in
|
||||||
|
GET_LONGJMP_TARGET define, unused otherwise.
|
||||||
|
* config/i386/nm-linux.h: Add prototypes for i386_insert_watchpoint,
|
||||||
|
i386_remove_watchpoint and i386_stopped_by_watchpoint.
|
||||||
|
|
||||||
Thu Mar 28 12:53:19 1996 Doug Evans <dje@canuck.cygnus.com>
|
Thu Mar 28 12:53:19 1996 Doug Evans <dje@canuck.cygnus.com>
|
||||||
|
|
||||||
* configure.in (sparc64-*-solaris2*): Delete.
|
* configure.in (sparc64-*-solaris2*): Delete.
|
||||||
|
|
|
@ -206,7 +206,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
|
||||||
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
|
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
|
||||||
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
|
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
|
||||||
|
|
||||||
VERSION = 4.15.2
|
VERSION = 4.15.3
|
||||||
DIST=gdb
|
DIST=gdb
|
||||||
|
|
||||||
LINT=/usr/5bin/lint
|
LINT=/usr/5bin/lint
|
||||||
|
@ -1055,7 +1055,7 @@ coffread.o: coffread.c $(bfd_h) $(breakpoint_h) buildsym.h \
|
||||||
gdb_string.h
|
gdb_string.h
|
||||||
|
|
||||||
command.o: command.c $(defs_h) $(expression_h) $(gdbcmd_h) \
|
command.o: command.c $(defs_h) $(expression_h) $(gdbcmd_h) \
|
||||||
$(gdbtypes_h) $(symtab_h) $(value_h) gdb_string.h
|
$(gdbtypes_h) $(symtab_h) $(value_h) gdb_string.h $(wait_h)
|
||||||
|
|
||||||
complaints.o: complaints.c complaints.h $(defs_h) $(gdbcmd_h)
|
complaints.o: complaints.c complaints.h $(defs_h) $(gdbcmd_h)
|
||||||
|
|
||||||
|
@ -1190,7 +1190,7 @@ inflow.o: inflow.c $(bfd_h) $(command_h) $(defs_h) $(inferior_h) \
|
||||||
signals.h target.h terminal.h thread.h gdb_string.h
|
signals.h target.h terminal.h thread.h gdb_string.h
|
||||||
|
|
||||||
infptrace.o: infptrace.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \
|
infptrace.o: infptrace.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \
|
||||||
gdb_string.h
|
gdb_string.h $(wait_h) $(command_h)
|
||||||
|
|
||||||
infrun.o: infrun.c $(wait_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
|
infrun.o: infrun.c $(wait_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
|
||||||
$(inferior_h) target.h thread.h gdb_string.h
|
$(inferior_h) target.h thread.h gdb_string.h
|
||||||
|
@ -1238,7 +1238,7 @@ mac-nat.o: mac-nat.c $(defs_h) gdb_string.h
|
||||||
main.o: main.c top.h $(defs_h) gdb_string.h
|
main.o: main.c top.h $(defs_h) gdb_string.h
|
||||||
|
|
||||||
maint.o: maint.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) language.h \
|
maint.o: maint.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) language.h \
|
||||||
$(expression_h)
|
$(expression_h) objfiles.h symfile.h
|
||||||
|
|
||||||
mdebugread.o: mdebugread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \
|
mdebugread.o: mdebugread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \
|
||||||
$(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
|
$(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
|
||||||
|
@ -1412,7 +1412,7 @@ ser-go32.o: ser-go32.c $(defs_h) serial.h
|
||||||
|
|
||||||
ser-mac.o: ser-mac.c $(defs_h) serial.h signals.h
|
ser-mac.o: ser-mac.c $(defs_h) serial.h signals.h
|
||||||
|
|
||||||
ser-tcp.o: ser-tcp.c $(defs_h) serial.h signals.h
|
ser-tcp.o: ser-tcp.c $(defs_h) serial.h signals.h gdb_string.h
|
||||||
|
|
||||||
ser-unix.o: ser-unix.c $(defs_h) serial.h
|
ser-unix.o: ser-unix.c $(defs_h) serial.h
|
||||||
|
|
||||||
|
@ -1510,7 +1510,7 @@ valprint.o: valprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
|
||||||
|
|
||||||
values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \
|
values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \
|
||||||
$(gdbcore_h) $(gdbtypes_h) $(symtab_h) target.h $(value_h) \
|
$(gdbcore_h) $(gdbtypes_h) $(symtab_h) target.h $(value_h) \
|
||||||
gdb_string.h
|
gdb_string.h scm-lang.h
|
||||||
|
|
||||||
vax-tdep.o: vax-tdep.c $(OP_INCLUDE)/vax.h $(defs_h) $(symtab_h)
|
vax-tdep.o: vax-tdep.c $(OP_INCLUDE)/vax.h $(defs_h) $(symtab_h)
|
||||||
|
|
||||||
|
|
|
@ -62,4 +62,11 @@ struct bcache {
|
||||||
extern void *
|
extern void *
|
||||||
bcache PARAMS ((void *bytes, int count, struct bcache *bcachep));
|
bcache PARAMS ((void *bytes, int count, struct bcache *bcachep));
|
||||||
|
|
||||||
|
#if MAINTENANCE_CMDS
|
||||||
|
|
||||||
|
extern void
|
||||||
|
print_bcache_statistics PARAMS ((struct bcache *, char *));
|
||||||
|
|
||||||
|
#endif /* MAINTENANCE_CMDS */
|
||||||
|
|
||||||
#endif /* BCACHE_H */
|
#endif /* BCACHE_H */
|
||||||
|
|
59
gdb/ch-exp.c
59
gdb/ch-exp.c
|
@ -75,6 +75,7 @@ typedef union
|
||||||
enum ch_terminal {
|
enum ch_terminal {
|
||||||
END_TOKEN = 0,
|
END_TOKEN = 0,
|
||||||
/* '\001' ... '\xff' come first. */
|
/* '\001' ... '\xff' come first. */
|
||||||
|
OPEN_PAREN = '(',
|
||||||
TOKEN_NOT_READ = 999,
|
TOKEN_NOT_READ = 999,
|
||||||
INTEGER_LITERAL,
|
INTEGER_LITERAL,
|
||||||
BOOLEAN_LITERAL,
|
BOOLEAN_LITERAL,
|
||||||
|
@ -176,6 +177,8 @@ peek_token_ (i)
|
||||||
return terminal_buffer[i];
|
return terminal_buffer[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pushback_token (code, node)
|
pushback_token (code, node)
|
||||||
enum ch_terminal code;
|
enum ch_terminal code;
|
||||||
|
@ -193,6 +196,8 @@ pushback_token (code, node)
|
||||||
val_buffer[0] = node;
|
val_buffer[0] = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
forward_token_()
|
forward_token_()
|
||||||
{
|
{
|
||||||
|
@ -778,7 +783,7 @@ parse_primval ()
|
||||||
}
|
}
|
||||||
write_exp_elt_opcode (UNOP_IND);
|
write_exp_elt_opcode (UNOP_IND);
|
||||||
continue;
|
continue;
|
||||||
case '(':
|
case OPEN_PAREN:
|
||||||
parse_call ();
|
parse_call ();
|
||||||
continue;
|
continue;
|
||||||
case CHARACTER_STRING_LITERAL:
|
case CHARACTER_STRING_LITERAL:
|
||||||
|
@ -790,6 +795,55 @@ parse_primval ()
|
||||||
write_exp_elt_longcst (1);
|
write_exp_elt_longcst (1);
|
||||||
write_exp_elt_opcode (MULTI_SUBSCRIPT);
|
write_exp_elt_opcode (MULTI_SUBSCRIPT);
|
||||||
continue;
|
continue;
|
||||||
|
case END_TOKEN:
|
||||||
|
case TOKEN_NOT_READ:
|
||||||
|
case INTEGER_LITERAL:
|
||||||
|
case BOOLEAN_LITERAL:
|
||||||
|
case FLOAT_LITERAL:
|
||||||
|
case GENERAL_PROCEDURE_NAME:
|
||||||
|
case LOCATION_NAME:
|
||||||
|
case EMPTINESS_LITERAL:
|
||||||
|
case TYPENAME:
|
||||||
|
case CASE:
|
||||||
|
case OF:
|
||||||
|
case ESAC:
|
||||||
|
case LOGIOR:
|
||||||
|
case ORIF:
|
||||||
|
case LOGXOR:
|
||||||
|
case LOGAND:
|
||||||
|
case ANDIF:
|
||||||
|
case NOTEQUAL:
|
||||||
|
case GEQ:
|
||||||
|
case LEQ:
|
||||||
|
case IN:
|
||||||
|
case SLASH_SLASH:
|
||||||
|
case MOD:
|
||||||
|
case REM:
|
||||||
|
case NOT:
|
||||||
|
case RECEIVE:
|
||||||
|
case UP:
|
||||||
|
case IF:
|
||||||
|
case THEN:
|
||||||
|
case ELSE:
|
||||||
|
case FI:
|
||||||
|
case ELSIF:
|
||||||
|
case ILLEGAL_TOKEN:
|
||||||
|
case NUM:
|
||||||
|
case PRED:
|
||||||
|
case SUCC:
|
||||||
|
case ABS:
|
||||||
|
case CARD:
|
||||||
|
case MAX_TOKEN:
|
||||||
|
case MIN_TOKEN:
|
||||||
|
case ADDR_TOKEN:
|
||||||
|
case SIZE:
|
||||||
|
case UPPER:
|
||||||
|
case LOWER:
|
||||||
|
case LENGTH:
|
||||||
|
case ARRAY:
|
||||||
|
case GDB_VARIABLE:
|
||||||
|
case GDB_ASSIGNMENT:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1977,6 +2031,9 @@ ch_lex ()
|
||||||
case LOC_OPTIMIZED_OUT:
|
case LOC_OPTIMIZED_OUT:
|
||||||
error ("Symbol \"%s\" names no location.", inputname);
|
error ("Symbol \"%s\" names no location.", inputname);
|
||||||
break;
|
break;
|
||||||
|
case LOC_UNRESOLVED:
|
||||||
|
error ("unhandled SYMBOL_CLASS in ch_lex()");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!have_full_symbols () && !have_partial_symbols ())
|
else if (!have_full_symbols () && !have_partial_symbols ())
|
||||||
|
|
|
@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include "gdbcmd.h"
|
#include "gdbcmd.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
#include "value.h"
|
#include "value.h"
|
||||||
|
#include "wait.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "gdb_string.h"
|
#include "gdb_string.h"
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
|
@ -1048,7 +1049,7 @@ complete_on_enum (enumlist, text, word)
|
||||||
matchlist = (char **) xmalloc (sizeof_matchlist * sizeof (char *));
|
matchlist = (char **) xmalloc (sizeof_matchlist * sizeof (char *));
|
||||||
matches = 0;
|
matches = 0;
|
||||||
|
|
||||||
for (i = 0; name = enumlist[i]; i++)
|
for (i = 0; (name = enumlist[i]) != NULL; i++)
|
||||||
if (strncmp (name, text, textlen) == 0)
|
if (strncmp (name, text, textlen) == 0)
|
||||||
{
|
{
|
||||||
if (matches == sizeof_matchlist)
|
if (matches == sizeof_matchlist)
|
||||||
|
|
|
@ -84,7 +84,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
|
||||||
CORE_REGISTER_ADDR to offset to the other registers. If this is a modern
|
CORE_REGISTER_ADDR to offset to the other registers. If this is a modern
|
||||||
core file without a upage, reg_ptr will be zero and this is all a big
|
core file without a upage, reg_ptr will be zero and this is all a big
|
||||||
NOP. */
|
NOP. */
|
||||||
if (reg_ptr > core_reg_size)
|
if (reg_ptr > (int) core_reg_size)
|
||||||
reg_ptr -= KERNEL_U_ADDR;
|
reg_ptr -= KERNEL_U_ADDR;
|
||||||
|
|
||||||
for (regno = 0; regno < numregs; regno++)
|
for (regno = 0; regno < numregs; regno++)
|
||||||
|
|
|
@ -355,7 +355,7 @@ dcache_peek (dcache, addr, data)
|
||||||
{
|
{
|
||||||
char *dp = (char *) data;
|
char *dp = (char *) data;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < sizeof (int); i++)
|
for (i = 0; i < (int) sizeof (int); i++)
|
||||||
{
|
{
|
||||||
if (!dcache_peek_byte (dcache, addr + i, dp + i))
|
if (!dcache_peek_byte (dcache, addr + i, dp + i))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -433,7 +433,7 @@ dcache_poke (dcache, addr, data)
|
||||||
{
|
{
|
||||||
char *dp = (char *) (&data);
|
char *dp = (char *) (&data);
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < sizeof (int); i++)
|
for (i = 0; i < (int) sizeof (int); i++)
|
||||||
{
|
{
|
||||||
if (!dcache_poke_byte (dcache, addr + i, dp + i))
|
if (!dcache_poke_byte (dcache, addr + i, dp + i))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -335,7 +335,6 @@ init_array_element (array, element, exp, pos, noside, low_bound, high_bound)
|
||||||
else if (exp->elts[*pos].opcode == BINOP_RANGE)
|
else if (exp->elts[*pos].opcode == BINOP_RANGE)
|
||||||
{
|
{
|
||||||
LONGEST low, high;
|
LONGEST low, high;
|
||||||
value_ptr val;
|
|
||||||
(*pos)++;
|
(*pos)++;
|
||||||
low = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
|
low = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
|
||||||
high = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
|
high = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
|
||||||
|
@ -460,11 +459,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
|
||||||
|
|
||||||
case OP_BOOL:
|
case OP_BOOL:
|
||||||
(*pos) += 2;
|
(*pos) += 2;
|
||||||
if (current_language->la_language == language_fortran)
|
return value_from_longest (LA_BOOL_TYPE,
|
||||||
return value_from_longest (builtin_type_f_logical_s2,
|
|
||||||
exp->elts[pc + 1].longconst);
|
|
||||||
else
|
|
||||||
return value_from_longest (builtin_type_chill_bool,
|
|
||||||
exp->elts[pc + 1].longconst);
|
exp->elts[pc + 1].longconst);
|
||||||
|
|
||||||
case OP_INTERNALVAR:
|
case OP_INTERNALVAR:
|
||||||
|
@ -698,7 +693,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
|
||||||
/* If one is virtual, then all are virtual. */
|
/* If one is virtual, then all are virtual. */
|
||||||
if (TYPE_FN_FIELD_VIRTUAL_P (f, 0))
|
if (TYPE_FN_FIELD_VIRTUAL_P (f, 0))
|
||||||
for (j = TYPE_FN_FIELDLIST_LENGTH (basetype, i) - 1; j >= 0; --j)
|
for (j = TYPE_FN_FIELDLIST_LENGTH (basetype, i) - 1; j >= 0; --j)
|
||||||
if (TYPE_FN_FIELD_VOFFSET (f, j) == fnoffset)
|
if ((int) TYPE_FN_FIELD_VOFFSET (f, j) == fnoffset)
|
||||||
{
|
{
|
||||||
value_ptr temp = value_ind (arg2);
|
value_ptr temp = value_ind (arg2);
|
||||||
arg1 = value_virtual_fn_field (&temp, f, j, domain_type, 0);
|
arg1 = value_virtual_fn_field (&temp, f, j, domain_type, 0);
|
||||||
|
|
10
gdb/f-lang.c
10
gdb/f-lang.c
|
@ -1,5 +1,5 @@
|
||||||
/* Fortran language support routines for GDB, the GNU debugger.
|
/* Fortran language support routines for GDB, the GNU debugger.
|
||||||
Copyright 1993, 1994 Free Software Foundation, Inc.
|
Copyright 1993, 1994, 1996 Free Software Foundation, Inc.
|
||||||
Contributed by Motorola. Adapted from the C parser by Farooq Butt
|
Contributed by Motorola. Adapted from the C parser by Farooq Butt
|
||||||
(fmbutt@engage.sps.mot.com).
|
(fmbutt@engage.sps.mot.com).
|
||||||
|
|
||||||
|
@ -582,13 +582,16 @@ SAVED_F77_COMMON_PTR current_common=NULL; /* Ptr to current COMMON */
|
||||||
|
|
||||||
static SAVED_BF_PTR saved_bf_list=NULL; /* Ptr to (.bf,function)
|
static SAVED_BF_PTR saved_bf_list=NULL; /* Ptr to (.bf,function)
|
||||||
list*/
|
list*/
|
||||||
|
#if 0
|
||||||
static SAVED_BF_PTR saved_bf_list_end=NULL; /* Ptr to above list's end */
|
static SAVED_BF_PTR saved_bf_list_end=NULL; /* Ptr to above list's end */
|
||||||
|
#endif
|
||||||
static SAVED_BF_PTR current_head_bf_list=NULL; /* Current head of above list
|
static SAVED_BF_PTR current_head_bf_list=NULL; /* Current head of above list
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if 0
|
||||||
static SAVED_BF_PTR tmp_bf_ptr; /* Generic temporary for use
|
static SAVED_BF_PTR tmp_bf_ptr; /* Generic temporary for use
|
||||||
in macros */
|
in macros */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The following function simply enters a given common block onto
|
/* The following function simply enters a given common block onto
|
||||||
the global common block chain */
|
the global common block chain */
|
||||||
|
@ -824,6 +827,7 @@ void patch_all_commons_by_name (name, offset, secnum)
|
||||||
first by a queueing algorithm and upon failure fall back to
|
first by a queueing algorithm and upon failure fall back to
|
||||||
a linear scan. */
|
a linear scan. */
|
||||||
|
|
||||||
|
#if 0
|
||||||
#define ADD_BF_SYMNUM(bf_sym,fcn_sym) \
|
#define ADD_BF_SYMNUM(bf_sym,fcn_sym) \
|
||||||
\
|
\
|
||||||
if (saved_bf_list == NULL) \
|
if (saved_bf_list == NULL) \
|
||||||
|
@ -848,7 +852,7 @@ else \
|
||||||
saved_bf_list_end->next = tmp_bf_ptr; \
|
saved_bf_list_end->next = tmp_bf_ptr; \
|
||||||
saved_bf_list_end = tmp_bf_ptr; \
|
saved_bf_list_end = tmp_bf_ptr; \
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This function frees the entire (.bf,function) list */
|
/* This function frees the entire (.bf,function) list */
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,7 @@ f_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
|
||||||
case TYPE_CODE_MEMBER:
|
case TYPE_CODE_MEMBER:
|
||||||
case TYPE_CODE_REF:
|
case TYPE_CODE_REF:
|
||||||
case TYPE_CODE_COMPLEX:
|
case TYPE_CODE_COMPLEX:
|
||||||
|
case TYPE_CODE_TYPEDEF:
|
||||||
/* These types need no prefix. They are listed here so that
|
/* These types need no prefix. They are listed here so that
|
||||||
gcc -Wall will reveal any types that haven't been handled. */
|
gcc -Wall will reveal any types that haven't been handled. */
|
||||||
break;
|
break;
|
||||||
|
@ -299,6 +300,7 @@ f_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
|
||||||
case TYPE_CODE_METHOD:
|
case TYPE_CODE_METHOD:
|
||||||
case TYPE_CODE_MEMBER:
|
case TYPE_CODE_MEMBER:
|
||||||
case TYPE_CODE_COMPLEX:
|
case TYPE_CODE_COMPLEX:
|
||||||
|
case TYPE_CODE_TYPEDEF:
|
||||||
/* These types do not need a suffix. They are listed so that
|
/* These types do not need a suffix. They are listed so that
|
||||||
gcc -Wall will report types that may not have been considered. */
|
gcc -Wall will report types that may not have been considered. */
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Find a variable's value in memory, for GDB, the GNU debugger.
|
/* Find a variable's value in memory, for GDB, the GNU debugger.
|
||||||
Copyright 1986, 1987, 1989, 1991, 1994, 1995 Free Software Foundation, Inc.
|
Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ extract_signed_integer (addr, len)
|
||||||
unsigned char *startaddr = (unsigned char *)addr;
|
unsigned char *startaddr = (unsigned char *)addr;
|
||||||
unsigned char *endaddr = startaddr + len;
|
unsigned char *endaddr = startaddr + len;
|
||||||
|
|
||||||
if (len > sizeof (LONGEST))
|
if (len > (int) sizeof (LONGEST))
|
||||||
error ("\
|
error ("\
|
||||||
That operation is not available on integers of more than %d bytes.",
|
That operation is not available on integers of more than %d bytes.",
|
||||||
sizeof (LONGEST));
|
sizeof (LONGEST));
|
||||||
|
@ -91,7 +91,7 @@ extract_unsigned_integer (addr, len)
|
||||||
unsigned char *startaddr = (unsigned char *)addr;
|
unsigned char *startaddr = (unsigned char *)addr;
|
||||||
unsigned char *endaddr = startaddr + len;
|
unsigned char *endaddr = startaddr + len;
|
||||||
|
|
||||||
if (len > sizeof (unsigned LONGEST))
|
if (len > (int) sizeof (unsigned LONGEST))
|
||||||
error ("\
|
error ("\
|
||||||
That operation is not available on integers of more than %d bytes.",
|
That operation is not available on integers of more than %d bytes.",
|
||||||
sizeof (unsigned LONGEST));
|
sizeof (unsigned LONGEST));
|
||||||
|
@ -112,6 +112,58 @@ That operation is not available on integers of more than %d bytes.",
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Sometimes a long long unsigned integer can be extracted as a
|
||||||
|
LONGEST value. This is done so that we can print these values
|
||||||
|
better. If this integer can be converted to a LONGEST, this
|
||||||
|
function returns 1 and sets *PVAL. Otherwise it returns 0. */
|
||||||
|
|
||||||
|
int
|
||||||
|
extract_long_unsigned_integer (addr, orig_len, pval)
|
||||||
|
PTR addr;
|
||||||
|
int orig_len;
|
||||||
|
LONGEST *pval;
|
||||||
|
{
|
||||||
|
char *p, *first_addr;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
len = orig_len;
|
||||||
|
if (TARGET_BYTE_ORDER == BIG_ENDIAN)
|
||||||
|
{
|
||||||
|
for (p = (char *) addr;
|
||||||
|
len > (int) sizeof (LONGEST) && p < (char *) addr + orig_len;
|
||||||
|
p++)
|
||||||
|
{
|
||||||
|
if (*p == 0)
|
||||||
|
len--;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
first_addr = p;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
first_addr = (char *) addr;
|
||||||
|
for (p = (char *) addr + orig_len - 1;
|
||||||
|
len > (int) sizeof (LONGEST) && p >= (char *) addr;
|
||||||
|
p--)
|
||||||
|
{
|
||||||
|
if (*p == 0)
|
||||||
|
len--;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (len <= (int) sizeof (LONGEST))
|
||||||
|
{
|
||||||
|
*pval = (LONGEST) extract_unsigned_integer (first_addr,
|
||||||
|
sizeof (LONGEST));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
CORE_ADDR
|
CORE_ADDR
|
||||||
extract_address (addr, len)
|
extract_address (addr, len)
|
||||||
PTR addr;
|
PTR addr;
|
||||||
|
@ -247,9 +299,9 @@ extract_floating (addr, len)
|
||||||
SWAP_FLOATING (&retval, sizeof (retval));
|
SWAP_FLOATING (&retval, sizeof (retval));
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
else if (len == sizeof (long double))
|
else if (len == sizeof (DOUBLEST))
|
||||||
{
|
{
|
||||||
long double retval;
|
DOUBLEST retval;
|
||||||
memcpy (&retval, addr, sizeof (retval));
|
memcpy (&retval, addr, sizeof (retval));
|
||||||
SWAP_FLOATING (&retval, sizeof (retval));
|
SWAP_FLOATING (&retval, sizeof (retval));
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -279,7 +331,7 @@ store_floating (addr, len, val)
|
||||||
SWAP_FLOATING (&doubleval, sizeof (doubleval));
|
SWAP_FLOATING (&doubleval, sizeof (doubleval));
|
||||||
memcpy (addr, &doubleval, sizeof (doubleval));
|
memcpy (addr, &doubleval, sizeof (doubleval));
|
||||||
}
|
}
|
||||||
else if (len == sizeof (long double))
|
else if (len == sizeof (DOUBLEST))
|
||||||
{
|
{
|
||||||
SWAP_FLOATING (&val, sizeof (val));
|
SWAP_FLOATING (&val, sizeof (val));
|
||||||
memcpy (addr, &val, sizeof (val));
|
memcpy (addr, &val, sizeof (val));
|
||||||
|
|
|
@ -1126,7 +1126,7 @@ re_match_2 (pbufp, string1, size1, string2, size2, pos, regs, mstop)
|
||||||
/* Initialize \) text positions to -1
|
/* Initialize \) text positions to -1
|
||||||
to mark ones that no \( or \) has been seen for. */
|
to mark ones that no \( or \) has been seen for. */
|
||||||
|
|
||||||
for (mcnt = 0; mcnt < sizeof (regend) / sizeof (*regend); mcnt++)
|
for (mcnt = 0; mcnt < (int) (sizeof (regend) / sizeof (*regend)); mcnt++)
|
||||||
regend[mcnt] = (unsigned char *) -1;
|
regend[mcnt] = (unsigned char *) -1;
|
||||||
|
|
||||||
/* `p' scans through the pattern as `d' scans through the data.
|
/* `p' scans through the pattern as `d' scans through the data.
|
||||||
|
|
|
@ -1027,7 +1027,7 @@ do_registers_info (regnum, fpregs)
|
||||||
|
|
||||||
/* Else if virtual format is too long for printf,
|
/* Else if virtual format is too long for printf,
|
||||||
print in hex a byte at a time. */
|
print in hex a byte at a time. */
|
||||||
else if (REGISTER_VIRTUAL_SIZE (i) > sizeof (long))
|
else if (REGISTER_VIRTUAL_SIZE (i) > (int) sizeof (long))
|
||||||
{
|
{
|
||||||
register int j;
|
register int j;
|
||||||
printf_filtered ("0x");
|
printf_filtered ("0x");
|
||||||
|
@ -1173,8 +1173,11 @@ attach_command (args, from_tty)
|
||||||
|
|
||||||
#ifdef SOLIB_ADD
|
#ifdef SOLIB_ADD
|
||||||
if (auto_solib_add)
|
if (auto_solib_add)
|
||||||
|
{
|
||||||
/* Add shared library symbols from the newly attached process, if any. */
|
/* Add shared library symbols from the newly attached process, if any. */
|
||||||
SOLIB_ADD ((char *)0, from_tty, (struct target_ops *)0);
|
SOLIB_ADD ((char *)0, from_tty, (struct target_ops *)0);
|
||||||
|
re_enable_breakpoints_in_shlibs ();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
normal_stop ();
|
normal_stop ();
|
||||||
|
|
|
@ -22,6 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include "inferior.h"
|
#include "inferior.h"
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
#include "gdb_string.h"
|
#include "gdb_string.h"
|
||||||
|
#include "wait.h"
|
||||||
|
#include "command.h"
|
||||||
|
|
||||||
#ifdef USG
|
#ifdef USG
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -519,12 +521,14 @@ udot_info ()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif /* !defined (CHILD_XFER_MEMORY). */
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_initialize_infptrace ()
|
_initialize_infptrace ()
|
||||||
{
|
{
|
||||||
|
#if !defined (CHILD_XFER_MEMORY)
|
||||||
add_info ("udot", udot_info,
|
add_info ("udot", udot_info,
|
||||||
"Print contents of kernel ``struct user'' for current child.");
|
"Print contents of kernel ``struct user'' for current child.");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* !defined (CHILD_XFER_MEMORY). */
|
|
||||||
|
|
|
@ -799,7 +799,7 @@ lang_bool_type ()
|
||||||
sym = lookup_symbol ("logical", NULL, VAR_NAMESPACE, NULL, NULL);
|
sym = lookup_symbol ("logical", NULL, VAR_NAMESPACE, NULL, NULL);
|
||||||
if (sym)
|
if (sym)
|
||||||
{
|
{
|
||||||
struct type *type = SYMBOL_TYPE (sym);
|
type = SYMBOL_TYPE (sym);
|
||||||
if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
|
if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@ -808,7 +808,7 @@ lang_bool_type ()
|
||||||
sym = lookup_symbol ("bool", NULL, VAR_NAMESPACE, NULL, NULL);
|
sym = lookup_symbol ("bool", NULL, VAR_NAMESPACE, NULL, NULL);
|
||||||
if (sym)
|
if (sym)
|
||||||
{
|
{
|
||||||
struct type *type = SYMBOL_TYPE (sym);
|
type = SYMBOL_TYPE (sym);
|
||||||
if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
|
if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -829,7 +829,7 @@ yylex ()
|
||||||
|
|
||||||
|
|
||||||
/* See if it is a special token of length 2 */
|
/* See if it is a special token of length 2 */
|
||||||
for( i = 0 ; i < sizeof tokentab2 / sizeof tokentab2[0] ; i++)
|
for( i = 0 ; i < (int) (sizeof tokentab2 / sizeof tokentab2[0]) ; i++)
|
||||||
if(STREQN(tokentab2[i].name, tokstart, 2))
|
if(STREQN(tokentab2[i].name, tokstart, 2))
|
||||||
{
|
{
|
||||||
lexptr += 2;
|
lexptr += 2;
|
||||||
|
@ -986,7 +986,7 @@ yylex ()
|
||||||
lexptr += namelen;
|
lexptr += namelen;
|
||||||
|
|
||||||
/* Lookup special keywords */
|
/* Lookup special keywords */
|
||||||
for(i = 0 ; i < sizeof(keytab) / sizeof(keytab[0]) ; i++)
|
for(i = 0 ; i < (int) (sizeof(keytab) / sizeof(keytab[0])) ; i++)
|
||||||
if(namelen == strlen(keytab[i].keyw) && STREQN(tokstart,keytab[i].keyw,namelen))
|
if(namelen == strlen(keytab[i].keyw) && STREQN(tokstart,keytab[i].keyw,namelen))
|
||||||
return keytab[i].token;
|
return keytab[i].token;
|
||||||
|
|
||||||
|
@ -1048,6 +1048,7 @@ yylex ()
|
||||||
error("internal: Undefined class in m2lex()");
|
error("internal: Undefined class in m2lex()");
|
||||||
|
|
||||||
case LOC_LABEL:
|
case LOC_LABEL:
|
||||||
|
case LOC_UNRESOLVED:
|
||||||
error("internal: Unforseen case in m2lex()");
|
error("internal: Unforseen case in m2lex()");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
21
gdb/main.c
21
gdb/main.c
|
@ -16,7 +16,7 @@ GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
@ -140,7 +140,7 @@ main (argc, argv)
|
||||||
current_directory = gdb_dirbuf;
|
current_directory = gdb_dirbuf;
|
||||||
|
|
||||||
/* Parse arguments and options. */
|
/* Parse arguments and options. */
|
||||||
#ifndef WIN32
|
#ifndef WINGDB
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
/* When var field is 0, use flag field to record the equivalent
|
/* When var field is 0, use flag field to record the equivalent
|
||||||
|
@ -297,6 +297,10 @@ main (argc, argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If --help or --version, disable window interface. */
|
||||||
|
if (print_help || print_version)
|
||||||
|
use_windows = 0;
|
||||||
|
|
||||||
/* OK, that's all the options. The other arguments are filenames. */
|
/* OK, that's all the options. The other arguments are filenames. */
|
||||||
count = 0;
|
count = 0;
|
||||||
for (; optind < argc; optind++)
|
for (; optind < argc; optind++)
|
||||||
|
@ -413,6 +417,7 @@ GDB manual (available as on-line info or a printed manual).\n", gdb_stdout);
|
||||||
strcpy (homeinit, getenv ("HOME"));
|
strcpy (homeinit, getenv ("HOME"));
|
||||||
strcat (homeinit, "/");
|
strcat (homeinit, "/");
|
||||||
strcat (homeinit, gdbinit);
|
strcat (homeinit, gdbinit);
|
||||||
|
|
||||||
if (!inhibit_gdbinit && access (homeinit, R_OK) == 0)
|
if (!inhibit_gdbinit && access (homeinit, R_OK) == 0)
|
||||||
{
|
{
|
||||||
if (!SET_TOP_LEVEL ())
|
if (!SET_TOP_LEVEL ())
|
||||||
|
@ -567,7 +572,7 @@ GDB manual (available as on-line info or a printed manual).\n", gdb_stdout);
|
||||||
/* The default command loop.
|
/* The default command loop.
|
||||||
The WIN32 Gui calls this main to set up gdb's state, and
|
The WIN32 Gui calls this main to set up gdb's state, and
|
||||||
has its own command loop. */
|
has its own command loop. */
|
||||||
#if !defined (WIN32)
|
#if !defined (WINGDB)
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (!SET_TOP_LEVEL ())
|
if (!SET_TOP_LEVEL ())
|
||||||
|
@ -594,16 +599,6 @@ init_proc ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
proc_wait (pid, status)
|
|
||||||
int pid;
|
|
||||||
int *status;
|
|
||||||
{
|
|
||||||
#ifndef __GO32__
|
|
||||||
return wait (status);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
proc_remove_foreign (pid)
|
proc_remove_foreign (pid)
|
||||||
int pid;
|
int pid;
|
||||||
|
|
|
@ -32,6 +32,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include "gdbcore.h"
|
#include "gdbcore.h"
|
||||||
#include "expression.h" /* For language.h */
|
#include "expression.h" /* For language.h */
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
|
#include "symfile.h"
|
||||||
|
#include "objfiles.h"
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -249,8 +251,6 @@ maintenance_print_statistics (args, from_tty)
|
||||||
char *args;
|
char *args;
|
||||||
int from_tty;
|
int from_tty;
|
||||||
{
|
{
|
||||||
int temp;
|
|
||||||
|
|
||||||
print_objfile_statistics ();
|
print_objfile_statistics ();
|
||||||
print_symbol_bcache_statistics ();
|
print_symbol_bcache_statistics ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,7 +270,6 @@ lookup_minimal_symbol_solib_trampoline (name, sfile, objf)
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
struct minimal_symbol *msymbol;
|
struct minimal_symbol *msymbol;
|
||||||
struct minimal_symbol *found_symbol = NULL;
|
struct minimal_symbol *found_symbol = NULL;
|
||||||
struct minimal_symbol *found_file_symbol = NULL;
|
|
||||||
|
|
||||||
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
|
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
|
||||||
if (sfile != NULL)
|
if (sfile != NULL)
|
||||||
|
|
|
@ -175,6 +175,7 @@ struct objstats {
|
||||||
#define OBJSTAT(objfile, expr) (objfile -> stats.expr)
|
#define OBJSTAT(objfile, expr) (objfile -> stats.expr)
|
||||||
#define OBJSTATS struct objstats stats
|
#define OBJSTATS struct objstats stats
|
||||||
extern void print_objfile_statistics PARAMS ((void));
|
extern void print_objfile_statistics PARAMS ((void));
|
||||||
|
extern void print_symbol_bcache_statistics PARAMS ((void));
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
|
@ -110,6 +110,8 @@ extern void write_exp_elt_block PARAMS ((struct block *));
|
||||||
extern void write_exp_msymbol PARAMS ((struct minimal_symbol *,
|
extern void write_exp_msymbol PARAMS ((struct minimal_symbol *,
|
||||||
struct type *, struct type *));
|
struct type *, struct type *));
|
||||||
|
|
||||||
|
extern void write_dollar_variable PARAMS ((struct stoken str));
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
start_arglist PARAMS ((void));
|
start_arglist PARAMS ((void));
|
||||||
|
|
||||||
|
|
45
gdb/remote.c
45
gdb/remote.c
|
@ -108,6 +108,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
for step or cont : SAA where AA is the
|
for step or cont : SAA where AA is the
|
||||||
signal number.
|
signal number.
|
||||||
|
|
||||||
|
detach D Reply OK.
|
||||||
|
|
||||||
There is no immediate reply to step or cont.
|
There is no immediate reply to step or cont.
|
||||||
The reply comes when the machine stops.
|
The reply comes when the machine stops.
|
||||||
It is SAA AA is the signal number.
|
It is SAA AA is the signal number.
|
||||||
|
@ -274,6 +276,13 @@ extern struct target_ops extended_remote_ops; /* Forward decl */
|
||||||
|
|
||||||
static int remote_timeout = 2;
|
static int remote_timeout = 2;
|
||||||
|
|
||||||
|
/* This variable chooses whether to send a ^C or a break when the user
|
||||||
|
requests program interruption. Although ^C is usually what remote
|
||||||
|
systems expect, and that is the default here, sometimes a break is
|
||||||
|
preferable instead. */
|
||||||
|
|
||||||
|
static int remote_break;
|
||||||
|
|
||||||
/* Descriptor for I/O to remote machine. Initialize it to NULL so that
|
/* Descriptor for I/O to remote machine. Initialize it to NULL so that
|
||||||
remote_open knows that we don't have a file open when the program
|
remote_open knows that we don't have a file open when the program
|
||||||
starts. */
|
starts. */
|
||||||
|
@ -561,22 +570,25 @@ device is attached to the remote system (e.g. /dev/ttya).");
|
||||||
pop_target();
|
pop_target();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remote_detach()
|
/* This takes a program previously attached to and detaches it. After
|
||||||
takes a program previously attached to and detaches it.
|
this is done, GDB can be used to debug some other program. We
|
||||||
We better not have left any breakpoints
|
better not have left any breakpoints in the target program or it'll
|
||||||
in the program or it'll die when it hits one.
|
die when it hits one. */
|
||||||
Close the open connection to the remote debugger.
|
|
||||||
Use this when you want to detach and do something else
|
|
||||||
with your gdb. */
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
remote_detach (args, from_tty)
|
remote_detach (args, from_tty)
|
||||||
char *args;
|
char *args;
|
||||||
int from_tty;
|
int from_tty;
|
||||||
{
|
{
|
||||||
|
char buf[PBUFSIZ];
|
||||||
|
|
||||||
if (args)
|
if (args)
|
||||||
error ("Argument given to \"detach\" when remotely debugging.");
|
error ("Argument given to \"detach\" when remotely debugging.");
|
||||||
|
|
||||||
|
/* Tell the remote target to detach. */
|
||||||
|
strcpy (buf, "D");
|
||||||
|
remote_send (buf);
|
||||||
|
|
||||||
pop_target ();
|
pop_target ();
|
||||||
if (from_tty)
|
if (from_tty)
|
||||||
puts_filtered ("Ending remote debugging.\n");
|
puts_filtered ("Ending remote debugging.\n");
|
||||||
|
@ -656,7 +668,11 @@ remote_interrupt (signo)
|
||||||
if (remote_debug)
|
if (remote_debug)
|
||||||
printf_unfiltered ("remote_interrupt called\n");
|
printf_unfiltered ("remote_interrupt called\n");
|
||||||
|
|
||||||
SERIAL_WRITE (remote_desc, "\003", 1); /* Send a ^C */
|
/* Send a break or a ^C, depending on user preference. */
|
||||||
|
if (remote_break)
|
||||||
|
SERIAL_SEND_BREAK (remote_desc);
|
||||||
|
else
|
||||||
|
SERIAL_WRITE (remote_desc, "\003", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void (*ofunc)();
|
static void (*ofunc)();
|
||||||
|
@ -1126,7 +1142,7 @@ remote_read_bytes (memaddr, myaddr, len)
|
||||||
|
|
||||||
/* FIXME-32x64: Need a version of print_address_numeric which puts the
|
/* FIXME-32x64: Need a version of print_address_numeric which puts the
|
||||||
result in a buffer like sprintf. */
|
result in a buffer like sprintf. */
|
||||||
sprintf (buf, "m%lx,%x", (unsigned long) memaddr, todo);
|
sprintf (buf, "m%lx,%x", (unsigned long) memaddr + done, todo);
|
||||||
putpkt (buf);
|
putpkt (buf);
|
||||||
getpkt (buf, 0);
|
getpkt (buf, 0);
|
||||||
|
|
||||||
|
@ -1149,7 +1165,7 @@ remote_read_bytes (memaddr, myaddr, len)
|
||||||
if (p[0] == 0 || p[1] == 0)
|
if (p[0] == 0 || p[1] == 0)
|
||||||
/* Reply is short. This means that we were able to read only part
|
/* Reply is short. This means that we were able to read only part
|
||||||
of what we wanted to. */
|
of what we wanted to. */
|
||||||
break;
|
return i + done;
|
||||||
myaddr[i + done] = fromhex (p[0]) * 16 + fromhex (p[1]);
|
myaddr[i + done] = fromhex (p[0]) * 16 + fromhex (p[1]);
|
||||||
p += 2;
|
p += 2;
|
||||||
}
|
}
|
||||||
|
@ -1315,7 +1331,7 @@ putpkt (buf)
|
||||||
/* Copy the packet into buffer BUF2, encapsulating it
|
/* Copy the packet into buffer BUF2, encapsulating it
|
||||||
and giving it a checksum. */
|
and giving it a checksum. */
|
||||||
|
|
||||||
if (cnt > sizeof(buf2) - 5) /* Prosanity check */
|
if (cnt > (int) sizeof (buf2) - 5) /* Prosanity check */
|
||||||
abort();
|
abort();
|
||||||
|
|
||||||
p = buf2;
|
p = buf2;
|
||||||
|
@ -1731,10 +1747,8 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", /* to_doc */
|
||||||
remote_prepare_to_store, /* to_prepare_to_store */
|
remote_prepare_to_store, /* to_prepare_to_store */
|
||||||
remote_xfer_memory, /* to_xfer_memory */
|
remote_xfer_memory, /* to_xfer_memory */
|
||||||
remote_files_info, /* to_files_info */
|
remote_files_info, /* to_files_info */
|
||||||
|
|
||||||
remote_insert_breakpoint, /* to_insert_breakpoint */
|
remote_insert_breakpoint, /* to_insert_breakpoint */
|
||||||
remote_remove_breakpoint, /* to_remove_breakpoint */
|
remote_remove_breakpoint, /* to_remove_breakpoint */
|
||||||
|
|
||||||
NULL, /* to_terminal_init */
|
NULL, /* to_terminal_init */
|
||||||
NULL, /* to_terminal_inferior */
|
NULL, /* to_terminal_inferior */
|
||||||
NULL, /* to_terminal_ours_for_output */
|
NULL, /* to_terminal_ours_for_output */
|
||||||
|
@ -1817,4 +1831,9 @@ _initialize_remote ()
|
||||||
var_integer, (char *)&remote_timeout,
|
var_integer, (char *)&remote_timeout,
|
||||||
"Set timeout value for remote read.\n", &setlist),
|
"Set timeout value for remote read.\n", &setlist),
|
||||||
&showlist);
|
&showlist);
|
||||||
|
|
||||||
|
add_show_from_set (add_set_cmd ("remotebreak", no_class,
|
||||||
|
var_integer, (char *)&remote_break,
|
||||||
|
"Set whether to send break if interrupted.\n", &setlist),
|
||||||
|
&showlist);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,3 +46,5 @@ extern struct value * scm_evaluate_string PARAMS ((char*, int));
|
||||||
extern struct type *builtin_type_scm;
|
extern struct type *builtin_type_scm;
|
||||||
|
|
||||||
extern int scm_parse ();
|
extern int scm_parse ();
|
||||||
|
|
||||||
|
extern LONGEST scm_unpack PARAMS ((struct type *, char *, enum type_code));
|
||||||
|
|
|
@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#include "signals.h"
|
#include "signals.h"
|
||||||
|
#include "gdb_string.h"
|
||||||
|
|
||||||
struct tcp_ttystate
|
struct tcp_ttystate
|
||||||
{
|
{
|
||||||
|
@ -66,7 +67,7 @@ tcp_open(scb, name)
|
||||||
if (!port_str)
|
if (!port_str)
|
||||||
error ("tcp_open: No colon in host name!"); /* Shouldn't ever happen */
|
error ("tcp_open: No colon in host name!"); /* Shouldn't ever happen */
|
||||||
|
|
||||||
tmp = min (port_str - name, sizeof hostname - 1);
|
tmp = min (port_str - name, (int) sizeof hostname - 1);
|
||||||
strncpy (hostname, name, tmp); /* Don't want colon */
|
strncpy (hostname, name, tmp); /* Don't want colon */
|
||||||
hostname[tmp] = '\000'; /* Tie off host name */
|
hostname[tmp] = '\000'; /* Tie off host name */
|
||||||
port = atoi (port_str + 1);
|
port = atoi (port_str + 1);
|
||||||
|
|
|
@ -3812,7 +3812,6 @@ cleanup_undefined_types ()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
badtype:
|
|
||||||
{
|
{
|
||||||
static struct complaint msg = {"\
|
static struct complaint msg = {"\
|
||||||
GDB internal error. cleanup_undefined_types with bad type %d.", 0, 0};
|
GDB internal error. cleanup_undefined_types with bad type %d.", 0, 0};
|
||||||
|
|
|
@ -43,6 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include "gdb_string.h"
|
#include "gdb_string.h"
|
||||||
#include "gdb_stat.h"
|
#include "gdb_stat.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <time.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -273,7 +274,7 @@ obconcat (obstackp, s1, s2, s3)
|
||||||
|
|
||||||
int currently_reading_symtab = 0;
|
int currently_reading_symtab = 0;
|
||||||
|
|
||||||
static int
|
static void
|
||||||
decrement_reading_symtab (dummy)
|
decrement_reading_symtab (dummy)
|
||||||
void *dummy;
|
void *dummy;
|
||||||
{
|
{
|
||||||
|
@ -923,6 +924,8 @@ generic_load (filename, from_tty)
|
||||||
struct cleanup *old_cleanups;
|
struct cleanup *old_cleanups;
|
||||||
asection *s;
|
asection *s;
|
||||||
bfd *loadfile_bfd;
|
bfd *loadfile_bfd;
|
||||||
|
time_t start_time, end_time; /* Start and end times of download */
|
||||||
|
unsigned long data_count; /* Number of bytes transferred to memory */
|
||||||
|
|
||||||
loadfile_bfd = bfd_openr (filename, gnutarget);
|
loadfile_bfd = bfd_openr (filename, gnutarget);
|
||||||
if (loadfile_bfd == NULL)
|
if (loadfile_bfd == NULL)
|
||||||
|
@ -941,6 +944,8 @@ generic_load (filename, from_tty)
|
||||||
bfd_errmsg (bfd_get_error ()));
|
bfd_errmsg (bfd_get_error ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start_time = time (NULL);
|
||||||
|
|
||||||
for (s = loadfile_bfd->sections; s; s = s->next)
|
for (s = loadfile_bfd->sections; s; s = s->next)
|
||||||
{
|
{
|
||||||
if (s->flags & SEC_LOAD)
|
if (s->flags & SEC_LOAD)
|
||||||
|
@ -954,6 +959,8 @@ generic_load (filename, from_tty)
|
||||||
struct cleanup *old_chain;
|
struct cleanup *old_chain;
|
||||||
bfd_vma vma;
|
bfd_vma vma;
|
||||||
|
|
||||||
|
data_count += size;
|
||||||
|
|
||||||
buffer = xmalloc (size);
|
buffer = xmalloc (size);
|
||||||
old_chain = make_cleanup (free, buffer);
|
old_chain = make_cleanup (free, buffer);
|
||||||
|
|
||||||
|
@ -976,6 +983,8 @@ generic_load (filename, from_tty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end_time = time (NULL);
|
||||||
|
|
||||||
/* We were doing this in remote-mips.c, I suspect it is right
|
/* We were doing this in remote-mips.c, I suspect it is right
|
||||||
for other targets too. */
|
for other targets too. */
|
||||||
write_pc (loadfile_bfd->start_address);
|
write_pc (loadfile_bfd->start_address);
|
||||||
|
@ -986,6 +995,10 @@ generic_load (filename, from_tty)
|
||||||
loaded in. remote-nindy.c had no call to symbol_file_add, but remote-vx.c
|
loaded in. remote-nindy.c had no call to symbol_file_add, but remote-vx.c
|
||||||
does. */
|
does. */
|
||||||
|
|
||||||
|
if (end_time != start_time)
|
||||||
|
printf_filtered ("Transfer rate: %d bits/sec.\n",
|
||||||
|
(data_count * 8)/(end_time - start_time));
|
||||||
|
|
||||||
do_cleanups (old_cleanups);
|
do_cleanups (old_cleanups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1182,17 +1195,17 @@ reread_symbols ()
|
||||||
enough? */
|
enough? */
|
||||||
if (objfile->global_psymbols.list)
|
if (objfile->global_psymbols.list)
|
||||||
mfree (objfile->md, objfile->global_psymbols.list);
|
mfree (objfile->md, objfile->global_psymbols.list);
|
||||||
objfile->global_psymbols.list = NULL;
|
memset (&objfile -> global_psymbols, 0,
|
||||||
objfile->global_psymbols.next = NULL;
|
sizeof (objfile -> global_psymbols));
|
||||||
objfile->global_psymbols.size = 0;
|
|
||||||
if (objfile->static_psymbols.list)
|
if (objfile->static_psymbols.list)
|
||||||
mfree (objfile->md, objfile->static_psymbols.list);
|
mfree (objfile->md, objfile->static_psymbols.list);
|
||||||
objfile->static_psymbols.list = NULL;
|
memset (&objfile -> static_psymbols, 0,
|
||||||
objfile->static_psymbols.next = NULL;
|
sizeof (objfile -> static_psymbols));
|
||||||
objfile->static_psymbols.size = 0;
|
|
||||||
|
|
||||||
/* Free the obstacks for non-reusable objfiles */
|
/* Free the obstacks for non-reusable objfiles */
|
||||||
obstack_free (&objfile -> psymbol_cache.cache, 0);
|
obstack_free (&objfile -> psymbol_cache.cache, 0);
|
||||||
|
memset (&objfile -> psymbol_cache, 0,
|
||||||
|
sizeof (objfile -> psymbol_cache));
|
||||||
obstack_free (&objfile -> psymbol_obstack, 0);
|
obstack_free (&objfile -> psymbol_obstack, 0);
|
||||||
obstack_free (&objfile -> symbol_obstack, 0);
|
obstack_free (&objfile -> symbol_obstack, 0);
|
||||||
obstack_free (&objfile -> type_obstack, 0);
|
obstack_free (&objfile -> type_obstack, 0);
|
||||||
|
|
|
@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "obstack.h"
|
#include "obstack.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
|
#include "bcache.h"
|
||||||
|
|
||||||
#include "gdb_string.h"
|
#include "gdb_string.h"
|
||||||
|
|
||||||
|
@ -160,8 +161,8 @@ print_symbol_bcache_statistics ()
|
||||||
immediate_quit++;
|
immediate_quit++;
|
||||||
ALL_OBJFILES (objfile)
|
ALL_OBJFILES (objfile)
|
||||||
{
|
{
|
||||||
printf_filtered ("Cached obstack statistics for '%s':\n", objfile -> name);
|
printf_filtered ("Byte cache statistics for '%s':\n", objfile -> name);
|
||||||
print_bcache_statistics (&objfile -> psymbol_cache, "partial symbol obstack");
|
print_bcache_statistics (&objfile -> psymbol_cache, "partial symbol cache");
|
||||||
}
|
}
|
||||||
immediate_quit--;
|
immediate_quit--;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1891,7 +1891,6 @@ command_line_input (prrompt, repeat, annotation_suffix)
|
||||||
char *p1;
|
char *p1;
|
||||||
char *rl;
|
char *rl;
|
||||||
char *local_prompt = prrompt;
|
char *local_prompt = prrompt;
|
||||||
register int c;
|
|
||||||
char *nline;
|
char *nline;
|
||||||
char got_eof = 0;
|
char got_eof = 0;
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ value_subscript (array, idx)
|
||||||
{
|
{
|
||||||
value_ptr bound;
|
value_ptr bound;
|
||||||
int c_style = current_language->c_style_arrays;
|
int c_style = current_language->c_style_arrays;
|
||||||
struct type *tarray, *tint;
|
struct type *tarray;
|
||||||
|
|
||||||
COERCE_REF (array);
|
COERCE_REF (array);
|
||||||
tarray = check_typedef (VALUE_TYPE (array));
|
tarray = check_typedef (VALUE_TYPE (array));
|
||||||
|
@ -174,7 +174,7 @@ value_subscript (array, idx)
|
||||||
LONGEST index = value_as_long (idx);
|
LONGEST index = value_as_long (idx);
|
||||||
value_ptr v;
|
value_ptr v;
|
||||||
int offset, byte, bit_index;
|
int offset, byte, bit_index;
|
||||||
LONGEST lowerbound, upperbound, word;
|
LONGEST lowerbound, upperbound;
|
||||||
get_discrete_bounds (range_type, &lowerbound, &upperbound);
|
get_discrete_bounds (range_type, &lowerbound, &upperbound);
|
||||||
if (index < lowerbound || index > upperbound)
|
if (index < lowerbound || index > upperbound)
|
||||||
error ("bitstring index out of range");
|
error ("bitstring index out of range");
|
||||||
|
@ -211,9 +211,9 @@ value_subscripted_rvalue (array, idx, lowerbound)
|
||||||
{
|
{
|
||||||
struct type *array_type = check_typedef (VALUE_TYPE (array));
|
struct type *array_type = check_typedef (VALUE_TYPE (array));
|
||||||
struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
|
struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
|
||||||
int elt_size = TYPE_LENGTH (elt_type);
|
unsigned int elt_size = TYPE_LENGTH (elt_type);
|
||||||
LONGEST index = value_as_long (idx);
|
LONGEST index = value_as_long (idx);
|
||||||
int elt_offs = elt_size * longest_to_int (index - lowerbound);
|
unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound);
|
||||||
value_ptr v;
|
value_ptr v;
|
||||||
|
|
||||||
if (index < lowerbound || elt_offs >= TYPE_LENGTH (array_type))
|
if (index < lowerbound || elt_offs >= TYPE_LENGTH (array_type))
|
||||||
|
@ -710,11 +710,11 @@ value_binop (arg1, arg2, op)
|
||||||
/* FIXME: This implements ANSI C rules (also correct for C++).
|
/* FIXME: This implements ANSI C rules (also correct for C++).
|
||||||
What about FORTRAN and chill? */
|
What about FORTRAN and chill? */
|
||||||
{
|
{
|
||||||
int promoted_len1 = TYPE_LENGTH (type1);
|
unsigned int promoted_len1 = TYPE_LENGTH (type1);
|
||||||
int promoted_len2 = TYPE_LENGTH (type2);
|
unsigned int promoted_len2 = TYPE_LENGTH (type2);
|
||||||
int is_unsigned1 = TYPE_UNSIGNED (type1);
|
int is_unsigned1 = TYPE_UNSIGNED (type1);
|
||||||
int is_unsigned2 = TYPE_UNSIGNED (type2);
|
int is_unsigned2 = TYPE_UNSIGNED (type2);
|
||||||
int result_len;
|
unsigned int result_len;
|
||||||
int unsigned_operation;
|
int unsigned_operation;
|
||||||
|
|
||||||
/* Determine type length and signedness after promotion for
|
/* Determine type length and signedness after promotion for
|
||||||
|
@ -1060,8 +1060,8 @@ value_equal (arg1, arg2)
|
||||||
return (CORE_ADDR) value_as_long (arg1) == value_as_pointer (arg2);
|
return (CORE_ADDR) value_as_long (arg1) == value_as_pointer (arg2);
|
||||||
|
|
||||||
else if (code1 == code2
|
else if (code1 == code2
|
||||||
&& ((len = TYPE_LENGTH (type1))
|
&& ((len = (int) TYPE_LENGTH (type1))
|
||||||
== TYPE_LENGTH (type2)))
|
== (int) TYPE_LENGTH (type2)))
|
||||||
{
|
{
|
||||||
p1 = VALUE_CONTENTS (arg1);
|
p1 = VALUE_CONTENTS (arg1);
|
||||||
p2 = VALUE_CONTENTS (arg2);
|
p2 = VALUE_CONTENTS (arg2);
|
||||||
|
@ -1204,7 +1204,7 @@ value_in (element, set)
|
||||||
value_as_long (element));
|
value_as_long (element));
|
||||||
if (member < 0)
|
if (member < 0)
|
||||||
error ("First argument of 'IN' not in range");
|
error ("First argument of 'IN' not in range");
|
||||||
return value_from_longest (builtin_type_chill_bool, member);
|
return value_from_longest (LA_BOOL_TYPE, member);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
14
gdb/valops.c
14
gdb/valops.c
|
@ -66,7 +66,9 @@ static value_ptr cast_into_complex PARAMS ((struct type *, value_ptr));
|
||||||
|
|
||||||
/* Flag for whether we want to abandon failed expression evals by default. */
|
/* Flag for whether we want to abandon failed expression evals by default. */
|
||||||
|
|
||||||
|
#if 0
|
||||||
static int auto_abandon = 0;
|
static int auto_abandon = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Find the address of function name NAME in the inferior. */
|
/* Find the address of function name NAME in the inferior. */
|
||||||
|
@ -470,7 +472,7 @@ value_assign (toval, fromval)
|
||||||
+ HOST_CHAR_BIT - 1)
|
+ HOST_CHAR_BIT - 1)
|
||||||
/ HOST_CHAR_BIT;
|
/ HOST_CHAR_BIT;
|
||||||
|
|
||||||
if (len > sizeof (LONGEST))
|
if (len > (int) sizeof (LONGEST))
|
||||||
error ("Can't handle bitfields which don't fit in a %d bit word.",
|
error ("Can't handle bitfields which don't fit in a %d bit word.",
|
||||||
sizeof (LONGEST) * HOST_CHAR_BIT);
|
sizeof (LONGEST) * HOST_CHAR_BIT);
|
||||||
|
|
||||||
|
@ -495,7 +497,7 @@ value_assign (toval, fromval)
|
||||||
char buffer[sizeof (LONGEST)];
|
char buffer[sizeof (LONGEST)];
|
||||||
int len = REGISTER_RAW_SIZE (VALUE_REGNO (toval));
|
int len = REGISTER_RAW_SIZE (VALUE_REGNO (toval));
|
||||||
|
|
||||||
if (len > sizeof (LONGEST))
|
if (len > (int) sizeof (LONGEST))
|
||||||
error ("Can't handle bitfields in registers larger than %d bits.",
|
error ("Can't handle bitfields in registers larger than %d bits.",
|
||||||
sizeof (LONGEST) * HOST_CHAR_BIT);
|
sizeof (LONGEST) * HOST_CHAR_BIT);
|
||||||
|
|
||||||
|
@ -624,7 +626,7 @@ Can't handle bitfield which doesn't fit in a single register.");
|
||||||
/* If the field does not entirely fill a LONGEST, then zero the sign bits.
|
/* If the field does not entirely fill a LONGEST, then zero the sign bits.
|
||||||
If the field is signed, and is negative, then sign extend. */
|
If the field is signed, and is negative, then sign extend. */
|
||||||
if ((VALUE_BITSIZE (toval) > 0)
|
if ((VALUE_BITSIZE (toval) > 0)
|
||||||
&& (VALUE_BITSIZE (toval) < 8 * sizeof (LONGEST)))
|
&& (VALUE_BITSIZE (toval) < 8 * (int) sizeof (LONGEST)))
|
||||||
{
|
{
|
||||||
LONGEST fieldval = value_as_long (fromval);
|
LONGEST fieldval = value_as_long (fromval);
|
||||||
LONGEST valmask = (((unsigned LONGEST) 1) << VALUE_BITSIZE (toval)) - 1;
|
LONGEST valmask = (((unsigned LONGEST) 1) << VALUE_BITSIZE (toval)) - 1;
|
||||||
|
@ -1075,7 +1077,7 @@ call_function_by_hand (function, nargs, args)
|
||||||
|
|
||||||
/* Create a call sequence customized for this function
|
/* Create a call sequence customized for this function
|
||||||
and the number of arguments for it. */
|
and the number of arguments for it. */
|
||||||
for (i = 0; i < sizeof dummy / sizeof (dummy[0]); i++)
|
for (i = 0; i < (int) (sizeof (dummy) / sizeof (dummy[0])); i++)
|
||||||
store_unsigned_integer (&dummy1[i * REGISTER_SIZE],
|
store_unsigned_integer (&dummy1[i * REGISTER_SIZE],
|
||||||
REGISTER_SIZE,
|
REGISTER_SIZE,
|
||||||
(unsigned LONGEST)dummy[i]);
|
(unsigned LONGEST)dummy[i]);
|
||||||
|
@ -1359,7 +1361,7 @@ value_array (lowbound, highbound, elemvec)
|
||||||
{
|
{
|
||||||
int nelem;
|
int nelem;
|
||||||
int idx;
|
int idx;
|
||||||
int typelength;
|
unsigned int typelength;
|
||||||
value_ptr val;
|
value_ptr val;
|
||||||
struct type *rangetype;
|
struct type *rangetype;
|
||||||
struct type *arraytype;
|
struct type *arraytype;
|
||||||
|
@ -1896,7 +1898,7 @@ destructor_name_p (name, type)
|
||||||
{
|
{
|
||||||
char *dname = type_name_no_tag (type);
|
char *dname = type_name_no_tag (type);
|
||||||
char *cp = strchr (dname, '<');
|
char *cp = strchr (dname, '<');
|
||||||
int len;
|
unsigned int len;
|
||||||
|
|
||||||
/* Do not compare the template part for template classes. */
|
/* Do not compare the template part for template classes. */
|
||||||
if (cp == NULL)
|
if (cp == NULL)
|
||||||
|
|
|
@ -147,8 +147,7 @@ val_print (type, valaddr, address, stream, format, deref_ref, recurse, pretty)
|
||||||
only a stub and we can't find and substitute its complete type, then
|
only a stub and we can't find and substitute its complete type, then
|
||||||
print appropriate string and return. */
|
print appropriate string and return. */
|
||||||
|
|
||||||
if (TYPE_FLAGS (real_type) & TYPE_FLAG_STUB
|
if (TYPE_FLAGS (real_type) & TYPE_FLAG_STUB)
|
||||||
|| TYPE_LENGTH (real_type) == 0)
|
|
||||||
{
|
{
|
||||||
fprintf_filtered (stream, "<incomplete type>");
|
fprintf_filtered (stream, "<incomplete type>");
|
||||||
gdb_flush (stream);
|
gdb_flush (stream);
|
||||||
|
@ -184,7 +183,9 @@ value_print (val, stream, format, pretty)
|
||||||
return LA_VALUE_PRINT (val, stream, format, pretty);
|
return LA_VALUE_PRINT (val, stream, format, pretty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called by various <lang>_val_print routines to print TYPE_CODE_INT's */
|
/* Called by various <lang>_val_print routines to print
|
||||||
|
TYPE_CODE_INT's. TYPE is the type. VALADDR is the address of the
|
||||||
|
value. STREAM is where to print the value. */
|
||||||
|
|
||||||
void
|
void
|
||||||
val_print_type_code_int (type, valaddr, stream)
|
val_print_type_code_int (type, valaddr, stream)
|
||||||
|
@ -192,74 +193,22 @@ val_print_type_code_int (type, valaddr, stream)
|
||||||
char *valaddr;
|
char *valaddr;
|
||||||
GDB_FILE *stream;
|
GDB_FILE *stream;
|
||||||
{
|
{
|
||||||
char *p;
|
|
||||||
/* Pointer to first (i.e. lowest address) nonzero character. */
|
|
||||||
char *first_addr;
|
|
||||||
unsigned int len;
|
|
||||||
|
|
||||||
if (TYPE_LENGTH (type) > sizeof (LONGEST))
|
if (TYPE_LENGTH (type) > sizeof (LONGEST))
|
||||||
{
|
{
|
||||||
if (TYPE_UNSIGNED (type))
|
LONGEST val;
|
||||||
{
|
|
||||||
/* First figure out whether the number in fact has zeros
|
|
||||||
in all its bytes more significant than least significant
|
|
||||||
sizeof (LONGEST) ones. */
|
|
||||||
len = TYPE_LENGTH (type);
|
|
||||||
|
|
||||||
if (TARGET_BYTE_ORDER == BIG_ENDIAN)
|
if (TYPE_UNSIGNED (type)
|
||||||
|
&& extract_long_unsigned_integer (valaddr, TYPE_LENGTH (type),
|
||||||
|
&val))
|
||||||
{
|
{
|
||||||
for (p = valaddr;
|
print_longest (stream, 'u', 0, val);
|
||||||
len > sizeof (LONGEST) && p < valaddr + TYPE_LENGTH (type);
|
|
||||||
p++)
|
|
||||||
{
|
|
||||||
if (*p == 0)
|
|
||||||
{
|
|
||||||
len--;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
break;
|
/* Signed, or we couldn't turn an unsigned value into a
|
||||||
}
|
LONGEST. For signed values, one could assume two's
|
||||||
}
|
complement (a reasonable assumption, I think) and do
|
||||||
first_addr = p;
|
better than this. */
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
first_addr = valaddr;
|
|
||||||
for (p = valaddr + TYPE_LENGTH (type) - 1;
|
|
||||||
len > sizeof (LONGEST) && p >= valaddr;
|
|
||||||
p--)
|
|
||||||
{
|
|
||||||
if (*p == 0)
|
|
||||||
{
|
|
||||||
len--;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (len <= sizeof (LONGEST))
|
|
||||||
{
|
|
||||||
/* The most significant bytes are zero, so we can just get
|
|
||||||
the least significant sizeof (LONGEST) bytes and print it
|
|
||||||
in decimal. */
|
|
||||||
print_longest (stream, 'u', 0,
|
|
||||||
extract_unsigned_integer (first_addr,
|
|
||||||
sizeof (LONGEST)));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* It is big, so print it in hex. */
|
|
||||||
print_hex_chars (stream, (unsigned char *) first_addr, len);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Signed. One could assume two's complement (a reasonable
|
|
||||||
assumption, I think) and do better than this. */
|
|
||||||
print_hex_chars (stream, (unsigned char *) valaddr,
|
print_hex_chars (stream, (unsigned char *) valaddr,
|
||||||
TYPE_LENGTH (type));
|
TYPE_LENGTH (type));
|
||||||
}
|
}
|
||||||
|
@ -427,7 +376,7 @@ print_floating (valaddr, type, stream)
|
||||||
struct type *type;
|
struct type *type;
|
||||||
GDB_FILE *stream;
|
GDB_FILE *stream;
|
||||||
{
|
{
|
||||||
double doub;
|
DOUBLEST doub;
|
||||||
int inv;
|
int inv;
|
||||||
unsigned len = TYPE_LENGTH (type);
|
unsigned len = TYPE_LENGTH (type);
|
||||||
|
|
||||||
|
@ -505,9 +454,17 @@ print_floating (valaddr, type, stream)
|
||||||
|
|
||||||
doub = unpack_double (type, valaddr, &inv);
|
doub = unpack_double (type, valaddr, &inv);
|
||||||
if (inv)
|
if (inv)
|
||||||
|
{
|
||||||
fprintf_filtered (stream, "<invalid float value>");
|
fprintf_filtered (stream, "<invalid float value>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (len < sizeof (double))
|
||||||
|
fprintf_filtered (stream, "%.9g", (double) doub);
|
||||||
|
else if (len == sizeof (double))
|
||||||
|
fprintf_filtered (stream, "%.17g", (double) doub);
|
||||||
else
|
else
|
||||||
fprintf_filtered (stream, len <= sizeof(float) ? "%.9g" : "%.17g", doub);
|
fprintf_filtered (stream, "%.35Lg", doub);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* VALADDR points to an integer of LEN bytes. Print it in hex on stream. */
|
/* VALADDR points to an integer of LEN bytes. Print it in hex on stream. */
|
||||||
|
@ -656,7 +613,7 @@ val_print_string (addr, len, stream)
|
||||||
unsigned int fetchlimit; /* Maximum number of bytes to fetch. */
|
unsigned int fetchlimit; /* Maximum number of bytes to fetch. */
|
||||||
unsigned int nfetch; /* Bytes to fetch / bytes fetched. */
|
unsigned int nfetch; /* Bytes to fetch / bytes fetched. */
|
||||||
unsigned int chunksize; /* Size of each fetch, in bytes. */
|
unsigned int chunksize; /* Size of each fetch, in bytes. */
|
||||||
int bufsize; /* Size of current fetch buffer. */
|
unsigned int bufsize; /* Size of current fetch buffer. */
|
||||||
char *buffer = NULL; /* Dynamically growable fetch buffer. */
|
char *buffer = NULL; /* Dynamically growable fetch buffer. */
|
||||||
char *bufptr; /* Pointer to next available byte in buffer. */
|
char *bufptr; /* Pointer to next available byte in buffer. */
|
||||||
char *limit; /* First location past end of fetch buffer. */
|
char *limit; /* First location past end of fetch buffer. */
|
||||||
|
|
10
gdb/values.c
10
gdb/values.c
|
@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include "gdbcmd.h"
|
#include "gdbcmd.h"
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
|
#include "scm-lang.h"
|
||||||
#include "demangle.h"
|
#include "demangle.h"
|
||||||
|
|
||||||
/* Local function prototypes. */
|
/* Local function prototypes. */
|
||||||
|
@ -100,7 +101,6 @@ allocate_repeat_value (type, count)
|
||||||
struct type *type;
|
struct type *type;
|
||||||
int count;
|
int count;
|
||||||
{
|
{
|
||||||
struct type *element_type = type;
|
|
||||||
int low_bound = current_language->string_lower_bound; /* ??? */
|
int low_bound = current_language->string_lower_bound; /* ??? */
|
||||||
/* FIXME-type-allocation: need a way to free this type when we are
|
/* FIXME-type-allocation: need a way to free this type when we are
|
||||||
done with it. */
|
done with it. */
|
||||||
|
@ -1155,7 +1155,7 @@ unpack_field_as_long (type, valaddr, fieldno)
|
||||||
/* If the field does not entirely fill a LONGEST, then zero the sign bits.
|
/* If the field does not entirely fill a LONGEST, then zero the sign bits.
|
||||||
If the field is signed, and is negative, then sign extend. */
|
If the field is signed, and is negative, then sign extend. */
|
||||||
|
|
||||||
if ((bitsize > 0) && (bitsize < 8 * sizeof (val)))
|
if ((bitsize > 0) && (bitsize < 8 * (int) sizeof (val)))
|
||||||
{
|
{
|
||||||
valmask = (((unsigned LONGEST) 1) << bitsize) - 1;
|
valmask = (((unsigned LONGEST) 1) << bitsize) - 1;
|
||||||
val &= valmask;
|
val &= valmask;
|
||||||
|
@ -1185,12 +1185,12 @@ modify_field (addr, fieldval, bitpos, bitsize)
|
||||||
|
|
||||||
/* If a negative fieldval fits in the field in question, chop
|
/* If a negative fieldval fits in the field in question, chop
|
||||||
off the sign extension bits. */
|
off the sign extension bits. */
|
||||||
if (bitsize < (8 * sizeof (fieldval))
|
if (bitsize < (8 * (int) sizeof (fieldval))
|
||||||
&& (~fieldval & ~((1 << (bitsize - 1)) - 1)) == 0)
|
&& (~fieldval & ~((1 << (bitsize - 1)) - 1)) == 0)
|
||||||
fieldval = fieldval & ((1 << bitsize) - 1);
|
fieldval = fieldval & ((1 << bitsize) - 1);
|
||||||
|
|
||||||
/* Warn if value is too big to fit in the field in question. */
|
/* Warn if value is too big to fit in the field in question. */
|
||||||
if (bitsize < (8 * sizeof (fieldval))
|
if (bitsize < (8 * (int) sizeof (fieldval))
|
||||||
&& 0 != (fieldval & ~((1<<bitsize)-1)))
|
&& 0 != (fieldval & ~((1<<bitsize)-1)))
|
||||||
{
|
{
|
||||||
/* FIXME: would like to include fieldval in the message, but
|
/* FIXME: would like to include fieldval in the message, but
|
||||||
|
@ -1208,7 +1208,7 @@ modify_field (addr, fieldval, bitpos, bitsize)
|
||||||
bitpos = sizeof (oword) * 8 - bitpos - bitsize;
|
bitpos = sizeof (oword) * 8 - bitpos - bitsize;
|
||||||
|
|
||||||
/* Mask out old value, while avoiding shifts >= size of oword */
|
/* Mask out old value, while avoiding shifts >= size of oword */
|
||||||
if (bitsize < 8 * sizeof (oword))
|
if (bitsize < 8 * (int) sizeof (oword))
|
||||||
oword &= ~(((((unsigned LONGEST)1) << bitsize) - 1) << bitpos);
|
oword &= ~(((((unsigned LONGEST)1) << bitsize) - 1) << bitpos);
|
||||||
else
|
else
|
||||||
oword &= ~((~(unsigned LONGEST)0) << bitpos);
|
oword &= ~((~(unsigned LONGEST)0) << bitpos);
|
||||||
|
|
Loading…
Add table
Reference in a new issue