void*.
From Philippe De Muyter <phdm@macqel.be>:
* printcmd.c (print_address_symbolic): Call `make_cleanup' with
`(free_current_contents, &x)', not `(free, x)'.
* utils.c (free_current_contents): Do not `free (NULL)'.
* printcmd.c (print_address_symbolic): Cleanup after a failed
call to build_address_symbolic.
functions which architectures can redefine, defaulting to
generic_pointer_to_address and generic_address_to_pointer.
* findvar.c (extract_typed_address, store_typed_address,
generic_pointer_to_address, generic_address_to_pointer): New
functions.
(POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Provide default
definitions.
(extract_address, store_address): Doc fixes.
* values.c (value_as_pointer): Doc fix.
(value_from_pointer): New function.
* defs.h (extract_typed_address, store_typed_address): New
declarations.
* inferior.h (generic_address_to_pointer,
generic_pointer_to_address): New declarations.
* value.h (value_from_pointer): New declaration.
* ax-gdb.c (const_var_ref): Use value_from_pointer, not
value_from_longest.
* blockframe.c (generic_push_dummy_frame): Use read_pc and
read_sp, not read_register.
* c-valprint.c (c_val_print): Use extract_typed_address instead of
extract_address to extract vtable entries and references.
* cp-valprint.c (cp_print_value_fields): Use value_from_pointer
instead of value_from_longest to extract the vtable's address.
* eval.c (evaluate_subexp_standard): Use value_from_pointer
instead of value_from_longest to compute `this', and for doing
pointer-to-member dereferencing.
* findvar.c (read_register): Use extract_unsigned_integer, not
extract_address.
(read_var_value): Use store_typed_address instead of store_address
for building label values.
(locate_var_value): Use value_from_pointer instead of
value_from_longest.
* hppa-tdep.c (find_stub_with_shl_get): Use value_from_pointer,
instead of value_from_longest, to build arguments to __d_shl_get.
* printcmd.c (set_next_address): Use value_from_pointer, not
value_from_longest.
(x_command): Use value_from_pointer, not value_from_longest.
* tracepoint.c (set_traceframe_context): Use value_from_pointer,
not value_from_longest.
* valarith.c (value_add, value_sub): Use value_from_pointer, not
value_from_longest.
* valops.c (find_function_in_inferior, value_coerce_array,
value_coerce_function, value_addr, hand_function_call): Same.
* value.h (COERCE_REF): Use unpack_pointer, not unpack_long.
* values.c (unpack_long): Use extract_typed_address to produce
addresses from pointers and references, not extract_address.
(value_from_longest): Use store_typed_address instead of
store_address to produce pointer and reference values.
* defs.h (struct continuation_arg): make 'data' a union, to avoid
casting problems when int and pointer are not the same size.
* event-top.c (command_handler): use data as a union.
(command_line_handler_continuation): ditto.
* infcmd.c (step_1_continuation): use data as a union. Re-indent.
(step_once): ditto. (finish_command_continuation): ditto.
(finish_command): ditto.
* breakpoint.c (until_break_command): use data as a union.
(until_break_command_continuation): ditto.
* utils.c (add_intermediate_continuation): fix typo in comment.
* defs.h (struct continuation_arg): Change type of field 'data'
from PTR to void *.
* event-loop.h: Eliminate uses of PTR, use 'void *' instead.
* event-top.c: Ditto.
(error_return, quit_return): Merge into catch_return pointer.
(return_to_top_level): Update comment. Longjmp to *catch_errors,
and communicate reason to catch_errors via setjmp return value.
(catch_errors): Always catch both quit and error, and if a catch
wasn't requested by caller, throw it to the next catch_error.
Replace dual longjmp buffer memcpy with single pointer change.
Add FIXME for possibly adding new interface to tell caller what
event was caught. Add extensive comments.
* defs.h (enum return_reason): Reserve 0 for use as initial
setjmp() return value.
(RETURN_MASK): New public macro to generate RETURN_MASK_* from
enum return_reason.
(RETURN_MASK_QUIT, RETURN_MASK_ERROR): Define using RETURN_MASK.
Re-do TARGET_PRINT_INSN_INFO, TARGET_PRINT_INSN, TARGET_ARCHITECTURE,
TARGET_ARCHITECTURE_AUTO, TARGET_BYTE_ORDER_SELECTABLE_P,
TARGET_BYTE_ORDER so that they can all be overriden.
Document.
Convert mn10300 and PPC targets.
* config/xm-aix4.h (SIGWINCH_HANDLER): Function `aix_resize_window'
must accept a signal number as parameter.
* config/rs6000/xm-rs6000.h (SIGWINCH_HANDLER): Ditto.
* utils.c (initialize_utils): Give a parameter to `SIGWINCH_HANDLER'.
* inferior.h (register_valid): Variable's type is `SIGNED char', not
`char'.
* findvar.c (register_valid): Ditto.
* defs.h (make_cleanup_func): Protect parameter list by `PARAMS'.
* gdbthread.h (unbind_target_thread_vector): Likewise.
* blockframe.c (find_pc_sect_partial_function): Add braces to avoid
possible nested-if confusion.
* breakpoint.c (breakpoint_here_p): Ditto.
(breakpoint_inserted_here_p): Ditto.
(breakpoint_thread_match): Ditto.
* gnu-regex.c: Define _REGEX_RE_COMP only if it isn't already defined.
* gnu-regex.h: Define _REGEX_RE_COMP to pick up old compatability
prototypes.
* symtab.h: Add prototype for _initialize_source.
* value.h: Add prototype for _initialize_value.
* defs.h: Include sys/types.h or stddef.h to get size_t.
(make_cleanup): Add make_cleanup_func typedef and switch to using
a prototype for this function.
(mfree): Add prototypes for mmalloc, mrealloc, mfree if we aren't
using mmalloc.
* ax-gdb.c breakpoint.c coffread.c corelow.c dbxread.c dwarf2read.c
dwarfread.c elfread.c eval.c exec.c gdbtk-cmds.c gdbtk.c infcmd.c
infrun.c mipsread.c nlmread.c os9kread.c parse.c printcmd.c symfile.c
symmisc.c symtab.c thread.c top.c tracepoint.c typeprint.c valops.c:
Cast parameters passed to make_cleanup to use the new
make_cleanup_func typedef.
More warning cleanups. There are still a bunch of places where the first
argument to make_cleanup is not cast to (make_cleanup_func); these are
either due to the function fitting the make_cleanup_func specification
already (e.g. free()) or they are in files that weren't compiled when
I did my make on a Linux native system. Bwahahaha. You can see them
like this:
grep make_cleanup\ * | grep -v make_cleanup_func
I'll surely go back and clean up the remaining suspicious calls in
GDB one of these days. :-)
* monitor.c (monitor_debug): Move to utils.c, rename to puts_debug.
(monitor_write_memory, monitor_read_memory, monitor_insert_breakpoint,
monitor_remove_breakpoint): Remove useless address bits if current
monitor has MO_ADDR_BITS_REMOVE flag.
* monitor.h (MO_ADDR_BITS_REMOVE): Define.
* utils.c (puts_debug): Formerly monitor_debug from monitor.c;
move here and make public. Add better support for carriage returns.
* defs.h (puts_debug): Declare.
* dsrec.c (load_srec): Use puts_debug to print remotedebug information.
Output header record correctly.
(make_srec): Output a header record instead of a termination record
if sect is non-NULL (value is ignored), but abfd is NULL.
* config/mips/tm-tx39.h (DEFAULT_MIPS_TYPE): Remove definition.
(REGISTER_NAMES): Define to add R3900-specific registers.
* config/mips/tm-tx39l.h: Ditto.
* config/mips/tx39.mt (TDEPFILES): Add dve3900-rom.o and support files.
* config/mips/tx39l.mt: Ditto.
Add prototypes for make_final_cleanup (and the other cleanup
routines.
* remote-e7000.c: Fix sync code to timeout if unable to sync.
Change sync code to report status while trying to sync-up
with hardware. Add debugging output and document.
* ser-e7kpc.c: Swap order of len & offset to match implementation.
Add debugging output and document.
* serial.c: Add debugging output.
* top.c: Add call to do_final_cleanups.
Remove conditionals preventing Win32 from getting SIGQUIT.
* utils.c: (*_cleanup): Modify cleanup routines to accept a cleanup
chain as a parameter. Extract this generic code from the cleanup
routines into separate funtions (*_my_cleanup). Keep old
functionality by passing "cleanup_chain" to the new funtions.
Define the cleanup chain "final_cleanup_chain" to be a cleanup
chain which will be executed only when gdb exits. Add functions
(*_final_cleanup) to match the original (*_cleanup) functions.
(pollquit, quit, notice_quit): Fix to read cntl-C from the
Windows message queue.
* defs.h: modify Nov 11 12:59:00 change so _MSC_VER is checked
instead of _WIN32
* win32-nat.c: fix Nov 11 12:59:00 change (windows.h should
be included instead of windefs.h for compilers other than
VC++).
* mswin/windefs.h: remove ^Ms and change C++ style comments
to C style comments
config/mips/tm-mips.h: Add/fix bugs for 64-bit mips support.
* defs.h: Cleanup; add prototypess
* corefile.c: Change FIXME #ifdef
* win32-nat.c: Include windefs instead of windows.h.
* utils.c: Add routines for printing addresses and registers
based on type size.
mdebugread.c os9kread.c source.c top.c utils.c: Don't
include param.h or sys/file.h (or unistd.h in some cases).
* defs.h exec.c inflow.c remote-array.c remote-e7000.c
sparcl-tdep.c terminal.h utils.c: Replace all occurances of
__WIN32__, WINGDB, WIN32, etc... with _WIN32.
* main.c: Remove #ifndef WINGDB around option processing. Fix
bug with passing argc==0 and argv==NULL to getopt.
* (main) Remove calls to access() before source_command. Let
soure_command handle access errors.
* maint.c (maintenance_dump_me): #ifdef out for _WIN32.
* symtab.c (operator_chars): Make this global for wingdb.
* top.c (disconnect): #ifdef out for _WIN32.
* (source_command): If got an error and from_tty, then call print
error, else just return quietly.
* utils.c (fatal_dump_core): Can't kill ourselves under windows.
Just exit.
* (pollquit notice_quit): #ifdef out stuff that doesn't exist
under windows.
tm_print_insn_info.
* gdbtk.c (gdb_disassemble): Setup di.mach from
tm_print_insn_info.mach, and set endian from TARGET_BYTE_ORDER.
* i386-tdep.c (set_assembly_language_command): set
tm_print_insn_info.mach to the appropriate value for 386 or 8086
disassembly.
* printcmd.c (print_insn): Move init of disassembler_info to
_initialize_printcmd. Set endian for disassembler here.
* sparc-tdep.c: Set tm_print_insn_info.mach as appropriate to
select sparc/sparclite.
* config/sparc/{tm-sparc.h tm-sparclite.h}: Get rid of
TM_PRINT_INSN. Set TM_PRINT_INSN_MACH to
bfd_mach_sparc/bfd_mach_sparc_sparclite.
defaults for bi-endian targets. Replace function pointers for
floatformat routines with macros. No need for these to be runtime
selectable.
* findvar.c: Get rid of floatformat function pointers. Use
macros in extract_floating and store_floating.
* remote-nindy.c (nindy_fetch_registers nindy_store_registers):
Use floatformat macros.
* configure.in (AC_CHECK_HEADERS): check for endian.h.
Use AC_CHECK_TOOL to find AR & RANLIB. Add AC_PROG_AWK.
Add host & target cases for i[345]86-*-gnu*.
* config.in: Regenerate with autoheader.
* configure: Regenerate with autoconf.
* Makefile.in (AR, AWK): Set from corresponding autoconf substs.
(init.c): Don't scan mig-generated files.
* defs.h (endian.h): Include if HAVE_ENDIAN_H defined.
* config/nm-m3.h (ATTACH_NO_WAIT): Define.
* infcmd.c (attach_command): Use "#ifndef ATTACH_NO_WAIT"
rather than "#ifndef MACH".
* (dcache_peek dcache_fetch dcache_poke): Make dcache_fetch and
dcache_poke call dcache_xfer_memory directly in order to fix
problems with turning off dcache. dcache_peek is now unnecessary,
so it goes away.
* defs.h: Define new macros HOST_{FLOAT DOUBLE LONG_DOUBLE}_FORMAT
and TARGET_{FLOAT DOUBLE LONG_DOUBLE}_FORMAT to specify a pointer
to a struct floatformat. This allows for better handling of
targets whose floating point formats differ from the host by more
than just byte order.
* (floatformat_to_long_double floatformat_from_long_double):
Prototypes for new functions in utils.c.
* (floatformat_to_doublest floatformat_from_doublest): Prototypes
for pointers to floating point conversion functions. The actual
function uses either double or long double if the host supports it.
* findvar.c (floatformat_to_doublest floatformat_from_doublest):
Initialize to point at correct function depending on HAVE_LONG_DOUBLE.
* (extract_floating store_floating): Rewrite. Now, if host fp
format is the same as the target, we just do a copy. Otherwise,
we call floatformat_{to from}_doublest.
* remote-nindy.c (nindy_xfer_inferior_memory): Change param
`write' to `should_write'.
* utils.c (floatformat_to_long_double
floatformat_from_long_double): New routines that implement long
double versions of functions in libiberty/floatformat.c.
* config/i960/tm-i960.h (TARGET_LONG_DOUBLE_FORMAT): Define this for
i960 extended real (80 bit) numbers.
* nindy-share/nindy.c (ninMemGet ninMemPut): Return number of bytes
actually read or written.
character is one of the commonly used C++ marker characters.
* defs.h (is_cplus_marker): Add prototype.
* c-typeprint.c (c_type_print_base), ch-lang.c (chill_demangle),
cp-valprint.c (cp_print_class_method), mdebugread.c (parse_symbol),
stabsread.c (define_symbol, read_member_functions, read_struct_fields),
symtab.h (OPNAME_PREFIX_P, VTBL_PREFIX_P, DESTRUCTOR_PREFIX_P),
values.c (vb_match): Use is_cplus_marker instead of comparison
with CPLUS_MARKER.