From: Jim Kingdon Date: Tue, 28 Sep 1993 17:43:25 +0000 (+0000) Subject: Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) X-Git-Tag: gdb-4_18~17303 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5573d7d4b1ed201ca3ac71dcdcf359d7eda8c3d3;p=external%2Fbinutils.git Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * symmisc.c (print_symbol): Use %02x not %2x for LOC_CONST_BYTES. Clean up problems with targets and hosts that have 64 bit longs and pointers and 32 bit ints. * breakpoint.c, buildsym.c, c-lang.c, c-valprint.c, ch-lang.c, ch-valprint.c, core.c, cp-valprint.c, dbxread.c, exec.c, expprint.c, gdbtypes.c, infcmd.c, language.c, language.h, m2-lang.c, maint.c, mips-tdep.c, mipsread.c, partial-stab.h, printcmd.c, remote-vx.c, solib.c, source.c, stack.c, symfile.c, symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c: Change all printf formats from %x to %lx if outputting an address. Change la_*_format to use long format. local_hex_string, local_hex_string_custom now take an unsigned long argument, change all callers. * coffread.c (read_coff_symtab): Remove superfluous cast for complaint output. * dbxread.c (end_psymtab): Cast MSYMBOL_INFO to long, not int. * findvar.c, value.h (write_register): Change register value to long. * gdbtypes.h (struct type): Change `bitsize' to long as TYPE_FIELD_STATIC_PHYSNAME uses this field as a pointer. * inferior.h (struct inferior_status): Change type of stop_pc to CORE_ADDR. * language.h (local_octal_string, local_octal_string_custom): Remove prototype, the functions are neither defined nor used. * mipsread.c (parse_symbol): Use temporary variable for bitsize as f->bitsize is a long now. * objfiles.c (add_to_objfile_sections, build_objfile_section_table): Use unsigned long casts instead of int for abusing sections_end pointer as integer. * stack.c (parse_frame_specification): Change type of `args' to CORE_ADDR for SETUP_ARBITRARY_FRAME. * printcmd.c (make_vasize): Allow redefinition via MAKEVA_SIZE. * mipsread.c (parse_type): Alpha cc now supports the t->continued bit, update algorithm to match the way the compiler uses it. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 075f3db..d4fd973 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,41 @@ +Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * symmisc.c (print_symbol): Use %02x not %2x for LOC_CONST_BYTES. + + Clean up problems with targets and hosts that have 64 bit longs + and pointers and 32 bit ints. + * breakpoint.c, buildsym.c, c-lang.c, c-valprint.c, ch-lang.c, + ch-valprint.c, core.c, cp-valprint.c, dbxread.c, exec.c, + expprint.c, gdbtypes.c, infcmd.c, language.c, language.h, + m2-lang.c, maint.c, mips-tdep.c, mipsread.c, partial-stab.h, + printcmd.c, remote-vx.c, solib.c, source.c, stack.c, symfile.c, + symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c: + Change all printf formats from %x to %lx if outputting an address. + Change la_*_format to use long format. + local_hex_string, local_hex_string_custom now take an unsigned long + argument, change all callers. + * coffread.c (read_coff_symtab): Remove superfluous cast for + complaint output. + * dbxread.c (end_psymtab): Cast MSYMBOL_INFO to long, not int. + * findvar.c, value.h (write_register): Change register value to long. + * gdbtypes.h (struct type): Change `bitsize' to long as + TYPE_FIELD_STATIC_PHYSNAME uses this field as a pointer. + * inferior.h (struct inferior_status): Change type of stop_pc to + CORE_ADDR. + * language.h (local_octal_string, local_octal_string_custom): + Remove prototype, the functions are neither defined nor used. + * mipsread.c (parse_symbol): Use temporary variable for bitsize as + f->bitsize is a long now. + * objfiles.c (add_to_objfile_sections, build_objfile_section_table): + Use unsigned long casts instead of int for abusing sections_end + pointer as integer. + * stack.c (parse_frame_specification): Change type of `args' to + CORE_ADDR for SETUP_ARBITRARY_FRAME. + + * printcmd.c (make_vasize): Allow redefinition via MAKEVA_SIZE. + * mipsread.c (parse_type): Alpha cc now supports the t->continued + bit, update algorithm to match the way the compiler uses it. + Tue Sep 28 12:05:11 1993 Jim Kingdon (kingdon@lioth.cygnus.com) * utils.c (fprintfi_filtered): Fix comments. diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 5a762af..256d2ce 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -62,7 +62,7 @@ struct complaint innerblock_anon_complaint = {"inner block not inside outer block", 0, 0}; struct complaint blockvector_complaint = - {"block at 0x%x out of order", 0, 0}; + {"block at 0x%lx out of order", 0, 0}; /* maintain the lists of symbols and blocks */ @@ -348,7 +348,7 @@ make_blockvector (objfile) > BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i))) { complain (&blockvector_complaint, - BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i))); + (unsigned long) BLOCK_START(BLOCKVECTOR_BLOCK (blockvector, i))); } } } diff --git a/gdb/c-lang.c b/gdb/c-lang.c index b96dc1e..ea07959 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -408,9 +408,9 @@ const struct language_defn c_language_defn = { &BUILTIN_TYPE_UNSIGNED_LONGEST,/* longest unsigned integral type */ &builtin_type_double, /* longest floating point type */ /*FIXME*/ {"", "", "", ""}, /* Binary format info */ - {"0%o", "0", "o", ""}, /* Octal format info */ - {"%d", "", "d", ""}, /* Decimal format info */ - {"0x%x", "0x", "x", ""}, /* Hex format info */ + {"0%lo", "0", "o", ""}, /* Octal format info */ + {"%ld", "", "d", ""}, /* Decimal format info */ + {"0x%lx", "0x", "x", ""}, /* Hex format info */ c_op_print_tab, /* expression operators for printing */ LANG_MAGIC }; @@ -432,9 +432,9 @@ const struct language_defn cplus_language_defn = { &BUILTIN_TYPE_UNSIGNED_LONGEST,/* longest unsigned integral type */ &builtin_type_double, /* longest floating point type */ /*FIXME*/ {"", "", "", ""}, /* Binary format info */ - {"0%o", "0", "o", ""}, /* Octal format info */ - {"%d", "", "d", ""}, /* Decimal format info */ - {"0x%x", "0x", "x", ""}, /* Hex format info */ + {"0%lo", "0", "o", ""}, /* Octal format info */ + {"%ld", "", "d", ""}, /* Decimal format info */ + {"0x%lx", "0x", "x", ""}, /* Hex format info */ c_op_print_tab, /* expression operators for printing */ LANG_MAGIC }; diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index c6de17b..2d5a826 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -171,7 +171,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse, if (addressprint && format != 's') { - fprintf_filtered (stream, "0x%x", addr); + fprintf_filtered (stream, "0x%lx", (unsigned long)addr); } /* For a pointer to char or unsigned char, also print the string diff --git a/gdb/ch-lang.c b/gdb/ch-lang.c index 6467647..2f74061 100644 --- a/gdb/ch-lang.c +++ b/gdb/ch-lang.c @@ -304,9 +304,9 @@ const struct language_defn chill_language_defn = { &BUILTIN_TYPE_UNSIGNED_LONGEST,/* longest unsigned integral type */ &builtin_type_chill_real, /* longest floating point type */ {"", "B'", "", ""}, /* Binary format info */ - {"O'%o", "O'", "o", ""}, /* Octal format info */ - {"D'%d", "D'", "d", ""}, /* Decimal format info */ - {"H'%x", "H'", "x", ""}, /* Hex format info */ + {"O'%lo", "O'", "o", ""}, /* Octal format info */ + {"D'%ld", "D'", "d", ""}, /* Decimal format info */ + {"H'%lx", "H'", "x", ""}, /* Hex format info */ chill_op_print_tab, /* expression operators for printing */ LANG_MAGIC }; diff --git a/gdb/ch-valprint.c b/gdb/ch-valprint.c index 873da1b..261b22e 100644 --- a/gdb/ch-valprint.c +++ b/gdb/ch-valprint.c @@ -156,7 +156,7 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse, } if (addressprint && format != 's') { - fprintf_filtered (stream, "H'%x", addr); + fprintf_filtered (stream, "H'%lx", (unsigned long) addr); } /* For a pointer to char or unsigned char, also print the string @@ -186,7 +186,7 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse, { /* This used to say `addr', which is unset at this point. Is `address' what is meant? */ - fprintf_filtered (stream, "H'%x ", address); + fprintf_filtered (stream, "H'%lx ", (unsigned long) address); } i = TYPE_LENGTH (type); LA_PRINT_STRING (stream, valaddr, i, 0); diff --git a/gdb/coffread.c b/gdb/coffread.c index e9aa697..2accd5b 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -932,7 +932,7 @@ read_coff_symtab (symtab_offset, nsyms, objfile) new = pop_context (); if (depth-- != new->depth) { - complain (&eb_complaint, (char *)symnum); + complain (&eb_complaint, symnum); break; } if (local_symbols && context_stack_depth > 0) diff --git a/gdb/core.c b/gdb/core.c index 4b8ca14..36c9ab5 100644 --- a/gdb/core.c +++ b/gdb/core.c @@ -140,12 +140,14 @@ memory_error (status, memaddr) { /* Actually, address between memaddr and memaddr + len was out of bounds. */ - error ("Cannot access memory at address %s.", local_hex_string(memaddr)); + error ("Cannot access memory at address %s.", + local_hex_string((unsigned long) memaddr)); } else { error ("Error accessing memory address %s: %s.", - local_hex_string (memaddr), safe_strerror (status)); + local_hex_string ((unsigned long) memaddr), + safe_strerror (status)); } } diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index a3a5c58..fdda85f 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -378,7 +378,8 @@ cplus_print_value (type, valaddr, stream, format, recurse, pretty, dont_print) fputs_filtered (basename ? basename : "", stream); fputs_filtered ("> = ", stream); if (err != 0) - fprintf_filtered (stream, "", baddr); + fprintf_filtered (stream, + "", (unsigned long) baddr); else cp_print_value_fields (TYPE_BASECLASS (type, i), baddr, stream, format, recurse, pretty, diff --git a/gdb/dbxread.c b/gdb/dbxread.c index cc0c43e..3a87177 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -1114,7 +1114,7 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset, if (minsym) { pst->texthigh = SYMBOL_VALUE_ADDRESS (minsym) + - (int) MSYMBOL_INFO (minsym); + (long) MSYMBOL_INFO (minsym); } else { /* This file ends with a static function, and it's difficult to imagine how hard it would be to track down @@ -1765,6 +1765,10 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) case N_BCOMM: if (common_block) { + /* Note: this does not detect nesting if the previous N_BCOMM + was at the beginning of a scope (and thus common_block was + NULL). Not necessarily worth worrying about unless we run + into a compiler which actually has this bug. */ static struct complaint msg = { "Invalid symbol data: common within common at symtab pos %d", 0, 0}; @@ -1775,11 +1779,21 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) break; case N_ECOMM: + /* Symbols declared since the BCOMM are to have the common block - start address added in when we know it. common_block points to - the first symbol after the BCOMM in the local_symbols list; - copy the list and hang it off the symbol for the common block name - for later fixup. */ + start address added in when we know it. common_block and + common_block_i point to the first symbol after the BCOMM in + the local_symbols list; copy the list and hang it off the + symbol for the common block name for later fixup. */ + + /* If there is a N_ECOMM unmatched by a N_BCOMM, we treat all + the local_symbols as part of the common block. It might be + better to just ignore the N_ECOMM, but then we'd need to + distinguish between a N_BCOMM at the start of a scope, or no + N_BCOMM at all (currently they both have common_block NULL). + Not necessarily worth worrying about unless we run into a + compiler which actually has this bug. */ + { int i; struct symbol *sym = @@ -1870,7 +1884,8 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) case N_NBBSS: case N_NBSTS: case N_NBLCS: - complain (&unknown_symtype_complaint, local_hex_string(type)); + complain (&unknown_symtype_complaint, + local_hex_string((unsigned long) type)); /* FALLTHROUGH */ /* The following symbol types don't need the address field relocated, @@ -1919,12 +1934,13 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) /* On solaris up to 2.2, the N_FUN stab gets relocated. On Solaris 2.3, ld no longer relocates stabs (which is good), and the N_FUN's value is now always zero. - We only provide this correction for functions, not for - all N_FUN symbols, because that is easiest and all - readonly variables seem to go in the .rodata on Solaris. */ + The following code can't deal with this, because + last_pc_address depends on getting the address from a + N_SLINE or some such and in Solaris those are function + relative. Best fix is probably to create a Ttext.text symbol + and handle this like Ddata.data and so on. */ - if (type == N_GSYM || type == N_STSYM - || (type == N_FUN && valu == 0)) + if (type == N_GSYM || type == N_STSYM) { struct minimal_symbol *m; int l = colon_pos - name; @@ -2031,9 +2047,11 @@ copy_pending (beg, endi, end) add_symbol_to_list (next->symbol[j], &new); } - /* Copy however much of END we need. */ - for (j = endi; j < end->nsyms; j++) - add_symbol_to_list (end->symbol[j], &new); + /* Copy however much of END we need. If END is NULL, it means copy + all the local symbols (which we already did above). */ + if (end != NULL) + for (j = endi; j < end->nsyms; j++) + add_symbol_to_list (end->symbol[j], &new); return new; } diff --git a/gdb/findvar.c b/gdb/findvar.c index c743d80..36c72f6 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -60,7 +60,7 @@ That operation is not available on integers of more than %d bytes.", p = endaddr - 1; #endif /* Do the sign extension once at the start. */ - retval = (*p ^ 0x80) - 0x80; + retval = ((LONGEST)*p ^ 0x80) - 0x80; #if TARGET_BYTE_ORDER == BIG_ENDIAN for (++p; p < endaddr; ++p) #else @@ -466,7 +466,8 @@ read_register (regno) void write_register (regno, val) - int regno, val; + int regno; + long val; { PTR buf; int size; @@ -697,7 +698,7 @@ value_from_register (type, regnum, frame) int mem_stor = 0, reg_stor = 0; int mem_tracking = 1; CORE_ADDR last_addr = 0; - CORE_ADDR first_addr; + CORE_ADDR first_addr = 0; value_bytes = (char *) alloca (len + MAX_REGISTER_RAW_SIZE); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 44e6e92..f346469 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1105,33 +1105,33 @@ dump_fn_fieldlists (type, spaces) int overload_idx; struct fn_field *f; - printfi_filtered (spaces, "fn_fieldlists 0x%x\n", - TYPE_FN_FIELDLISTS (type)); + printfi_filtered (spaces, "fn_fieldlists 0x%lx\n", + (unsigned long) TYPE_FN_FIELDLISTS (type)); for (method_idx = 0; method_idx < TYPE_NFN_FIELDS (type); method_idx++) { f = TYPE_FN_FIELDLIST1 (type, method_idx); - printfi_filtered (spaces + 2, "[%d] name '%s' (0x%x) length %d\n", + printfi_filtered (spaces + 2, "[%d] name '%s' (0x%lx) length %d\n", method_idx, TYPE_FN_FIELDLIST_NAME (type, method_idx), - TYPE_FN_FIELDLIST_NAME (type, method_idx), + (unsigned long) TYPE_FN_FIELDLIST_NAME (type, method_idx), TYPE_FN_FIELDLIST_LENGTH (type, method_idx)); for (overload_idx = 0; overload_idx < TYPE_FN_FIELDLIST_LENGTH (type, method_idx); overload_idx++) { - printfi_filtered (spaces + 4, "[%d] physname '%s' (0x%x)\n", + printfi_filtered (spaces + 4, "[%d] physname '%s' (0x%lx)\n", overload_idx, TYPE_FN_FIELD_PHYSNAME (f, overload_idx), - TYPE_FN_FIELD_PHYSNAME (f, overload_idx)); - printfi_filtered (spaces + 8, "type 0x%x\n", - TYPE_FN_FIELD_TYPE (f, overload_idx)); + (unsigned long) TYPE_FN_FIELD_PHYSNAME (f, overload_idx)); + printfi_filtered (spaces + 8, "type 0x%lx\n", + (unsigned long) TYPE_FN_FIELD_TYPE (f, overload_idx)); recursive_dump_type (TYPE_FN_FIELD_TYPE (f, overload_idx), spaces + 8 + 2); - printfi_filtered (spaces + 8, "args 0x%x\n", - TYPE_FN_FIELD_ARGS (f, overload_idx)); + printfi_filtered (spaces + 8, "args 0x%lx\n", + (unsigned long) TYPE_FN_FIELD_ARGS (f, overload_idx)); print_arg_types (TYPE_FN_FIELD_ARGS (f, overload_idx), spaces); - printfi_filtered (spaces + 8, "fcontext 0x%x\n", - TYPE_FN_FIELD_FCONTEXT (f, overload_idx)); + printfi_filtered (spaces + 8, "fcontext 0x%lx\n", + (unsigned long) TYPE_FN_FIELD_FCONTEXT (f, overload_idx)); printfi_filtered (spaces + 8, "is_const %d\n", TYPE_FN_FIELD_CONST (f, overload_idx)); printfi_filtered (spaces + 8, "is_volatile %d\n", @@ -1161,9 +1161,9 @@ print_cplus_stuff (type, spaces) TYPE_NFN_FIELDS_TOTAL (type)); if (TYPE_N_BASECLASSES (type) > 0) { - printfi_filtered (spaces, "virtual_field_bits (%d bits at *0x%x)", + printfi_filtered (spaces, "virtual_field_bits (%d bits at *0x%lx)", TYPE_N_BASECLASSES (type), - TYPE_FIELD_VIRTUAL_BITS (type)); + (unsigned long) TYPE_FIELD_VIRTUAL_BITS (type)); print_bit_vector (TYPE_FIELD_VIRTUAL_BITS (type), TYPE_N_BASECLASSES (type)); puts_filtered ("\n"); @@ -1172,18 +1172,18 @@ print_cplus_stuff (type, spaces) { if (TYPE_FIELD_PRIVATE_BITS (type) != NULL) { - printfi_filtered (spaces, "private_field_bits (%d bits at *0x%x)", + printfi_filtered (spaces, "private_field_bits (%d bits at *0x%lx)", TYPE_NFIELDS (type), - TYPE_FIELD_PRIVATE_BITS (type)); + (unsigned long) TYPE_FIELD_PRIVATE_BITS (type)); print_bit_vector (TYPE_FIELD_PRIVATE_BITS (type), TYPE_NFIELDS (type)); puts_filtered ("\n"); } if (TYPE_FIELD_PROTECTED_BITS (type) != NULL) { - printfi_filtered (spaces, "protected_field_bits (%d bits at *0x%x)", + printfi_filtered (spaces, "protected_field_bits (%d bits at *0x%lx)", TYPE_NFIELDS (type), - TYPE_FIELD_PROTECTED_BITS (type)); + (unsigned long) TYPE_FIELD_PROTECTED_BITS (type)); print_bit_vector (TYPE_FIELD_PROTECTED_BITS (type), TYPE_NFIELDS (type)); puts_filtered ("\n"); @@ -1276,18 +1276,20 @@ recursive_dump_type (type, spaces) } puts_filtered ("\n"); printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type)); - printfi_filtered (spaces, "objfile 0x%x\n", TYPE_OBJFILE (type)); - printfi_filtered (spaces, "target_type 0x%x\n", TYPE_TARGET_TYPE (type)); + printfi_filtered (spaces, "objfile 0x%lx\n", + (unsigned long) TYPE_OBJFILE (type)); + printfi_filtered (spaces, "target_type 0x%lx\n", + (unsigned long) TYPE_TARGET_TYPE (type)); if (TYPE_TARGET_TYPE (type) != NULL) { recursive_dump_type (TYPE_TARGET_TYPE (type), spaces + 2); } - printfi_filtered (spaces, "pointer_type 0x%x\n", - TYPE_POINTER_TYPE (type)); - printfi_filtered (spaces, "reference_type 0x%x\n", - TYPE_REFERENCE_TYPE (type)); - printfi_filtered (spaces, "function_type 0x%x\n", - TYPE_FUNCTION_TYPE (type)); + printfi_filtered (spaces, "pointer_type 0x%lx\n", + (unsigned long) TYPE_POINTER_TYPE (type)); + printfi_filtered (spaces, "reference_type 0x%lx\n", + (unsigned long) TYPE_REFERENCE_TYPE (type)); + printfi_filtered (spaces, "function_type 0x%lx\n", + (unsigned long) TYPE_FUNCTION_TYPE (type)); printfi_filtered (spaces, "flags 0x%x", TYPE_FLAGS (type)); if (TYPE_FLAGS (type) & TYPE_FLAG_UNSIGNED) { @@ -1302,26 +1304,26 @@ recursive_dump_type (type, spaces) puts_filtered (" TYPE_FLAG_STUB"); } puts_filtered ("\n"); - printfi_filtered (spaces, "nfields %d 0x%x\n", TYPE_NFIELDS (type), - TYPE_FIELDS (type)); + printfi_filtered (spaces, "nfields %d 0x%lx\n", TYPE_NFIELDS (type), + (unsigned long) TYPE_FIELDS (type)); for (idx = 0; idx < TYPE_NFIELDS (type); idx++) { printfi_filtered (spaces + 2, - "[%d] bitpos %d bitsize %d type 0x%x name '%s' (0x%x)\n", + "[%d] bitpos %d bitsize %d type 0x%lx name '%s' (0x%lx)\n", idx, TYPE_FIELD_BITPOS (type, idx), TYPE_FIELD_BITSIZE (type, idx), - TYPE_FIELD_TYPE (type, idx), - TYPE_FIELD_NAME (type, idx), + (unsigned long) TYPE_FIELD_TYPE (type, idx), TYPE_FIELD_NAME (type, idx) != NULL ? TYPE_FIELD_NAME (type, idx) - : ""); + : "", + (unsigned long) TYPE_FIELD_NAME (type, idx)); if (TYPE_FIELD_TYPE (type, idx) != NULL) { recursive_dump_type (TYPE_FIELD_TYPE (type, idx), spaces + 4); } } - printfi_filtered (spaces, "vptr_basetype 0x%x\n", - TYPE_VPTR_BASETYPE (type)); + printfi_filtered (spaces, "vptr_basetype 0x%lx\n", + (unsigned long) TYPE_VPTR_BASETYPE (type)); if (TYPE_VPTR_BASETYPE (type) != NULL) { recursive_dump_type (TYPE_VPTR_BASETYPE (type), spaces + 2); @@ -1331,13 +1333,14 @@ recursive_dump_type (type, spaces) { case TYPE_CODE_METHOD: case TYPE_CODE_FUNC: - printfi_filtered (spaces, "arg_types 0x%x\n", TYPE_ARG_TYPES (type)); + printfi_filtered (spaces, "arg_types 0x%lx\n", + (unsigned long) TYPE_ARG_TYPES (type)); print_arg_types (TYPE_ARG_TYPES (type), spaces); break; case TYPE_CODE_STRUCT: - printfi_filtered (spaces, "cplus_stuff 0x%x\n", - TYPE_CPLUS_SPECIFIC (type)); + printfi_filtered (spaces, "cplus_stuff 0x%lx\n", + (unsigned long) TYPE_CPLUS_SPECIFIC (type)); print_cplus_stuff (type, spaces); break; @@ -1345,8 +1348,8 @@ recursive_dump_type (type, spaces) /* We have to pick one of the union types to be able print and test the value. Pick cplus_struct_type, even though we know it isn't any particular one. */ - printfi_filtered (spaces, "type_specific 0x%x", - TYPE_CPLUS_SPECIFIC (type)); + printfi_filtered (spaces, "type_specific 0x%lx", + (unsigned long) TYPE_CPLUS_SPECIFIC (type)); if (TYPE_CPLUS_SPECIFIC (type) != NULL) { printf_filtered (" (unknown data form)"); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 77d2cb8..89cad6c 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -240,8 +240,10 @@ struct type /* Size of this field, in bits, or zero if not packed. For an unpacked field, the field's type's length says how many bytes the field occupies. */ + /* FIXME: This is abused by TYPE_FIELD_STATIC_PHYSNAME to contain + a pointer, so it has to be long. */ - int bitsize; + long bitsize; /* In a struct or enum type, type of this field. In a function type, type of this argument. diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 1df2c8f..cd74b20 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -394,6 +394,10 @@ which has no line number information.\n", name); proceed ((CORE_ADDR) -1, -1, 1); if (! stop_step) break; + + /* FIXME: On nexti, this may have already been done (when we hit the + step resume break, I think). Probably this should be moved to + wait_for_inferior (near the top). */ #if defined (SHIFT_INST_REGS) SHIFT_INST_REGS(); #endif @@ -448,10 +452,11 @@ jump_command (arg, from_tty) } } - addr = ADDR_BITS_SET (sal.pc); + addr = sal.pc; if (from_tty) - printf_filtered ("Continuing at %s.\n", local_hex_string(addr)); + printf_filtered ("Continuing at %s.\n", + local_hex_string((unsigned long) addr)); clear_proceed_status (); proceed (addr, 0, 0); @@ -746,7 +751,8 @@ program_info (args, from_tty) } target_files_info (); - printf_filtered ("Program stopped at %s.\n", local_hex_string(stop_pc)); + printf_filtered ("Program stopped at %s.\n", + local_hex_string((unsigned long) stop_pc)); if (stop_step) printf_filtered ("It stopped after being stepped.\n"); else if (num != 0) diff --git a/gdb/language.c b/gdb/language.c index 4881aa1..be51953 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -491,7 +491,7 @@ local_hex_format_custom(pre) string. Returns a pointer to this string. */ char * local_hex_string (num) - int num; + unsigned long num; { static char res[50]; @@ -503,7 +503,7 @@ local_hex_string (num) string. Returns a pointer to this string. */ char * local_hex_string_custom(num,pre) - int num; + unsigned long num; char *pre; { static char res[50]; @@ -1215,9 +1215,9 @@ const struct language_defn unknown_language_defn = { &builtin_type_error, /* longest unsigned integral type */ &builtin_type_error, /* longest floating point type */ {"", "", "", ""}, /* Binary format info */ - {"0%o", "0", "o", ""}, /* Octal format info */ - {"%d", "", "d", ""}, /* Decimal format info */ - {"0x%x", "0x", "x", ""}, /* Hex format info */ + {"0%lo", "0", "o", ""}, /* Octal format info */ + {"%ld", "", "d", ""}, /* Decimal format info */ + {"0x%lx", "0x", "x", ""}, /* Hex format info */ unk_op_print_tab, /* expression operators for printing */ LANG_MAGIC }; @@ -1240,9 +1240,9 @@ const struct language_defn auto_language_defn = { &builtin_type_error, /* longest unsigned integral type */ &builtin_type_error, /* longest floating point type */ {"", "", "", ""}, /* Binary format info */ - {"0%o", "0", "o", ""}, /* Octal format info */ - {"%d", "", "d", ""}, /* Decimal format info */ - {"0x%x", "0x", "x", ""}, /* Hex format info */ + {"0%lo", "0", "o", ""}, /* Octal format info */ + {"%ld", "", "d", ""}, /* Decimal format info */ + {"0x%lx", "0x", "x", ""}, /* Hex format info */ unk_op_print_tab, /* expression operators for printing */ LANG_MAGIC }; @@ -1264,9 +1264,9 @@ const struct language_defn local_language_defn = { &builtin_type_error, /* longest unsigned integral type */ &builtin_type_error, /* longest floating point type */ {"", "", "", ""}, /* Binary format info */ - {"0%o", "0", "o", ""}, /* Octal format info */ - {"%d", "", "d", ""}, /* Decimal format info */ - {"0x%x", "0x", "x", ""}, /* Hex format info */ + {"0%lo", "0", "o", ""}, /* Octal format info */ + {"%ld", "", "d", ""}, /* Decimal format info */ + {"0x%lx", "0x", "x", ""}, /* Hex format info */ unk_op_print_tab, /* expression operators for printing */ LANG_MAGIC }; diff --git a/gdb/language.h b/gdb/language.h index 8bb76a0..9df5345 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -329,16 +329,10 @@ local_hex_format_custom PARAMS ((char *)); /* language.c */ the next call. Takes printf options like "08" or "l". */ extern char * -local_octal_string PARAMS ((int)); /* language.c */ +local_hex_string PARAMS ((unsigned long)); /* language.c */ extern char * -local_octal_string_custom PARAMS ((int, char *));/* language.c */ - -extern char * -local_hex_string PARAMS ((int)); /* language.c */ - -extern char * -local_hex_string_custom PARAMS ((int, char *)); /* language.c */ +local_hex_string_custom PARAMS ((unsigned long, char *)); /* language.c */ /* Type predicates */ diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index fdc3386..0b678fd 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -409,9 +409,9 @@ const struct language_defn m2_language_defn = { &builtin_type_m2_card, /* longest unsigned integral type */ &builtin_type_m2_real, /* longest floating point type */ {"", "", "", ""}, /* Binary format info */ - {"%oB", "", "o", "B"}, /* Octal format info */ - {"%d", "", "d", ""}, /* Decimal format info */ - {"0%XH", "0", "X", "H"}, /* Hex format info */ + {"%loB", "", "o", "B"}, /* Octal format info */ + {"%ld", "", "d", ""}, /* Decimal format info */ + {"0%lXH", "0", "X", "H"}, /* Hex format info */ m2_op_print_tab, /* expression operators for printing */ LANG_MAGIC }; diff --git a/gdb/maint.c b/gdb/maint.c index bc73bdc..b533451 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -136,13 +136,16 @@ print_section_table (abfd, asect, ignore) flags = bfd_get_section_flags (abfd, asect); printf_filtered (" %s", - local_hex_string_custom (bfd_section_vma (abfd, asect), - "08")); + local_hex_string_custom + ((unsigned long) bfd_section_vma (abfd, asect), "08l")); printf_filtered ("->%s", - local_hex_string_custom ((bfd_section_vma (abfd, asect) - + bfd_section_size (abfd, asect)), - "08")); - printf_filtered (" at %s", local_hex_string_custom (asect->filepos, "08")); + local_hex_string_custom + ((unsigned long) (bfd_section_vma (abfd, asect) + + bfd_section_size (abfd, asect)), + "08l")); + printf_filtered (" at %s", + local_hex_string_custom + ((unsigned long) asect->filepos, "08l")); printf_filtered (": %s", bfd_section_name (abfd, asect)); if (flags & SEC_ALLOC) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 93d5dde..903b9bd 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -87,7 +87,7 @@ add_to_objfile_sections (abfd, asect, objfile_p_char) section.addr = bfd_section_vma (abfd, asect); section.endaddr = section.addr + bfd_section_size (abfd, asect); obstack_grow (&objfile->psymbol_obstack, §ion, sizeof(section)); - objfile->sections_end = (struct obj_section *) (((int) objfile->sections_end) + 1); + objfile->sections_end = (struct obj_section *) (((unsigned long) objfile->sections_end) + 1); } /* Builds a section table for OBJFILE. @@ -104,7 +104,7 @@ build_objfile_section_table (objfile) bfd_map_over_sections (objfile->obfd, add_to_objfile_sections, (char *)objfile); objfile->sections = (struct obj_section *) obstack_finish (&objfile->psymbol_obstack); - objfile->sections_end = objfile->sections + (int) objfile->sections_end; + objfile->sections_end = objfile->sections + (unsigned long) objfile->sections_end; return(0); } diff --git a/gdb/partial-stab.h b/gdb/partial-stab.h index e511599..3be0be6 100644 --- a/gdb/partial-stab.h +++ b/gdb/partial-stab.h @@ -613,6 +613,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* If we haven't found it yet, ignore it. It's probably some new type we don't know about yet. */ complain (&unknown_symtype_complaint, - local_hex_string (CUR_SYMBOL_TYPE)); + local_hex_string ((unsigned long) CUR_SYMBOL_TYPE)); continue; } diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c index d4d5f9e..f7bd842 100644 --- a/gdb/remote-vx.c +++ b/gdb/remote-vx.c @@ -571,7 +571,7 @@ vx_run_files_info () { printf ("\tRunning %s VxWorks process %s", vx_running? "child": "attached", - local_hex_string(inferior_pid)); + local_hex_string((unsigned long) inferior_pid)); if (vx_running) printf (", function `%s'", vx_running); printf(".\n"); @@ -908,7 +908,8 @@ vx_wait (status) sleep_ms (200); /* FIXME Don't kill the network too badly */ } else if (pid != inferior_pid) - fatal ("Bad pid for debugged task: %s\n", local_hex_string(pid)); + fatal ("Bad pid for debugged task: %s\n", + local_hex_string((unsigned long) pid)); } while (pid == 0); /* FIXME, eventually do more then SIGTRAP on everything... */ @@ -1102,7 +1103,8 @@ vx_attach (args, from_tty) error ("Invalid process-id -- give a single number in decimal or 0xhex"); if (from_tty) - printf ("Attaching pid %s.\n", local_hex_string(pid)); + printf ("Attaching pid %s.\n", + local_hex_string((unsigned long) pid)); memset ((char *)&ptrace_in, '\0', sizeof (ptrace_in)); memset ((char *)&ptrace_out, '\0', sizeof (ptrace_out)); @@ -1147,7 +1149,8 @@ vx_detach (args, from_tty) error ("Argument given to VxWorks \"detach\"."); if (from_tty) - printf ("Detaching pid %s.\n", local_hex_string(inferior_pid)); + printf ("Detaching pid %s.\n", + local_hex_string((unsigned long) inferior_pid)); if (args) /* FIXME, should be possible to leave suspended */ signal = atoi (args); @@ -1178,7 +1181,7 @@ vx_kill () Ptrace_return ptrace_out; int status; - printf ("Killing pid %s.\n", local_hex_string(inferior_pid)); + printf ("Killing pid %s.\n", local_hex_string((unsigned long) inferior_pid)); memset ((char *)&ptrace_in, '\0', sizeof (ptrace_in)); memset ((char *)&ptrace_out, '\0', sizeof (ptrace_out)); diff --git a/gdb/symtab.c b/gdb/symtab.c index e6cbbc6..60b7211 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -972,7 +972,8 @@ find_pc_symtab (pc) will cause a core dump), but maybe we can successfully continue, so let's not. */ warning ("\ -(Internal error: pc 0x%x in read in psymtab, but not in symtab.)\n", pc); +(Internal error: pc 0x%lx in read in psymtab, but not in symtab.)\n", + (unsigned long) pc); s = PSYMTAB_TO_SYMTAB (ps); } return (s); @@ -2585,8 +2586,8 @@ list_symbols (regexp, class, bpt) printf_filtered ("\nNon-debugging symbols:\n"); found_in_file = 1; } - printf_filtered (" %08x %s\n", - SYMBOL_VALUE_ADDRESS (msymbol), + printf_filtered (" %08lx %s\n", + (unsigned long) SYMBOL_VALUE_ADDRESS (msymbol), SYMBOL_SOURCE_NAME (msymbol)); } } diff --git a/gdb/value.h b/gdb/value.h index 15b5053..dbc0f86 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -168,8 +168,7 @@ value_fetch_lazy PARAMS ((value val)); /* If ARG is an enum, convert it to an integer. */ #define COERCE_ENUM(arg) \ -{ if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_REF) \ - arg = value_ind (arg); \ +{ COERCE_REF (arg); \ if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ENUM) \ arg = value_cast (builtin_type_unsigned_int, arg); \ } @@ -218,132 +217,98 @@ unpack_long PARAMS ((struct type *type, char *valaddr)); extern double unpack_double PARAMS ((struct type *type, char *valaddr, int *invp)); -extern CORE_ADDR -unpack_pointer PARAMS ((struct type *type, char *valaddr)); +extern CORE_ADDR unpack_pointer PARAMS ((struct type *type, char *valaddr)); -extern LONGEST -unpack_field_as_long PARAMS ((struct type *type, char *valaddr, - int fieldno)); +extern LONGEST unpack_field_as_long PARAMS ((struct type *type, char *valaddr, + int fieldno)); -extern value -value_from_longest PARAMS ((struct type *type, LONGEST num)); +extern value value_from_longest PARAMS ((struct type *type, LONGEST num)); -extern value -value_from_double PARAMS ((struct type *type, double num)); +extern value value_from_double PARAMS ((struct type *type, double num)); -extern value -value_at PARAMS ((struct type *type, CORE_ADDR addr)); +extern value value_at PARAMS ((struct type *type, CORE_ADDR addr)); -extern value -value_at_lazy PARAMS ((struct type *type, CORE_ADDR addr)); +extern value value_at_lazy PARAMS ((struct type *type, CORE_ADDR addr)); /* FIXME: Assumes equivalence of "struct frame_info *" and "FRAME" */ -extern value -value_from_register PARAMS ((struct type *type, int regnum, - struct frame_info * frame)); +extern value value_from_register PARAMS ((struct type *type, int regnum, + struct frame_info * frame)); -extern value -value_of_variable PARAMS ((struct symbol *var)); +extern value value_of_variable PARAMS ((struct symbol *var, struct block *b)); -extern value -value_of_register PARAMS ((int regnum)); +extern value value_of_register PARAMS ((int regnum)); /* FIXME: Assumes equivalence of "struct frame_info *" and "FRAME" */ -extern value -read_var_value PARAMS ((struct symbol *var, struct frame_info *frame)); +extern value read_var_value PARAMS ((struct symbol *var, + struct frame_info *frame)); /* FIXME: Assumes equivalence of "struct frame_info *" and "FRAME" */ -extern value -locate_var_value PARAMS ((struct symbol *var, struct frame_info *frame)); +extern value locate_var_value PARAMS ((struct symbol *var, + struct frame_info *frame)); -extern value -allocate_value PARAMS ((struct type *type)); +extern value allocate_value PARAMS ((struct type *type)); -extern value -allocate_repeat_value PARAMS ((struct type *type, int count)); +extern value allocate_repeat_value PARAMS ((struct type *type, int count)); -extern value -value_mark PARAMS ((void)); +extern value value_mark PARAMS ((void)); -extern void -value_free_to_mark PARAMS ((value mark)); +extern void value_free_to_mark PARAMS ((value mark)); -extern value -value_string PARAMS ((char *ptr, int len)); +extern value value_string PARAMS ((char *ptr, int len)); -extern value -value_array PARAMS ((int lowbound, int highbound, value *elemvec)); +extern value value_array PARAMS ((int lowbound, int highbound, + value *elemvec)); -extern value -value_concat PARAMS ((value arg1, value arg2)); +extern value value_concat PARAMS ((value arg1, value arg2)); -extern value -value_binop PARAMS ((value arg1, value arg2, enum exp_opcode op)); +extern value value_binop PARAMS ((value arg1, value arg2, enum exp_opcode op)); -extern value -value_add PARAMS ((value arg1, value arg2)); +extern value value_add PARAMS ((value arg1, value arg2)); -extern value -value_sub PARAMS ((value arg1, value arg2)); +extern value value_sub PARAMS ((value arg1, value arg2)); -extern value -value_coerce_array PARAMS ((value arg1)); +extern value value_coerce_array PARAMS ((value arg1)); -extern value -value_coerce_function PARAMS ((value arg1)); +extern value value_coerce_function PARAMS ((value arg1)); -extern value -value_ind PARAMS ((value arg1)); +extern value value_ind PARAMS ((value arg1)); -extern value -value_addr PARAMS ((value arg1)); +extern value value_addr PARAMS ((value arg1)); -extern value -value_assign PARAMS ((value toval, value fromval)); +extern value value_assign PARAMS ((value toval, value fromval)); -extern value -value_neg PARAMS ((value arg1)); +extern value value_neg PARAMS ((value arg1)); -extern value -value_complement PARAMS ((value arg1)); +extern value value_complement PARAMS ((value arg1)); -extern value -value_struct_elt PARAMS ((value *argp, value *args, char *name, - int *static_memfuncp, char *err)); +extern value value_struct_elt PARAMS ((value *argp, value *args, char *name, + int *static_memfuncp, char *err)); -extern value -value_struct_elt_for_reference PARAMS ((struct type *domain, - int offset, - struct type *curtype, - char *name, - struct type *intype)); +extern value value_struct_elt_for_reference PARAMS ((struct type *domain, + int offset, + struct type *curtype, + char *name, + struct type *intype)); -extern value -value_field PARAMS ((value arg1, int fieldno)); +extern value value_field PARAMS ((value arg1, int fieldno)); -extern value -value_primitive_field PARAMS ((value arg1, int offset, int fieldno, - struct type *arg_type)); +extern value value_primitive_field PARAMS ((value arg1, int offset, + int fieldno, + struct type *arg_type)); -extern value -value_cast PARAMS ((struct type *type, value arg2)); +extern value value_cast PARAMS ((struct type *type, value arg2)); -extern value -value_zero PARAMS ((struct type *type, enum lval_type lv)); +extern value value_zero PARAMS ((struct type *type, enum lval_type lv)); -extern value -value_repeat PARAMS ((value arg1, int count)); +extern value value_repeat PARAMS ((value arg1, int count)); -extern value -value_subscript PARAMS ((value array, value idx)); +extern value value_subscript PARAMS ((value array, value idx)); -extern value -value_from_vtable_info PARAMS ((value arg, struct type *type)); +extern value value_from_vtable_info PARAMS ((value arg, struct type *type)); -extern value -value_being_returned PARAMS ((struct type *valtype, - char retbuf[REGISTER_BYTES], - int struct_return)); +extern value value_being_returned PARAMS ((struct type *valtype, + char retbuf[REGISTER_BYTES], + int struct_return)); extern int using_struct_return PARAMS ((value function, CORE_ADDR funcaddr, @@ -455,7 +420,7 @@ extern CORE_ADDR read_register PARAMS ((int regno)); extern void -write_register PARAMS ((int regno, int val)); +write_register PARAMS ((int regno, long val)); extern void supply_register PARAMS ((int regno, char *val)); @@ -467,7 +432,7 @@ get_saved_register PARAMS ((char *raw_buffer, int *optimized, int regnum, enum lval_type *lval)); extern void -modify_field PARAMS ((char *addr, int fieldval, int bitpos, int bitsize)); +modify_field PARAMS ((char *addr, LONGEST fieldval, int bitpos, int bitsize)); extern void type_print PARAMS ((struct type *type, char *varstring, FILE *stream, @@ -478,7 +443,7 @@ baseclass_addr PARAMS ((struct type *type, int index, char *valaddr, value *valuep, int *errp)); extern void -print_longest PARAMS ((FILE *stream, char format, int use_local, +print_longest PARAMS ((FILE *stream, int format, int use_local, LONGEST value)); extern void diff --git a/gdb/xcoffexec.c b/gdb/xcoffexec.c index 474bfbd..3853486 100644 --- a/gdb/xcoffexec.c +++ b/gdb/xcoffexec.c @@ -732,11 +732,13 @@ print_section_info (t, abfd) printf_filtered ("file type %s.\n", bfd_get_target(abfd)); for (p = t->to_sections; p < t->to_sections_end; p++) { - printf_filtered ("\t%s", local_hex_string_custom (p->addr, "08")); - printf_filtered (" - %s", local_hex_string_custom (p->endaddr, "08")); + printf_filtered ("\t%s", + local_hex_string_custom ((unsigned long) p->addr, "08l")); + printf_filtered (" - %s", + local_hex_string_custom ((unsigned long) p->endaddr, "08l")); if (info_verbose) printf_filtered (" @ %s", - local_hex_string_custom (p->sec_ptr->filepos, "08")); + local_hex_string_custom ((unsigned long) p->sec_ptr->filepos, "08l")); printf_filtered (" is %s", bfd_section_name (p->bfd, p->sec_ptr)); if (p->bfd != abfd) { printf_filtered (" in %s", bfd_get_filename (p->bfd));