* buildsym.h (processing_hp_compilation): Remove obsolete variable.
* gdbarch.sh Remove include of "value.h" in gdbarch.h.
(COERCE_FLOAT_TO_DOUBLE): Remove.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* Makefile.in: Remove value_h from gdbarch_h.
* valops.c (coerce_float_to_double): New variable.
(default_coerce_float_to_double): Remove.
(standard_coerce_float_to_double): Remove.
(value_arg_coerce): Use coerce_float_to_double.
(_initialize_valops): Add "set coerce-float-to-double".
* value.h (default_coerce_float_to_double): Remove prototype.
(standard_coerce_float_to_double): Remove prototype.
* hpread.c (hpread_process_one_debug_symbol): Mark C++ functions as
prototyped.
* mdebugread.c (parse_symbol): Likewise.
* stabsread.c (define_symbol): Mark all functions as prototyped.
* hppa-tdep.c (hppa_coerce_float_to_double): Remove.
* alpha-tdep.c (alpha_gdbarch_init): Remove call to
set_gdbarch_coerce_float_to_double.
* arm-tdep.c (arm_gdbarch_init): Likewise.
* frv-tdep.c (frv_gdbarch_init): Likewise.
* h8300-tdep.c (h8300_gdbarch_init): Likewise (commented out).
* i386-sol2-tdep.c (i386_sol2_init_abi): Likewise.
* mips-tdep.c (mips_gdbarch_init): Likewise.
(mips_coerce_float_to_double): Remove.
* rs6000-tdep.c (rs6000_gdbarch_init): Likewise.
(rs6000_coerce_float_to_double): Remove.
* s390-tdep.c (s390_gdbarch_init): Likewise.
* sh-tdep.c (sh_gdbarch_init): Likewise.
(sh_coerce_float_to_double): Remove.
* sparc-tdep.c (sparc_gdbarch_init): Likewise.
(sparc_coerce_float_to_double): Remove.
* v850-tdep.c (v850_gdbarch_init): Likewise.
* xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise.
* config/m32r/tm-m32r.h (COERCE_FLOAT_TO_DOUBLE): Remove.
* config/pa/tm-hppa.h: (COERCE_FLOAT_TO_DOUBLE): Remove.
(hppa_coerce_float_to_double): Remove prototype.
* config/sparc/tm-sparc.h (COERCE_FLOAT_TO_DOUBLE): Remove.
doc/
* gdb.texinfo (Controlling GDB): Add ABI section. Document
"set coerce-float-to-double".
* gdbint.texinfo (COERCE_FLOAT_TO_DOUBLE): Remove documentation.
testsuite/
* gdb.base/callfuncs.exp: Don't XFAIL unprototyped functions for
stabs.
* gdb.base/completion.exp: Allow marker1(void) as well as marker1().
* gdb.base/whatis.exp: Always allow (void) after function names.
+2003-01-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * buildsym.h (processing_hp_compilation): Remove obsolete variable.
+ * gdbarch.sh Remove include of "value.h" in gdbarch.h.
+ (COERCE_FLOAT_TO_DOUBLE): Remove.
+ * gdbarch.c: Regenerate.
+ * gdbarch.h: Regenerate.
+ * Makefile.in: Remove value_h from gdbarch_h.
+ * valops.c (coerce_float_to_double): New variable.
+ (default_coerce_float_to_double): Remove.
+ (standard_coerce_float_to_double): Remove.
+ (value_arg_coerce): Use coerce_float_to_double.
+ (_initialize_valops): Add "set coerce-float-to-double".
+ * value.h (default_coerce_float_to_double): Remove prototype.
+ (standard_coerce_float_to_double): Remove prototype.
+
+ * hpread.c (hpread_process_one_debug_symbol): Mark C++ functions as
+ prototyped.
+ * mdebugread.c (parse_symbol): Likewise.
+ * stabsread.c (define_symbol): Mark all functions as prototyped.
+
+ * hppa-tdep.c (hppa_coerce_float_to_double): Remove.
+ * alpha-tdep.c (alpha_gdbarch_init): Remove call to
+ set_gdbarch_coerce_float_to_double.
+ * arm-tdep.c (arm_gdbarch_init): Likewise.
+ * frv-tdep.c (frv_gdbarch_init): Likewise.
+ * h8300-tdep.c (h8300_gdbarch_init): Likewise (commented out).
+ * i386-sol2-tdep.c (i386_sol2_init_abi): Likewise.
+ * mips-tdep.c (mips_gdbarch_init): Likewise.
+ (mips_coerce_float_to_double): Remove.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Likewise.
+ (rs6000_coerce_float_to_double): Remove.
+ * s390-tdep.c (s390_gdbarch_init): Likewise.
+ * sh-tdep.c (sh_gdbarch_init): Likewise.
+ (sh_coerce_float_to_double): Remove.
+ * sparc-tdep.c (sparc_gdbarch_init): Likewise.
+ (sparc_coerce_float_to_double): Remove.
+ * v850-tdep.c (v850_gdbarch_init): Likewise.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise.
+ * config/m32r/tm-m32r.h (COERCE_FLOAT_TO_DOUBLE): Remove.
+ * config/pa/tm-hppa.h: (COERCE_FLOAT_TO_DOUBLE): Remove.
+ (hppa_coerce_float_to_double): Remove prototype.
+ * config/sparc/tm-sparc.h (COERCE_FLOAT_TO_DOUBLE): Remove.
+
2003-01-04 Daniel Jacobowitz <drow@mvista.com>
* regformats/reg-m68k.dat: Remove fpcode and fpflags.
gdb_thread_db_h = gdb_thread_db.h
gdb_vfork_h = gdb_vfork.h
gdb_wait_h = gdb_wait.h
-gdbarch_h = gdbarch.h $(dis_asm_h) $(value_h) $(inferior_h)
+gdbarch_h = gdbarch.h $(dis_asm_h) $(inferior_h)
gdbcmd_h = gdbcmd.h $(command_h) $(ui_out_h)
gdbcore_h = gdbcore.h $(bfd_h)
gdbthread_h = gdbthread.h $(breakpoint_h) $(frame_h)
/* Target-dependent code for the ALPHA architecture, for GDB, the GNU Debugger.
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
- /* Floats are always passed as doubles. */
- set_gdbarch_coerce_float_to_double (gdbarch,
- standard_coerce_float_to_double);
-
set_gdbarch_breakpoint_from_pc (gdbarch, alpha_breakpoint_from_pc);
set_gdbarch_decr_pc_after_break (gdbarch, 4);
/* Common target dependent code for GDB on ARM systems.
Copyright 1988, 1989, 1991, 1992, 1993, 1995, 1996, 1998, 1999, 2000,
- 2001, 2002 Free Software Foundation, Inc.
+ 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
set_gdbarch_push_return_address (gdbarch, arm_push_return_address);
set_gdbarch_push_arguments (gdbarch, arm_push_arguments);
- set_gdbarch_coerce_float_to_double (gdbarch,
- standard_coerce_float_to_double);
/* Frame handling. */
set_gdbarch_frame_chain_valid (gdbarch, arm_frame_chain_valid);
/* Build symbol tables in GDB's internal format.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1996,
- 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ 1997, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
EXTERN unsigned char processing_acc_compilation;
-/* elz: added this flag to know when a block is compiled with HP
- compilers (cc, aCC). This is necessary because of the macro
- COERCE_FLOAT_TO_DOUBLE defined in tm_hppa.h, which causes a
- coercion of float to double to always occur in parameter passing
- for a function called by gdb (see the function value_arg_coerce in
- valops.c). This is necessary only if the target was compiled with
- gcc, not with HP compilers or with g++ */
-
-EXTERN unsigned char processing_hp_compilation;
-
/* Count symbols as they are processed, for error messages. */
EXTERN unsigned int symnum;
/* Parameters for execution on a Mitsubishi m32r processor.
- Copyright 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of GDB.
/* mvs_no_check FRAME_NUM_ARGS */
#define FRAME_NUM_ARGS(fi) (-1)
-#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1)
-
extern void m32r_write_sp (CORE_ADDR val);
#define TARGET_WRITE_SP m32r_write_sp
/* Parameters for execution on any Hewlett-Packard PA-RISC machine.
Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1998, 1999, 2000 Free Software Foundation, Inc.
+ 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
#define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR)
extern int hpread_adjust_stack_address (CORE_ADDR);
-/* If the current gcc for for this target does not produce correct debugging
- information for float parameters, both prototyped and unprototyped, then
- define this macro. This forces gdb to always assume that floats are
- passed as doubles and then converted in the callee. */
-
-#if !GDB_MULTI_ARCH
-extern int hppa_coerce_float_to_double (struct type *formal,
- struct type *actual);
-#define COERCE_FLOAT_TO_DOUBLE(formal, actual) \
- hppa_coerce_float_to_double (formal, actual)
-#endif
-
/* Here's how to step off a permanent breakpoint. */
#define SKIP_PERMANENT_BREAKPOINT (hppa_skip_permanent_breakpoint)
extern void hppa_skip_permanent_breakpoint (void);
/* Target machine sub-parameters for SPARC, for GDB, the GNU debugger.
This is included by other tm-*.h files to define SPARC cpu-related info.
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000
+ 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@mcc.com)
extern CORE_ADDR sparc_extract_struct_value_address (char *);
-/* If the current gcc for for this target does not produce correct
- debugging information for float parameters, both prototyped and
- unprototyped, then define this macro. This forces gdb to always
- assume that floats are passed as doubles and then converted in the
- callee. */
-
-#define COERCE_FLOAT_TO_DOUBLE(FORMAL, ACTUAL) (1)
-
/* Stack must be aligned on 64-bit boundaries when synthesizing
function calls (128-bit for sparc64). */
+2003-01-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.texinfo (Controlling GDB): Add ABI section. Document
+ "set coerce-float-to-double".
+ * gdbint.texinfo (COERCE_FLOAT_TO_DOUBLE): Remove documentation.
+
2003-01-02 Andrew Cagney <ac131313@redhat.com>
* stabs.texinfo: Remove obsolete text.
\input texinfo @c -*-texinfo-*-
@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
-@c 1999, 2000, 2001, 2002
+@c 1999, 2000, 2001, 2002, 2003
@c Free Software Foundation, Inc.
@c
@c %**start of header
for @value{GDBN} Version @value{GDBVN}.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,@*
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
@vskip 0pt plus 1filll
Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@sp 2
Published by the Free Software Foundation @*
59 Temple Place - Suite 330, @*
This is the @value{EDITION} Edition, @value{DATE}, for @value{GDBN} Version
@value{GDBVN}.
-Copyright (C) 1988-2002 Free Software Foundation, Inc.
+Copyright (C) 1988-2003 Free Software Foundation, Inc.
@menu
* Summary:: Summary of @value{GDBN}
* History:: Command history
* Screen Size:: Screen size
* Numbers:: Numbers
+* ABI:: Configuring the current ABI
* Messages/Warnings:: Optional warnings and messages
* Debugging Output:: Optional messages about internal happenings
@end menu
Display the current default base for numeric display.
@end table
+@node ABI
+@section Configuring the current ABI
+
+@value{GDBN} can determine the @dfn{ABI} (Application Binary Interface) of your
+application automatically. However, sometimes you need to override its
+conclusions. Use these commands to manage @value{GDBN}'s view of the
+current ABI.
+
+@cindex float promotion
+@kindex set coerce-float-to-double
+
+Generally, the way that an argument of type @code{float} is passed to a
+function depends on whether the function is prototyped. For a prototyped
+(i.e.@: ANSI/ISO style) function, @code{float} arguments are passed unchanged,
+according to the architecture's convention for @code{float}. For unprototyped
+(i.e.@: K&R style) functions, @code{float} arguments are first promoted to type
+@code{double} and then passed.
+
+Unfortunately, some forms of debug information do not reliably indicate whether
+a function is prototyped. If @value{GDBN} calls a function that is not marked
+as prototyped, it consults @kbd{set coerce-float-to-double}.
+
+@table @code
+@item set coerce-float-to-double
+@itemx set coerce-float-to-double on
+Arguments of type @code{float} will be promoted to @code{double} when passed
+to an unprototyped function. This is the default setting.
+
+@item set coerce-float-to-double off
+Arguments of type @code{float} will be passed directly to unprototyped
+functions.
+@end table
+
@node Messages/Warnings
@section Optional warnings and messages
@ifinfo
This file documents the internals of the GNU debugger @value{GDBN}.
-Copyright 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,2002
+Copyright 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,2002,2003
Free Software Foundation, Inc.
Contributed by Cygnus Solutions. Written by John Gilmore.
Second Edition by Stan Shebs.
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001, 2002
- Free Software Foundation, Inc.
+Copyright @copyright{} 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,
+ 2002, 2003 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
Currently only implemented correctly for native Sparc configurations?
-@item COERCE_FLOAT_TO_DOUBLE (@var{formal}, @var{actual})
-@findex COERCE_FLOAT_TO_DOUBLE
-@cindex promotion to @code{double}
-@cindex @code{float} arguments
-@cindex prototyped functions, passing arguments to
-@cindex passing arguments to prototyped functions
-Return non-zero if GDB should promote @code{float} values to
-@code{double} when calling a non-prototyped function. The argument
-@var{actual} is the type of the value we want to pass to the function.
-The argument @var{formal} is the type of this argument, as it appears in
-the function's definition. Note that @var{formal} may be zero if we
-have no debugging information for the function, or if we're passing more
-arguments than are officially declared (for example, varargs). This
-macro is never invoked if the function definitely has a prototype.
-
-How you should pass arguments to a function depends on whether it was
-defined in K&R style or prototype style. If you define a function using
-the K&R syntax that takes a @code{float} argument, then callers must
-pass that argument as a @code{double}. If you define the function using
-the prototype syntax, then you must pass the argument as a @code{float},
-with no promotion.
-
-Unfortunately, on certain older platforms, the debug info doesn't
-indicate reliably how each function was defined. A function type's
-@code{TYPE_FLAG_PROTOTYPED} flag may be unset, even if the function was
-defined in prototype style. When calling a function whose
-@code{TYPE_FLAG_PROTOTYPED} flag is unset, GDB consults the
-@code{COERCE_FLOAT_TO_DOUBLE} macro to decide what to do.
-
-@findex standard_coerce_float_to_double
-For modern targets, it is proper to assume that, if the prototype flag
-is unset, that can be trusted: @code{float} arguments should be promoted
-to @code{double}. You should use the function
-@code{standard_coerce_float_to_double} to get this behavior.
-
-@findex default_coerce_float_to_double
-For some older targets, if the prototype flag is unset, that doesn't
-tell us anything. So we guess that, if we don't have a type for the
-formal parameter (@i{i.e.}, the first argument to
-@code{COERCE_FLOAT_TO_DOUBLE} is null), then we should promote it;
-otherwise, we should leave it alone. The function
-@code{default_coerce_float_to_double} provides this behavior; it is the
-default value, for compatibility with older configurations.
-
@item int CONVERT_REGISTER_P(@var{regnum})
@findex CONVERT_REGISTER_P
Return non-zero if register @var{regnum} can represent data values in a
/* Target-dependent code for the Fujitsu FR-V, for GDB, the GNU Debugger.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
/* Settings for calling functions in the inferior. */
set_gdbarch_call_dummy_length (gdbarch, 0);
- set_gdbarch_coerce_float_to_double (gdbarch,
- standard_coerce_float_to_double);
set_gdbarch_push_arguments (gdbarch, frv_push_arguments);
set_gdbarch_push_return_address (gdbarch, frv_push_return_address);
set_gdbarch_pop_frame (gdbarch, frv_pop_frame);
/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc;
int believe_pcc_promotion;
int believe_pcc_promotion_type;
- gdbarch_coerce_float_to_double_ftype *coerce_float_to_double;
gdbarch_get_saved_register_ftype *get_saved_register;
gdbarch_register_convertible_ftype *register_convertible;
gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
0,
0,
0,
- 0,
generic_in_function_epilogue_p,
construct_inferior_arguments,
0,
current_gdbarch->call_dummy_words = legacy_call_dummy_words;
current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
current_gdbarch->call_dummy_stack_adjust_p = -1;
- current_gdbarch->coerce_float_to_double = default_coerce_float_to_double;
current_gdbarch->register_convertible = generic_register_convertible_not;
current_gdbarch->convert_register_p = legacy_convert_register_p;
current_gdbarch->register_to_value = legacy_register_to_value;
fprintf_unfiltered (log, "\n\tfix_call_dummy");
/* Skip verify of deprecated_init_frame_pc_first, has predicate */
/* Skip verify of deprecated_init_frame_pc, has predicate */
- /* Skip verify of coerce_float_to_double, invalid_p == 0 */
/* Skip verify of get_saved_register, has predicate */
/* Skip verify of register_convertible, invalid_p == 0 */
/* Skip verify of register_convert_to_virtual, invalid_p == 0 */
(long) current_gdbarch->cannot_store_register
/*CANNOT_STORE_REGISTER ()*/);
#endif
-#ifdef COERCE_FLOAT_TO_DOUBLE
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "COERCE_FLOAT_TO_DOUBLE(formal, actual)",
- XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = <0x%08lx>\n",
- (long) current_gdbarch->coerce_float_to_double
- /*COERCE_FLOAT_TO_DOUBLE ()*/);
-#endif
#ifdef COFF_MAKE_MSYMBOL_SPECIAL
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
}
-int
-gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
-{
- gdb_assert (gdbarch != NULL);
- if (gdbarch->coerce_float_to_double == 0)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_coerce_float_to_double invalid");
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n");
- return gdbarch->coerce_float_to_double (formal, actual);
-}
-
-void
-set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
- gdbarch_coerce_float_to_double_ftype coerce_float_to_double)
-{
- gdbarch->coerce_float_to_double = coerce_float_to_double;
-}
-
int
gdbarch_get_saved_register_p (struct gdbarch *gdbarch)
{
/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
#include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
#if !GDB_MULTI_ARCH
/* Pull in function declarations refered to, indirectly, via macros. */
-#include "value.h" /* For default_coerce_float_to_double which is referenced by a macro. */
#include "inferior.h" /* For unsigned_address_to_pointer(). */
#endif
#endif
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (COERCE_FLOAT_TO_DOUBLE)
-#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (default_coerce_float_to_double (formal, actual))
-#endif
-
-typedef int (gdbarch_coerce_float_to_double_ftype) (struct type *formal, struct type *actual);
-extern int gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual);
-extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch_coerce_float_to_double_ftype *coerce_float_to_double);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COERCE_FLOAT_TO_DOUBLE)
-#error "Non multi-arch definition of COERCE_FLOAT_TO_DOUBLE"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COERCE_FLOAT_TO_DOUBLE)
-#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (gdbarch_coerce_float_to_double (current_gdbarch, formal, actual))
-#endif
-#endif
-
#if defined (GET_SAVED_REGISTER)
/* Legacy for systems yet to multi-arch GET_SAVED_REGISTER */
#if !defined (GET_SAVED_REGISTER_P)
#!/bin/sh -u
# Architecture commands for GDB, the GNU debugger.
-# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GDB.
#
#
v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::
-f:2:COERCE_FLOAT_TO_DOUBLE:int:coerce_float_to_double:struct type *formal, struct type *actual:formal, actual:::default_coerce_float_to_double::0
F:2:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval
#
f:2:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not::0
/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
#include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
#if !GDB_MULTI_ARCH
/* Pull in function declarations refered to, indirectly, via macros. */
-#include "value.h" /* For default_coerce_float_to_double which is referenced by a macro. */
#include "inferior.h" /* For unsigned_address_to_pointer(). */
#endif
/* Target-machine dependent code for Hitachi H8/300, for GDB.
Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
set_gdbarch_frameless_function_invocation (gdbarch,
frameless_look_for_prologue);
- /* W/o prototype, coerce float args to double. */
- /* set_gdbarch_coerce_float_to_double (gdbarch, standard_coerce_float_to_double); */
-
/*
* Call Dummies
*
/* Target-dependent code for the HP PA architecture, for GDB.
Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
CORE_ADDR hppa_target_read_pc (ptid_t ptid);
void hppa_target_write_pc (CORE_ADDR v, ptid_t ptid);
CORE_ADDR hppa_target_read_fp (void);
-int hppa_coerce_float_to_double (struct type *formal, struct type *actual);
typedef struct
{
return (addr &= ~0x3);
}
-int
-hppa_coerce_float_to_double (struct type *formal, struct type *actual)
-{
- /* FIXME: For the pa, it appears that the debug info marks the
- parameters as floats regardless of whether the function is
- prototyped, but the actual values are passed as doubles for the
- non-prototyped case and floats for the prototyped case. Thus we
- choose to make the non-prototyped case work for C and break the
- prototyped case, since the non-prototyped case is probably much
- more common. */
- return (current_language -> la_language == language_c);
-}
-
static struct gdbarch *
hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
set_gdbarch_read_pc (gdbarch, hppa_target_read_pc);
set_gdbarch_write_pc (gdbarch, hppa_target_write_pc);
set_gdbarch_read_fp (gdbarch, hppa_target_read_fp);
- set_gdbarch_coerce_float_to_double (gdbarch, hppa_coerce_float_to_double);
return gdbarch;
}
/* Read hp debug symbols and convert to internal format, for GDB.
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
SYMBOL_CLASS (sym) = LOC_BLOCK;
SYMBOL_TYPE (sym) = hpread_read_function_type (hp_type, dn_bufp, objfile, 1);
+ /* All functions in C++ have prototypes. For C we don't have enough
+ information in the debug info. */
+ if (SYMBOL_LANGUAGE (s) == language_cplus)
+ TYPE_FLAGS (SYMBOL_TYPE (s)) |= TYPE_FLAG_PROTOTYPED;
+
/* The "SYMBOL_NAME" field is expected to be the mangled name
* (if any), which we get from the "alias" field of the SOM record
* if that exists.
/* Target-dependent code for Solaris x86.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
tdep->sigcontext_addr = i386bsd_sigcontext_addr;
tdep->sc_pc_offset = 36 + 14 * 4;
tdep->sc_sp_offset = 36 + 17 * 4;
-
- /* Assume that the prototype flag can be trusted. */
- set_gdbarch_coerce_float_to_double (gdbarch,
- standard_coerce_float_to_double);
}
\f
/* Read a symbol table in ECOFF format (Third-Eye).
Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Original version contributed by Alessandro Forin (af@cs.cmu.edu) at
CMU. Major work by Per Bothner, John Gilmore and Ian Lance Taylor
/* Make a type for the procedure itself */
SYMBOL_TYPE (s) = lookup_function_type (t);
+ /* All functions in C++ have prototypes. For C we don't have enough
+ information in the debug info. */
+ if (SYMBOL_LANGUAGE (s) == language_cplus)
+ TYPE_FLAGS (SYMBOL_TYPE (s)) |= TYPE_FLAG_PROTOTYPED;
+
/* Create and enter a new lexical context */
b = new_block (top_stack->maxsyms);
SYMBOL_BLOCK_VALUE (s) = b;
/* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
}
-/* If the current gcc for this target does not produce correct debugging
- information for float parameters, both prototyped and unprototyped, then
- define this macro. This forces gdb to always assume that floats are
- passed as doubles and then converted in the callee.
-
- For the mips chip, it appears that the debug info marks the parameters as
- floats regardless of whether the function is prototyped, but the actual
- values are passed as doubles for the non-prototyped case and floats for
- the prototyped case. Thus we choose to make the non-prototyped case work
- for C and break the prototyped case, since the non-prototyped case is
- probably much more common. (FIXME). */
-
-static int
-mips_coerce_float_to_double (struct type *formal, struct type *actual)
-{
- return current_language->la_language == language_c;
-}
-
/* When debugging a 64 MIPS target running a 32 bit ABI, the size of
the register stored on the stack (32) is different to its real raw
size (64). The below ensures that registers are fetched from the
set_gdbarch_register_convert_to_raw (gdbarch,
mips_register_convert_to_raw);
- set_gdbarch_coerce_float_to_double (gdbarch, mips_coerce_float_to_double);
-
set_gdbarch_frame_chain (gdbarch, mips_frame_chain);
set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_frameless_function_invocation (gdbarch,
/* Target-dependent code for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002
+ 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
}
}
-/* For the PowerPC, it appears that the debug info marks float parameters as
- floats regardless of whether the function is prototyped, but the actual
- values are always passed in as doubles. Tell gdb to always assume that
- floats are passed as doubles and then converted in the callee. */
-
-static int
-rs6000_coerce_float_to_double (struct type *formal, struct type *actual)
-{
- return 1;
-}
-
/* Return whether register N requires conversion when moving from raw format
to virtual format.
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_push_return_address (gdbarch, ppc_push_return_address);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
- set_gdbarch_coerce_float_to_double (gdbarch, rs6000_coerce_float_to_double);
set_gdbarch_register_convertible (gdbarch, rs6000_register_convertible);
set_gdbarch_register_convert_to_virtual (gdbarch, rs6000_register_convert_to_virtual);
/* Target-dependent code for GDB, the GNU debugger.
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
for IBM Deutschland Entwicklung GmbH, IBM Corporation.
set_gdbarch_sizeof_call_dummy_words (gdbarch,
sizeof (s390_call_dummy_words));
set_gdbarch_call_dummy_words (gdbarch, s390_call_dummy_words);
- set_gdbarch_coerce_float_to_double (gdbarch,
- standard_coerce_float_to_double);
switch (info.bfd_arch_info->mach)
{
/* Target-dependent code for Hitachi Super-H, for GDB.
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
}
#endif
-static int
-sh_coerce_float_to_double (struct type *formal, struct type *actual)
-{
- return 1;
-}
-
/* Find a function's return value in the appropriate registers (in
regbuf), and copy it into valbuf. Extract from an array REGBUF
containing the (raw) register state a function return value of type
set_gdbarch_call_dummy_p (gdbarch, 1);
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
- set_gdbarch_coerce_float_to_double (gdbarch,
- sh_coerce_float_to_double);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
set_gdbarch_push_return_address (gdbarch, sh_push_return_address);
/* Target-dependent code for the SPARC for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
Inc.
This file is part of GDB.
sparc_fix_call_dummy (dummy, pc, fun, type, gcc_p);
}
-/* Coerce float to double: a no-op. */
-
-static int
-sparc_coerce_float_to_double (struct type *formal, struct type *actual)
-{
- return 1;
-}
-
/* CALL_DUMMY_ADDRESS: fetch the breakpoint address for a call dummy. */
static CORE_ADDR
/* First set settings that are common for all sparc architectures. */
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_breakpoint_from_pc (gdbarch, memory_breakpoint_from_pc);
- set_gdbarch_coerce_float_to_double (gdbarch,
- sparc_coerce_float_to_double);
set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
set_gdbarch_call_dummy_p (gdbarch, 1);
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 1);
/* Support routines for decoding "stabs" debugging information format.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_FUNC)
SYMBOL_TYPE (sym) = lookup_function_type (SYMBOL_TYPE (sym));
- /* All functions in C++ have prototypes. */
- if (SYMBOL_LANGUAGE (sym) == language_cplus)
- TYPE_FLAGS (SYMBOL_TYPE (sym)) |= TYPE_FLAG_PROTOTYPED;
+ /* All functions in C++ have prototypes. Stabs does not offer an
+ explicit way to identify prototyped or unprototyped functions,
+ but both GCC and Sun CC emit stabs for the "call-as" type rather
+ than the "declared-as" type for unprototyped functions, so
+ we treat all functions as if they were prototyped. This is used
+ primarily for promotion when calling the function from GDB. */
+ TYPE_FLAGS (SYMBOL_TYPE (sym)) |= TYPE_FLAG_PROTOTYPED;
/* fall into process_prototype_types */
+2003-01-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/callfuncs.exp: Don't XFAIL unprototyped functions for
+ stabs.
+ * gdb.base/completion.exp: Allow marker1(void) as well as marker1().
+ * gdb.base/whatis.exp: Always allow (void) after function names.
+
2003-01-04 Daniel Jacobowitz <drow@mvista.com>
* gdb.c++/casts.exp: Correct regexp.
-# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
gdb_test "p t_float_values(float_val1,-2.3765)" " = 1"
# Test passing of arguments which might not be widened.
- # Under stabs, GCC doesn't tell us whether the function was
- # prototyped or not.
- if {$gcc_compiled} { setup_xfail_format "stabs" }
gdb_test "p t_float_values2(0.0,0.0)" " = 0"
# Although PR 5318 mentions SunOS specifically, this seems
}
}
- # Under stabs, GCC doesn't tell us whether the function was
- # prototyped or not.
- if {$gcc_compiled} { setup_xfail_format "stabs" }
gdb_test "p t_float_values2(3.14159,float_val2)" " = 1"
gdb_test "p t_small_values(1,2,3,4,5,6,7,8,9,10)" " = 55"
-# Copyright 1998, 1999, 2002 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-re "marker1.*$gdb_prompt info func marker$"\
{ send_gdb "\n"
gdb_expect {
- -re "All functions matching regular expression \"marker\":.*File.*break.c:\r\nint marker1\\(\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);.*$gdb_prompt $"\
+ -re "All functions matching regular expression \"marker\":.*File.*break.c:\r\nint marker1\\((void|)\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);.*$gdb_prompt $"\
{ pass "complete 'info func mar'"}
-re ".*$gdb_prompt $" { fail "complete 'info func mar'"}
timeout {fail "(timeout) complete 'info func mar'"}
-# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999, 2002
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
"whatis unnamed union"
-if { [istarget "hppa*-hp-hpux*"] && $hp_aCC_compiler } {
- # HP-UX: HP aCC compiler w/ +objdebug option detects language as
- # c++, so we need the 'void' pattern here.
- # Without +objdebug compilation option we still need to match ''.
- # - guo
- set void "(void|)"
-} else {
- set void ""
-}
+# HP-UX: HP aCC compiler w/ +objdebug option detects language as
+# c++, so we need the 'void' pattern here.
+# Without +objdebug compilation option we still need to match ''.
+# - guo
+# Also, using stabs we will mark these functions as prototyped. This
+# is harmless but causes an extra VOID to be printed.
+set void "(void|)"
# test whatis command with functions return type
gdb_test "whatis v_char_func" \
/* Target-dependent code for the NEC V850 for GDB, the GNU debugger.
- Copyright 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of GDB.
set_gdbarch_frame_args_skip (gdbarch, 0);
/* OK to default this value to 'unknown'. */
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
- /* W/o prototype, coerce float args to double. */
- set_gdbarch_coerce_float_to_double (gdbarch, standard_coerce_float_to_double);
/*
* Call Dummies
/* Perform non-arithmetic operations on values, for GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
The default is to stop in the frame where the signal was received. */
int unwind_on_signal_p = 0;
-\f
+/* How you should pass arguments to a function depends on whether it
+ was defined in K&R style or prototype style. If you define a
+ function using the K&R syntax that takes a `float' argument, then
+ callers must pass that argument as a `double'. If you define the
+ function using the prototype syntax, then you must pass the
+ argument as a `float', with no promotion.
+
+ Unfortunately, on certain older platforms, the debug info doesn't
+ indicate reliably how each function was defined. A function type's
+ TYPE_FLAG_PROTOTYPED flag may be clear, even if the function was
+ defined in prototype style. When calling a function whose
+ TYPE_FLAG_PROTOTYPED flag is clear, GDB consults this flag to decide
+ what to do.
+
+ For modern targets, it is proper to assume that, if the prototype
+ flag is clear, that can be trusted: `float' arguments should be
+ promoted to `double'. For some older targets, if the prototype
+ flag is clear, that doesn't tell us anything. The default is to
+ trust the debug information; the user can override this behavior
+ with "set coerce-float-to-double 0". */
+
+static int coerce_float_to_double;
+\f
/* Find the address of function name NAME in the inferior. */
return sp;
}
-
-/* Functions to use for the COERCE_FLOAT_TO_DOUBLE gdbarch method.
-
- How you should pass arguments to a function depends on whether it
- was defined in K&R style or prototype style. If you define a
- function using the K&R syntax that takes a `float' argument, then
- callers must pass that argument as a `double'. If you define the
- function using the prototype syntax, then you must pass the
- argument as a `float', with no promotion.
-
- Unfortunately, on certain older platforms, the debug info doesn't
- indicate reliably how each function was defined. A function type's
- TYPE_FLAG_PROTOTYPED flag may be clear, even if the function was
- defined in prototype style. When calling a function whose
- TYPE_FLAG_PROTOTYPED flag is clear, GDB consults the
- COERCE_FLOAT_TO_DOUBLE gdbarch method to decide what to do.
-
- For modern targets, it is proper to assume that, if the prototype
- flag is clear, that can be trusted: `float' arguments should be
- promoted to `double'. You should register the function
- `standard_coerce_float_to_double' to get this behavior.
-
- For some older targets, if the prototype flag is clear, that
- doesn't tell us anything. So we guess that, if we don't have a
- type for the formal parameter (i.e., the first argument to
- COERCE_FLOAT_TO_DOUBLE is null), then we should promote it;
- otherwise, we should leave it alone. The function
- `default_coerce_float_to_double' provides this behavior; it is the
- default value, for compatibility with older configurations. */
-int
-default_coerce_float_to_double (struct type *formal, struct type *actual)
-{
- return formal == NULL;
-}
-
-
-int
-standard_coerce_float_to_double (struct type *formal, struct type *actual)
-{
- return 1;
-}
-
-
/* Perform the standard coercions that are specified
for arguments to be passed to C functions.
type = builtin_type_int;
break;
case TYPE_CODE_FLT:
- /* FIXME: We should always convert floats to doubles in the
- non-prototyped case. As many debugging formats include
- no information about prototyping, we have to live with
- COERCE_FLOAT_TO_DOUBLE for now. */
- if (!is_prototyped && COERCE_FLOAT_TO_DOUBLE (param_type, arg_type))
+ if (!is_prototyped && coerce_float_to_double)
{
if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_double))
type = builtin_type_double;
unwinds the stack and restore the context to what as it was before the call.\n\
The default is to stop in the frame where the signal was received.", &setlist),
&showlist);
+
+ add_show_from_set
+ (add_set_cmd ("coerce-float-to-double", class_obscure, var_boolean,
+ (char *) &coerce_float_to_double,
+ "Set coercion of floats to doubles when calling functions\n"
+ "Variables of type float should generally be converted to doubles before\n"
+ "calling an unprototyped function, and left alone when calling a prototyped\n"
+ "function. However, some older debug info formats do not provide enough\n"
+ "information to determine that a function is prototyped. If this flag is\n"
+ "set, GDB will perform the conversion for a function it considers\n"
+ "unprototyped.\n"
+ "The default is to perform the conversion.\n",
+ &setlist),
+ &showlist);
+ coerce_float_to_double = 1;
}
/* Definitions for values of C expressions, for GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GDB.
extern struct value *call_function_by_hand (struct value *, int,
struct value **);
-extern int default_coerce_float_to_double (struct type *, struct type *);
-
-extern int standard_coerce_float_to_double (struct type *, struct type *);
-
extern struct value *value_literal_complex (struct value *, struct value *,
struct type *);
/* Target-dependent code for the Sanyo Xstormy16a (LC590000) processor.
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
/* OK to default this value to 'unknown'. */
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
- /* W/o prototype, coerce float args to double. */
- set_gdbarch_coerce_float_to_double (gdbarch,
- standard_coerce_float_to_double);
-
/*
* Call Dummies
*