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.
+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>
* configure.in (sparc64-*-solaris2*): Delete.
ADD_FILES = $(REGEX) $(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
LINT=/usr/5bin/lint
gdb_string.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)
signals.h target.h terminal.h thread.h gdb_string.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) \
$(inferior_h) target.h thread.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 \
- $(expression_h)
+ $(expression_h) objfiles.h symfile.h
mdebugread.o: mdebugread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \
$(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.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
values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_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)
extern void *
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 */
enum ch_terminal {
END_TOKEN = 0,
/* '\001' ... '\xff' come first. */
+ OPEN_PAREN = '(',
TOKEN_NOT_READ = 999,
INTEGER_LITERAL,
BOOLEAN_LITERAL,
return terminal_buffer[i];
}
+#if 0
+
static void
pushback_token (code, node)
enum ch_terminal code;
val_buffer[0] = node;
}
+#endif
+
static void
forward_token_()
{
}
write_exp_elt_opcode (UNOP_IND);
continue;
- case '(':
+ case OPEN_PAREN:
parse_call ();
continue;
case CHARACTER_STRING_LITERAL:
write_exp_elt_longcst (1);
write_exp_elt_opcode (MULTI_SUBSCRIPT);
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;
}
case LOC_OPTIMIZED_OUT:
error ("Symbol \"%s\" names no location.", inputname);
break;
+ case LOC_UNRESOLVED:
+ error ("unhandled SYMBOL_CLASS in ch_lex()");
+ break;
}
}
else if (!have_full_symbols () && !have_partial_symbols ())
#include "gdbcmd.h"
#include "symtab.h"
#include "value.h"
+#include "wait.h"
#include <ctype.h>
#include "gdb_string.h"
#ifdef HAVE_UNISTD_H
matchlist = (char **) xmalloc (sizeof_matchlist * sizeof (char *));
matches = 0;
- for (i = 0; name = enumlist[i]; i++)
+ for (i = 0; (name = enumlist[i]) != NULL; i++)
if (strncmp (name, text, textlen) == 0)
{
if (matches == sizeof_matchlist)
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
NOP. */
- if (reg_ptr > core_reg_size)
+ if (reg_ptr > (int) core_reg_size)
reg_ptr -= KERNEL_U_ADDR;
for (regno = 0; regno < numregs; regno++)
{
char *dp = (char *) data;
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))
return 0;
{
char *dp = (char *) (&data);
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))
return 0;
else if (exp->elts[*pos].opcode == BINOP_RANGE)
{
LONGEST low, high;
- value_ptr val;
(*pos)++;
low = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
high = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
case OP_BOOL:
(*pos) += 2;
- if (current_language->la_language == language_fortran)
- return value_from_longest (builtin_type_f_logical_s2,
- exp->elts[pc + 1].longconst);
- else
- return value_from_longest (builtin_type_chill_bool,
+ return value_from_longest (LA_BOOL_TYPE,
exp->elts[pc + 1].longconst);
case OP_INTERNALVAR:
/* If one is virtual, then all are virtual. */
if (TYPE_FN_FIELD_VIRTUAL_P (f, 0))
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);
arg1 = value_virtual_fn_field (&temp, f, j, domain_type, 0);
/* 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
(fmbutt@engage.sps.mot.com).
static SAVED_BF_PTR saved_bf_list=NULL; /* Ptr to (.bf,function)
list*/
+#if 0
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
*/
+#if 0
static SAVED_BF_PTR tmp_bf_ptr; /* Generic temporary for use
in macros */
-
+#endif
/* The following function simply enters a given common block onto
the global common block chain */
first by a queueing algorithm and upon failure fall back to
a linear scan. */
+#if 0
#define ADD_BF_SYMNUM(bf_sym,fcn_sym) \
\
if (saved_bf_list == NULL) \
saved_bf_list_end->next = tmp_bf_ptr; \
saved_bf_list_end = tmp_bf_ptr; \
}
-
+#endif
/* This function frees the entire (.bf,function) list */
case TYPE_CODE_MEMBER:
case TYPE_CODE_REF:
case TYPE_CODE_COMPLEX:
+ case TYPE_CODE_TYPEDEF:
/* These types need no prefix. They are listed here so that
gcc -Wall will reveal any types that haven't been handled. */
break;
case TYPE_CODE_METHOD:
case TYPE_CODE_MEMBER:
case TYPE_CODE_COMPLEX:
+ case TYPE_CODE_TYPEDEF:
/* These types do not need a suffix. They are listed so that
gcc -Wall will report types that may not have been considered. */
break;
/* 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.
unsigned char *startaddr = (unsigned char *)addr;
unsigned char *endaddr = startaddr + len;
- if (len > sizeof (LONGEST))
+ if (len > (int) sizeof (LONGEST))
error ("\
That operation is not available on integers of more than %d bytes.",
sizeof (LONGEST));
unsigned char *startaddr = (unsigned char *)addr;
unsigned char *endaddr = startaddr + len;
- if (len > sizeof (unsigned LONGEST))
+ if (len > (int) sizeof (unsigned LONGEST))
error ("\
That operation is not available on integers of more than %d bytes.",
sizeof (unsigned LONGEST));
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
extract_address (addr, len)
PTR addr;
SWAP_FLOATING (&retval, sizeof (retval));
return retval;
}
- else if (len == sizeof (long double))
+ else if (len == sizeof (DOUBLEST))
{
- long double retval;
+ DOUBLEST retval;
memcpy (&retval, addr, sizeof (retval));
SWAP_FLOATING (&retval, sizeof (retval));
return retval;
SWAP_FLOATING (&doubleval, sizeof (doubleval));
memcpy (addr, &doubleval, sizeof (doubleval));
}
- else if (len == sizeof (long double))
+ else if (len == sizeof (DOUBLEST))
{
SWAP_FLOATING (&val, sizeof (val));
memcpy (addr, &val, sizeof (val));
/* Initialize \) text positions to -1
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;
/* `p' scans through the pattern as `d' scans through the data.
/* Else if virtual format is too long for printf,
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;
printf_filtered ("0x");
#ifdef SOLIB_ADD
if (auto_solib_add)
- /* Add shared library symbols from the newly attached process, if any. */
- SOLIB_ADD ((char *)0, from_tty, (struct target_ops *)0);
+ {
+ /* Add shared library symbols from the newly attached process, if any. */
+ SOLIB_ADD ((char *)0, from_tty, (struct target_ops *)0);
+ re_enable_breakpoints_in_shlibs ();
+ }
#endif
normal_stop ();
#include "inferior.h"
#include "target.h"
#include "gdb_string.h"
+#include "wait.h"
+#include "command.h"
#ifdef USG
#include <sys/types.h>
#endif
}
+#endif /* !defined (CHILD_XFER_MEMORY). */
+
\f
void
_initialize_infptrace ()
{
+#if !defined (CHILD_XFER_MEMORY)
add_info ("udot", udot_info,
"Print contents of kernel ``struct user'' for current child.");
-
+#endif
}
-#endif /* !defined (CHILD_XFER_MEMORY). */
sym = lookup_symbol ("logical", NULL, VAR_NAMESPACE, NULL, NULL);
if (sym)
{
- struct type *type = SYMBOL_TYPE (sym);
+ type = SYMBOL_TYPE (sym);
if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
return type;
}
sym = lookup_symbol ("bool", NULL, VAR_NAMESPACE, NULL, NULL);
if (sym)
{
- struct type *type = SYMBOL_TYPE (sym);
+ type = SYMBOL_TYPE (sym);
if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
return type;
}
/* 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))
{
lexptr += 2;
lexptr += namelen;
/* 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))
return keytab[i].token;
error("internal: Undefined class in m2lex()");
case LOC_LABEL:
+ case LOC_UNRESOLVED:
error("internal: Unforseen case in m2lex()");
}
}
You should have received a copy of the GNU General Public License
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 <setjmp.h>
current_directory = gdb_dirbuf;
/* Parse arguments and options. */
-#ifndef WIN32
+#ifndef WINGDB
{
int c;
/* When var field is 0, use flag field to record the equivalent
}
}
+ /* 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. */
count = 0;
for (; optind < argc; optind++)
GDB manual (available as on-line info or a printed manual).\n", gdb_stdout);
exit (0);
}
-
+
if (!quiet)
{
/* Print all the junk at the top, with trailing "..." if we are about
strcpy (homeinit, getenv ("HOME"));
strcat (homeinit, "/");
strcat (homeinit, gdbinit);
+
if (!inhibit_gdbinit && access (homeinit, R_OK) == 0)
{
if (!SET_TOP_LEVEL ())
/* The default command loop.
The WIN32 Gui calls this main to set up gdb's state, and
has its own command loop. */
-#if !defined (WIN32)
+#if !defined (WINGDB)
while (1)
{
if (!SET_TOP_LEVEL ())
{
}
-int
-proc_wait (pid, status)
- int pid;
- int *status;
-{
-#ifndef __GO32__
- return wait (status);
-#endif
-}
-
void
proc_remove_foreign (pid)
int pid;
#include "gdbcore.h"
#include "expression.h" /* For language.h */
#include "language.h"
+#include "symfile.h"
+#include "objfiles.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
char *args;
int from_tty;
{
- int temp;
-
print_objfile_statistics ();
print_symbol_bcache_statistics ();
}
struct objfile *objfile;
struct minimal_symbol *msymbol;
struct minimal_symbol *found_symbol = NULL;
- struct minimal_symbol *found_file_symbol = NULL;
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
if (sfile != NULL)
#define OBJSTAT(objfile, expr) (objfile -> stats.expr)
#define OBJSTATS struct objstats stats
extern void print_objfile_statistics PARAMS ((void));
+extern void print_symbol_bcache_statistics PARAMS ((void));
#else
extern void write_exp_msymbol PARAMS ((struct minimal_symbol *,
struct type *, struct type *));
+extern void write_dollar_variable PARAMS ((struct stoken str));
+
extern void
start_arglist PARAMS ((void));
for step or cont : SAA where AA is the
signal number.
+ detach D Reply OK.
+
There is no immediate reply to step or cont.
The reply comes when the machine stops.
It is SAA AA is the signal number.
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
remote_open knows that we don't have a file open when the program
starts. */
pop_target();
}
-/* remote_detach()
- takes a program previously attached to and detaches it.
- We better not have left any breakpoints
- in the program or it'll 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. */
+/* This takes a program previously attached to and detaches it. After
+ this is done, GDB can be used to debug some other program. We
+ better not have left any breakpoints in the target program or it'll
+ die when it hits one. */
static void
remote_detach (args, from_tty)
char *args;
int from_tty;
{
+ char buf[PBUFSIZ];
+
if (args)
error ("Argument given to \"detach\" when remotely debugging.");
-
+
+ /* Tell the remote target to detach. */
+ strcpy (buf, "D");
+ remote_send (buf);
+
pop_target ();
if (from_tty)
puts_filtered ("Ending remote debugging.\n");
if (remote_debug)
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)();
/* FIXME-32x64: Need a version of print_address_numeric which puts the
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);
getpkt (buf, 0);
if (p[0] == 0 || p[1] == 0)
/* Reply is short. This means that we were able to read only part
of what we wanted to. */
- break;
+ return i + done;
myaddr[i + done] = fromhex (p[0]) * 16 + fromhex (p[1]);
p += 2;
}
/* Copy the packet into buffer BUF2, encapsulating it
and giving it a checksum. */
- if (cnt > sizeof(buf2) - 5) /* Prosanity check */
+ if (cnt > (int) sizeof (buf2) - 5) /* Prosanity check */
abort();
p = buf2;
remote_prepare_to_store, /* to_prepare_to_store */
remote_xfer_memory, /* to_xfer_memory */
remote_files_info, /* to_files_info */
-
remote_insert_breakpoint, /* to_insert_breakpoint */
remote_remove_breakpoint, /* to_remove_breakpoint */
-
NULL, /* to_terminal_init */
NULL, /* to_terminal_inferior */
NULL, /* to_terminal_ours_for_output */
var_integer, (char *)&remote_timeout,
"Set timeout value for remote read.\n", &setlist),
&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);
}
extern struct type *builtin_type_scm;
extern int scm_parse ();
+
+extern LONGEST scm_unpack PARAMS ((struct type *, char *, enum type_code));
#include <sys/socket.h>
#include <netinet/tcp.h>
#include "signals.h"
+#include "gdb_string.h"
struct tcp_ttystate
{
if (!port_str)
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 */
hostname[tmp] = '\000'; /* Tie off host name */
port = atoi (port_str + 1);
break;
default:
- badtype:
{
static struct complaint msg = {"\
GDB internal error. cleanup_undefined_types with bad type %d.", 0, 0};
#include "gdb_string.h"
#include "gdb_stat.h"
#include <ctype.h>
+#include <time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
int currently_reading_symtab = 0;
-static int
+static void
decrement_reading_symtab (dummy)
void *dummy;
{
struct cleanup *old_cleanups;
asection *s;
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);
if (loadfile_bfd == NULL)
bfd_errmsg (bfd_get_error ()));
}
+ start_time = time (NULL);
+
for (s = loadfile_bfd->sections; s; s = s->next)
{
if (s->flags & SEC_LOAD)
struct cleanup *old_chain;
bfd_vma vma;
+ data_count += size;
+
buffer = xmalloc (size);
old_chain = make_cleanup (free, buffer);
}
}
+ end_time = time (NULL);
+
/* We were doing this in remote-mips.c, I suspect it is right
for other targets too. */
write_pc (loadfile_bfd->start_address);
loaded in. remote-nindy.c had no call to symbol_file_add, but remote-vx.c
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);
}
enough? */
if (objfile->global_psymbols.list)
mfree (objfile->md, objfile->global_psymbols.list);
- objfile->global_psymbols.list = NULL;
- objfile->global_psymbols.next = NULL;
- objfile->global_psymbols.size = 0;
+ memset (&objfile -> global_psymbols, 0,
+ sizeof (objfile -> global_psymbols));
if (objfile->static_psymbols.list)
mfree (objfile->md, objfile->static_psymbols.list);
- objfile->static_psymbols.list = NULL;
- objfile->static_psymbols.next = NULL;
- objfile->static_psymbols.size = 0;
+ memset (&objfile -> static_psymbols, 0,
+ sizeof (objfile -> static_psymbols));
/* Free the obstacks for non-reusable objfiles */
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 -> symbol_obstack, 0);
obstack_free (&objfile -> type_obstack, 0);
#include "command.h"
#include "obstack.h"
#include "language.h"
+#include "bcache.h"
#include "gdb_string.h"
immediate_quit++;
ALL_OBJFILES (objfile)
{
- printf_filtered ("Cached obstack statistics for '%s':\n", objfile -> name);
- print_bcache_statistics (&objfile -> psymbol_cache, "partial symbol obstack");
+ printf_filtered ("Byte cache statistics for '%s':\n", objfile -> name);
+ print_bcache_statistics (&objfile -> psymbol_cache, "partial symbol cache");
}
immediate_quit--;
}
char *p1;
char *rl;
char *local_prompt = prrompt;
- register int c;
char *nline;
char got_eof = 0;
{
value_ptr bound;
int c_style = current_language->c_style_arrays;
- struct type *tarray, *tint;
+ struct type *tarray;
COERCE_REF (array);
tarray = check_typedef (VALUE_TYPE (array));
LONGEST index = value_as_long (idx);
value_ptr v;
int offset, byte, bit_index;
- LONGEST lowerbound, upperbound, word;
+ LONGEST lowerbound, upperbound;
get_discrete_bounds (range_type, &lowerbound, &upperbound);
if (index < lowerbound || index > upperbound)
error ("bitstring index out of range");
{
struct type *array_type = check_typedef (VALUE_TYPE (array));
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);
- int elt_offs = elt_size * longest_to_int (index - lowerbound);
+ unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound);
value_ptr v;
if (index < lowerbound || elt_offs >= TYPE_LENGTH (array_type))
/* FIXME: This implements ANSI C rules (also correct for C++).
What about FORTRAN and chill? */
{
- int promoted_len1 = TYPE_LENGTH (type1);
- int promoted_len2 = TYPE_LENGTH (type2);
+ unsigned int promoted_len1 = TYPE_LENGTH (type1);
+ unsigned int promoted_len2 = TYPE_LENGTH (type2);
int is_unsigned1 = TYPE_UNSIGNED (type1);
int is_unsigned2 = TYPE_UNSIGNED (type2);
- int result_len;
+ unsigned int result_len;
int unsigned_operation;
/* Determine type length and signedness after promotion for
return (CORE_ADDR) value_as_long (arg1) == value_as_pointer (arg2);
else if (code1 == code2
- && ((len = TYPE_LENGTH (type1))
- == TYPE_LENGTH (type2)))
+ && ((len = (int) TYPE_LENGTH (type1))
+ == (int) TYPE_LENGTH (type2)))
{
p1 = VALUE_CONTENTS (arg1);
p2 = VALUE_CONTENTS (arg2);
value_as_long (element));
if (member < 0)
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
/* Flag for whether we want to abandon failed expression evals by default. */
+#if 0
static int auto_abandon = 0;
+#endif
\f
/* Find the address of function name NAME in the inferior. */
+ HOST_CHAR_BIT - 1)
/ 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.",
sizeof (LONGEST) * HOST_CHAR_BIT);
char buffer[sizeof (LONGEST)];
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.",
sizeof (LONGEST) * HOST_CHAR_BIT);
/* 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 ((VALUE_BITSIZE (toval) > 0)
- && (VALUE_BITSIZE (toval) < 8 * sizeof (LONGEST)))
+ && (VALUE_BITSIZE (toval) < 8 * (int) sizeof (LONGEST)))
{
LONGEST fieldval = value_as_long (fromval);
LONGEST valmask = (((unsigned LONGEST) 1) << VALUE_BITSIZE (toval)) - 1;
/* Create a call sequence customized for this function
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],
REGISTER_SIZE,
(unsigned LONGEST)dummy[i]);
{
int nelem;
int idx;
- int typelength;
+ unsigned int typelength;
value_ptr val;
struct type *rangetype;
struct type *arraytype;
{
char *dname = type_name_no_tag (type);
char *cp = strchr (dname, '<');
- int len;
+ unsigned int len;
/* Do not compare the template part for template classes. */
if (cp == NULL)
only a stub and we can't find and substitute its complete type, then
print appropriate string and return. */
- if (TYPE_FLAGS (real_type) & TYPE_FLAG_STUB
- || TYPE_LENGTH (real_type) == 0)
+ if (TYPE_FLAGS (real_type) & TYPE_FLAG_STUB)
{
fprintf_filtered (stream, "<incomplete type>");
gdb_flush (stream);
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
val_print_type_code_int (type, valaddr, stream)
char *valaddr;
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_UNSIGNED (type))
- {
- /* 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)
- {
- for (p = valaddr;
- len > sizeof (LONGEST) && p < valaddr + TYPE_LENGTH (type);
- p++)
- {
- if (*p == 0)
- {
- len--;
- }
- else
- {
- break;
- }
- }
- first_addr = p;
- }
- else
- {
- first_addr = valaddr;
- for (p = valaddr + TYPE_LENGTH (type) - 1;
- len > sizeof (LONGEST) && p >= valaddr;
- p--)
- {
- if (*p == 0)
- {
- len--;
- }
- else
- {
- break;
- }
- }
- }
+ LONGEST val;
- 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);
- }
+ if (TYPE_UNSIGNED (type)
+ && extract_long_unsigned_integer (valaddr, TYPE_LENGTH (type),
+ &val))
+ {
+ print_longest (stream, 'u', 0, val);
}
else
{
- /* Signed. One could assume two's complement (a reasonable
- assumption, I think) and do better than this. */
+ /* 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
+ better than this. */
print_hex_chars (stream, (unsigned char *) valaddr,
TYPE_LENGTH (type));
}
struct type *type;
GDB_FILE *stream;
{
- double doub;
+ DOUBLEST doub;
int inv;
unsigned len = TYPE_LENGTH (type);
doub = unpack_double (type, valaddr, &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
- 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. */
unsigned int fetchlimit; /* Maximum number of bytes to fetch. */
unsigned int nfetch; /* Bytes to fetch / bytes fetched. */
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 *bufptr; /* Pointer to next available byte in buffer. */
char *limit; /* First location past end of fetch buffer. */
#include "gdbcmd.h"
#include "target.h"
#include "language.h"
+#include "scm-lang.h"
#include "demangle.h"
/* Local function prototypes. */
struct type *type;
int count;
{
- struct type *element_type = type;
int low_bound = current_language->string_lower_bound; /* ??? */
/* FIXME-type-allocation: need a way to free this type when we are
done with it. */
/* 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 ((bitsize > 0) && (bitsize < 8 * sizeof (val)))
+ if ((bitsize > 0) && (bitsize < 8 * (int) sizeof (val)))
{
valmask = (((unsigned LONGEST) 1) << bitsize) - 1;
val &= valmask;
/* If a negative fieldval fits in the field in question, chop
off the sign extension bits. */
- if (bitsize < (8 * sizeof (fieldval))
+ if (bitsize < (8 * (int) sizeof (fieldval))
&& (~fieldval & ~((1 << (bitsize - 1)) - 1)) == 0)
fieldval = fieldval & ((1 << bitsize) - 1);
/* 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)))
{
/* FIXME: would like to include fieldval in the message, but
bitpos = sizeof (oword) * 8 - bitpos - bitsize;
/* 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);
else
oword &= ~((~(unsigned LONGEST)0) << bitpos);