+2000-03-10 Daniel Berlin <dan@cgsoftware.com>
+ Fix C++ overloading, add support for seeing through references.
+
+ * defs.h (STREQ_IW): add STREQ_IW, like STREQ, except it's
+ whitespace insensitive
+
+ * valops.c (find_overload_match): Handle STABS overloading for
+ C++.
+ (find_overload_match): Look in right place for function arguments
+ in the debug info.
+ (find_overload_match): Rather than giving up when we have >1
+ perfect match, just choose one, especially since the
+ recommendation GDB gives ("disambiguate it by specifying function
+ signature"), is basically impossible.
+ (check_field_in): STREQ->STREQ_IW
+ (search_struct_field): STREQ->STREQ_IW
+ (find_method_list): STREQ->STREQ_IW
+
+ * gdbtypes.c (rank_one_type): Add ability to see through
+ references.
+ (rank_one_type): strcmp->strcmp_iw, because the whitespace could
+ be different.
+ (rank_function): Rank function properly (was doing it wrong
+ before, comparing the wrong parts of the arrays)
+ (rank_one_type): Change #if 0 to #ifdef DEBUG_OLOAD.
+
+ * gdbtypes.h: Add REFERENCE_CONVERSION_BADNESS for "badness"
+ associated with converting a non-reference to a reference.
+
+
Fri Mar 10 11:44:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS: Devolve responsibility for domain maintenance.
Thu Mar 9 14:21:07 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS (Core): Anthony Green is the Java - including
- testsuite - maintainer. Reformat testsuite and language support
- sections
+ testsuite - maintainer. Reformat testsuite and language support
+ sections
2000-03-08 Mark Kettenis <kettenis@gnu.org>
2000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
- From Eli Zaretskii <eliz@is.elta.co.il>:
+ From Eli Zaretskii <eliz@is.elta.co.il>:
* event-loop.c (poll_timers): Don't compare delta.tv_sec with
zero, since time_t might be unsigned.
(i386_linux_sigcontext_addr): New function. Recognize the names
of the signal tranmpolines used by recent versions of the GNU C
library, and add support for RT signals.
- (LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_SP_OFFSET): New
+ (LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_SP_OFFSET): New
defines. Moved here from config/i386/tm-linux.h.
(i386_linux_sigtramp_saved_pc, i386_linux_sigtramp_saved_sp):
Reimplement in terms of i386_linux_sigcontext_addr.
* config/i386/tm-linux.h (LINUX_SIGCONTEXT_SIZE): Removed.
- (LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_SP_OFFSET):
- Moved to i386-tdep.c.
+ (LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_SP_OFFSET):
+ Moved to i386-tdep.c.
(IN_SIGTRAMP): Redefine to call i386_linux_in_sigtramp.
Sat Mar 4 19:38:11 2000 Andrew Cagney <cagney@b1.cygnus.com>
Sat Mar 4 17:23:06 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS: Frank Ch. Eigler and Andrew Cagney co-ordinate the
- sim directory.
+ sim directory.
Sat Mar 4 16:19:31 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS: Add Michael Snyder and Peter Schauer to list of
- ``Blanket Write Privs'' maintainers.
+ ``Blanket Write Privs'' maintainers.
Sat Mar 4 15:58:40 2000 Andrew Cagney <cagney@b1.cygnus.com>
From Sun 20 Feb 2000 Robert Lipe <robertl@sco.com>:
* language.c (longest_local_hex_string_custom): Don't compile
- 'long long' section if host doesn't have 'long long'.
+ 'long long' section if host doesn't have 'long long'.
Sat Mar 4 15:45:38 2000 Andrew Cagney <cagney@b1.cygnus.com>
* language.c (longest_raw_hex_string): Comment out. Appears
- unused.
+ unused.
Sat Mar 4 13:02:09 2000 Andrew Cagney <cagney@b1.cygnus.com>
* utils.c (mcalloc), defs.h (mcalloc): Keep consistent with
- "mmalloc.h" which means using PTRs.
+ "mmalloc.h" which means using PTRs.
(init_malloc, msavestring, mstrsave): Convert to PTR free ISO-C.
Sat Mar 4 11:49:21 2000 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h (store_address, store_unsigned_integer, store_address):
- Replace PTR with void* in delcaration.
+ Replace PTR with void* in delcaration.
* findvar.c (extract_signed_integer, extract_unsigned_integer,
- extract_long_unsigned_integer, extract_address,
- store_signed_integer, store_unsigned_integer, store_address):
- Convert definition to ISO-C. Replace PTR with void*.
+ extract_long_unsigned_integer, extract_address,
+ store_signed_integer, store_unsigned_integer, store_address):
+ Convert definition to ISO-C. Replace PTR with void*.
Sat Mar 4 10:57:25 2000 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h (make_cleanup_func): Document as deprecated.
(make_cleanup_ftype): New typedef. Make signature consistent with
- other function typedefs. Document as not be used out side of
- make_cleanup code. Use in make_cleanup declarations.
+ other function typedefs. Document as not be used out side of
+ make_cleanup code. Use in make_cleanup declarations.
(null_cleanup): Replace PTR with void*.
-
+
* utils.c (make_cleanup, make_final_cleanup, make_run_cleanup,
- make_exec_cleanup, make_exec_error_cleanup, make_my_cleanup,
- null_cleanup): Change K&R definition to ISO-C using void* and
- make_cleanup_fytpe.
+ make_exec_cleanup, make_exec_error_cleanup, make_my_cleanup,
+ null_cleanup): Change K&R definition to ISO-C using void* and
+ make_cleanup_fytpe.
(discard_my_cleanups): Don't cast argument to free.
2000-03-03 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* defs.h (struct continuation_arg): Change type of field 'data'
- from PTR to void *.
+ from PTR to void *.
* event-loop.h: Eliminate uses of PTR, use 'void *' instead.
Fri Mar 3 15:39:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (CONFIG_CLEAN, CONFIG_ALL, LN_S): Defined by
- configure.
+ configure.
(SUBDIR_MI_CLEAN, SUBDIR_GDBTK_CLEAN, SUBDIR_MI_ALL,
- SUBDIR_GDBTK_ALL): Define.
+ SUBDIR_GDBTK_ALL): Define.
(all-gdbtk, clean-gdbtk): New targets.
(all): Add CONFIG_ALL as dependency.
(clean): Add CONFIG_CLEAN as dependency.
-
+
* configure.in (CONFIG_ALL, CONFIG_CLEAN): Define.
(LN_S): Define. Delete GDBtk's link code.
2000-03-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* config/alpha/alpha-linux.mh: Remove core-regset.o fron the
- NATDEPFILES list.
+ NATDEPFILES list.
2000-03-02 Mark Kettenis <kettenis@gnu.org>
Thu Mar 2 09:04:46 2000 Andrew Cagney <cagney@b1.cygnus.com>
- * MAINTAINERS: Daniel Berlin is C++ maintainer.
+ * MAINTAINERS: Daniel Berlin is C++ maintainer.
Thu Mar 2 08:55:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS: Mark Kettenis is the x86 architcture maintainer and
- a joint GNU/Linux/x86 maintainer. Nick Duffeck and Robert Lipe
- share SCO/Unixware. Nick Duffek and Peter Schauer share
- Solaris/x86.
+ a joint GNU/Linux/x86 maintainer. Nick Duffeck and Robert Lipe
+ share SCO/Unixware. Nick Duffek and Peter Schauer share
+ Solaris/x86.
Wed Mar 1 22:12:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
-
+
From Wed 23 Feb 2000 Fernando Nasser <fnasser@redhat.com>:
* remote-sim.c (gdbsim_close): Call generic_mourn_inferior.
- * remote-rdi.c (arm_rdi_close): Ditto.
+ * remote-rdi.c (arm_rdi_close): Ditto.
Wed Mar 1 19:31:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
* CONTRIBUTE (configure.in): Note that patches to configure are
- not needed.
+ not needed.
2000-03-01 Mark Kettenis <kettenis@gnu.org>
From 2000-02-28 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
Make NEW_PROC_ABI interface functional on Solaris x86.
* sol-thread.c (ps_lgetLDT): Rewrite to use new
- procfs_find_LDT_entry function from procfs.c, mostly copied from
- lin-thread.c.
+ procfs_find_LDT_entry function from procfs.c, mostly copied from
+ lin-thread.c.
* inferior.h, procfs.c (procfs_get_pid_fd): Removed, no longer
- needed.
+ needed.
Wed Mar 1 00:34:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
Wed Mar 1 00:06:19 2000 Andrew Cagney <cagney@b1.cygnus.com>
From 1999-08-13 J.T. Conklin <jtc@redback.com>:
- * config/i386/tm-i386.h (FRAME_INIT_SAVED_REGS): Replace
- FRAME_FIND_SAVED_REGS.
- (i386_frame_init_saved_regs): Replace i386_frame_find_saved_regs.
- * i386-tdep.c (i386_frame_init_saved_regs, i386_pop_frame):
- Update.
+ * config/i386/tm-i386.h (FRAME_INIT_SAVED_REGS): Replace
+ FRAME_FIND_SAVED_REGS.
+ (i386_frame_init_saved_regs): Replace i386_frame_find_saved_regs.
+ * i386-tdep.c (i386_frame_init_saved_regs, i386_pop_frame):
+ Update.
Tue Feb 29 23:56:41 2000 Andrew Cagney <cagney@b1.cygnus.com>
to the list of targets which return FP values in FP registers.
* i386-tdep.c (i386_extract_return_value): Add FIXME recommending
- that this function be re-implemented using multi-arch.
+ that this function be re-implemented using multi-arch.
Tue Feb 29 18:40:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
From Wed, 23 Feb 2000 Fernando Nasser <fnasser@redhat.com>:
* stack.c (backtrace_command_1), infrun.c (normal_stop): Check
- that the target's stack was valid.
+ that the target's stack was valid.
Tue Feb 29 15:14:56 2000 Andrew Cagney <cagney@b1.cygnus.com>
From 2000-02-22 Stephane Carrez <stcarrez@worldnet.fr>:
- * dwarf2read.c (read_address): Read 16-bits addresses.
+ * dwarf2read.c (read_address): Read 16-bits addresses.
2000-02-28 Scott Bambrough <scottb@netwinder.org>
* arm-linux-nat.c (fetch_nw_fpe_*):
- Renamed to fetch_nwfpe_* to use the same naming convention
+ Renamed to fetch_nwfpe_* to use the same naming convention
as in the Linux kernel. Modified prototype to get rid of
unused parameters.
(store_nw_fpe_*): Renamed to store_nwfpe_* to use the same
- naming convention as in the Linux kernel. Fixed calls to
+ naming convention as in the Linux kernel. Fixed calls to
fetch_nwfpe_*.
(store_fpregs): Fixed calls to store_nwfpe_*. Removed
- unused variable.
+ unused variable.
Mon Feb 28 18:24:32 2000 Andrew Cagney <cagney@b1.cygnus.com>
Mon Feb 28 10:58:45 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS: Mention mmalloc. Expand Host/Native and
- Target/Architecture maintainers descriptions.
+ Target/Architecture maintainers descriptions.
2000-02-26 Mark Kettenis <kettenis@gnu.org>
Sat Feb 26 17:15:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS: Chris Faylor is responsible for all MS Windows
- systems. Note that Jim Blandy as maintainer for ``tracing
- bytecode stuff''
+ systems. Note that Jim Blandy as maintainer for ``tracing
+ bytecode stuff''
2000-02-25 Fernando Nasser <fnasser@cygnus.com>
Thu Feb 24 18:42:15 2000 Andrew Cagney <cagney@b1.cygnus.com>
* configure.in (CONFIG_INSTALL, CONFIG_UNINSTALL): Set to
- $(SUBDIR_*_INSTALL) when so configured.
+ $(SUBDIR_*_INSTALL) when so configured.
* configure: Regenerate.
-
+
* Makefile.in (CONFIG_INSTALL, CONFIG_UNINSTALL): Define using
- configure.
+ configure.
(install-only): Add dependency on $(CONFIG_INSTALL). Delete code
- installing GDBtk.
+ installing GDBtk.
(uninstall): Add dependency on $(CONFIG_UNINSTALL).
(SUBDIR_MI_INSTALL, SUBDIR_MI_UNINSTALL, SUBDIR_GDBTK_UNINSTALL,
- SUBDIR_GDBTK_INSTALL): Define.
+ SUBDIR_GDBTK_INSTALL): Define.
(install-gdbtk): New target.
Thu Feb 24 18:19:52 2000 Andrew Cagney <cagney@b1.cygnus.com>
* configure.in (SUBDIR_MI_CFLAGS): Fix typo, wrong brace.
* configure: Regenerate.
-
+
2000-02-24 Christopher Faylor <cgf@cygnus.com>
* configure.tgt: Add arm, mips, sh wince targets.
Wed Feb 23 12:58:46 2000 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.sh (dis_asm_read_memory): Change LEN to unsigned long.
- Match ../include/dis-asm.h change.
+ Match ../include/dis-asm.h change.
* gdbarch.h: Regenerate.
* corefile.c (dis_asm_read_memory): Update.
* configure.in (CONFIG_INITS): Fix typo, was CONFIG_INIT.
(ENABLE_CFLAGS): Move initialization to start of file.
(enable-gdbmi): Add new configure option --enable-gdbmi. When
- selected and an ${srcdir}/mi directory is present enable MI
- interface.
+ selected and an ${srcdir}/mi directory is present enable MI
+ interface.
* configure: Regenerate.
-
+
* Makefile.in (SUBDIR_MI_OBS, SUBDIR_MI_SRCS, SUBDIR_MI_DEPS,
- SUBDIR_MI_INITS, SUBDIR_MI_LDFLAGS, SUBDIR_MI_CFLAGS): New macros.
+ SUBDIR_MI_INITS, SUBDIR_MI_LDFLAGS, SUBDIR_MI_CFLAGS): New macros.
(CONFIG_OBS, CONFIG_SRCS, CONFIG_DEPS, CONFIG_INITS,
- CONFIG_LDFLAGS): New macros. Initialized by autoconf via
- @CONFIG...@.
+ CONFIG_LDFLAGS): New macros. Initialized by autoconf via
+ @CONFIG...@.
(INTERNAL_LDFLAGS, CDEPS, LINTFILES, DEPFILES, SOURCES,
- INIT_FILES): Use $(CONFIG_...) instead of @CONFIG...@.
+ INIT_FILES): Use $(CONFIG_...) instead of @CONFIG...@.
* mi: New directory. MI interface to GDB.
* defs.h (interpreter_p): Declare when UI_OUT.
* top.c (gdb_init): When interpreter_p, check that the interpreter
- was recognized by one of the linked in interpreters.
+ was recognized by one of the linked in interpreters.
* main.c (interpreter_p): Define.
(captured_main): When UI_OUT, check for ``-i <interpreter>'' option.
* event-top.c (display_gdb_prompt): When interpreter_p, assume
- interpreter displays prompt.
+ interpreter displays prompt.
* breakpoint.c (print_it_typical, watchpoint_check,
- print_one_breakpoint, mention): When MI include additional
+ print_one_breakpoint, mention): When MI include additional
target status information.
* infrun.c (print_stop_reason, normal_stop): Ditto.
2000-02-22 Jim Blandy <jimb@redhat.com>
* gdbarch.sh: Make the `default' field really default to zero, as
- documented.
+ documented.
Bring COERCE_FLOAT_TO_DOUBLE under gdbarch's control.
* valops.c (COERCE_FLOAT_TO_DOUBLE): Rework definition to be
* gdbarch.sh (coerce_float_to_double): New entry, replacing macro.
* gdbarch.c, gdbarch.h: Regenerated.
* tm-alpha.h, tm-fr30.h, tm-m32r.h, tm-mips.h, tm-hppa.h,
- tm-rs6000.h, tm-sh.h, tm-sparc.h (COERCE_FLOAT_TO_DOUBLE): Change
- definitions.
+ tm-rs6000.h, tm-sh.h, tm-sparc.h (COERCE_FLOAT_TO_DOUBLE): Change
+ definitions.
* mips-tdep.c (mips_coerce_float_to_double): Supply our own custom
function here.
(mips_gdbarch_init): Install that as our coerce_float_to_double
From Philippe De Muyter <phdm@macqel.be>
* event-loop.c (handle_file_event): In case of poll, enable
- printing of informational message if an error/exception is
- detected on the file descriptor.
+ printing of informational message if an error/exception is
+ detected on the file descriptor.
2000-02-21 Jim Kingdon <kingdon@redhat.com>
Mon Feb 21 12:50:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
* buildsym.c: Include "language.h" and "expression.h" for
- longest_local_hex_string_custom.
+ longest_local_hex_string_custom.
Mon Feb 21 11:17:18 2000 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.sh: Include <gdb_wait.h> instead of <wait.h>.
* gdbarch.c: Already updated by Wed Feb 9 18:59:16 2000 Andrew
- Cagney <cagney@b1.cygnus.com>.
+ Cagney <cagney@b1.cygnus.com>.
Mon Feb 21 11:03:01 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS: Update: IA-64 - Kevin Buettner; ARM - Fernando
- nasser, Jim Ingham and Scott Bambrough; GNU/Linux ARM - Scott
- Bambrough; event loop - Elena Zannoni; SDS and RDI/APD protocol -
- to Fernando Nasser and Jim Ingham; KOD - Fernando Nasser; MI -
- Andrew Cagney, Elena Zannoni and Fernando Nasser; Web pages - Jim
- Kingdon.
+ nasser, Jim Ingham and Scott Bambrough; GNU/Linux ARM - Scott
+ Bambrough; event loop - Elena Zannoni; SDS and RDI/APD protocol -
+ to Fernando Nasser and Jim Ingham; KOD - Fernando Nasser; MI -
+ Andrew Cagney, Elena Zannoni and Fernando Nasser; Web pages - Jim
+ Kingdon.
* MAINTAINERS: Add Nick Clifton to write after approval list.
-
+
Mon Feb 21 10:30:39 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS: Add note on multiple maintainers.
2000-02-19 Philippe De Muyter <phdm@macqel.be>
- * cli-out.c (cli_table_header): Type of parameter `alignment' is
- `enum ui_align', not `int'.
- (cli_field_string, cli_field_skip): Likewise.
+ * cli-out.c (cli_table_header): Type of parameter `alignment' is
+ `enum ui_align', not `int'.
+ (cli_field_string, cli_field_skip): Likewise.
2000-02-18 Jim Blandy <jimb@redhat.com>
2000-02-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* remote.c (remote_async_detach): Use target_mourn_inferior(), to
- make sure that all is cleaned up after we disconnect from the
- target.
+ make sure that all is cleaned up after we disconnect from the
+ target.
(remote_detach): Ditto.
2000-02-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
Wed Feb 16 19:00:02 2000 Andrew Cagney <cagney@b1.cygnus.com>
From 2000-01-26 Rodney Brown <RodneyBrown@pmsc.com>:
- * procfs.c: Define MERGEPID if not defined. For osf4.0e.
+ * procfs.c: Define MERGEPID if not defined. For osf4.0e.
2000-02-15 Jason Molenda (jsm@bugshack.cygnus.com)
to correct value for generic dummy frames. When using
generic dummy frames, don't attempt to write TOC value or
function to call into the call dummy.
- (rs6000_push_arguments): Adapt USE_GENERIC_DUMMY_FRAMES
+ (rs6000_push_arguments): Adapt USE_GENERIC_DUMMY_FRAMES
code to also handle the PowerOpen ABI.
(ppc_push_return_address): Enable for all ports.
* config/powerpc/tm-ppc-aix.h (USE_GENERIC_DUMMY_FRAMES,
- PUSH_DUMMY_FRAME, PUSH_RETURN_ADDRESS, GET_SAVED_REGISTER,
+ PUSH_DUMMY_FRAME, PUSH_RETURN_ADDRESS, GET_SAVED_REGISTER,
CALL_DUMMY_BREAKPOINT_OFFSET, CALL_DUMMY_LOCATION,
CALL_DUMMY_ADDRESS, CALL_DUMMY_START_OFFSET): Override defaults
provided by generic RS6000 definitions so that call dummies
2000-02-15 Jesper Skov <jskov@cygnus.co.uk>
Patch applied by Kevin Buettner <kevinb@redhat.com>
-
+
* rs6000-tdep.c (skip_prologue): skip copying of argument
registers to local variable registers.
* config/i386/nbsd.mt (GDBSERVER_DEPFILES): Add low-nbsd.o
* configure.tgt (i[3456]86-*-netbsd*): add gdbserver to
- configdirs.
+ configdirs.
* gdbserver/low-nbsd.c: New file.
-
+
* gdbserver/Makefile.in: convert to autoconf.
* gdbserver/configure.in: likewise.
* gdbserver/configure: generate.
Sun Feb 13 10:34:48 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS: Add Eli Zaretskii to djgpp maintiners. Add Kevin
- Buettner to powerpc maintainers. Make Kevin Buettner the
- GNU/LINUX PPC native maintainer. Add J.T. Conklin, Jim Kingdon
- and Jason Molenda to write after aproval list.
+ Buettner to powerpc maintainers. Make Kevin Buettner the
+ GNU/LINUX PPC native maintainer. Add J.T. Conklin, Jim Kingdon
+ and Jason Molenda to write after aproval list.
Sun Feb 13 10:18:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
2000-02-09 Mark Kettenis <kettenis@gnu.org>
- * linux-thread.c: Include defs.h before gdb_wait.h.
+ * linux-thread.c: Include defs.h before gdb_wait.h.
Wed Feb 9 18:59:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (wait_h): Delete macro. Update all dependencies
- specifying gdb_wait.h instead.
+ specifying gdb_wait.h instead.
* ser-unix.c, ser-pipe.c, remote.c, remote-udi.c, remote-sds.c,
- remote-os9k.c, remote-es.c, remote-rdp.c, remote-vx960.c,
- remote-vx.c, remote-st.c, remote-nindy.c, remote-mm.c,
- convex-xdep.c, convex-tdep.c, target.c, win32-nat.c, standalone.c,
- remote-vxmips.c, remote-vxsparc.c, remote-vx68.c, remote-vx29k.c,
- remote-sim.c, remote-rdi.c, remote-mips.c, remote-eb.c,
- remote-e7000.c, remote-bug.c, remote-array.c, remote-adapt.c,
- ppc-bdm.c, ocd.c, monitor.c, m3-nat.c, linux-thread.c,
- infttrace.c, lin-thread.c, infptrace.c, gnu-nat.c, gdbarch.c,
- fork-child.c, command.c: Include "gdb_wait.h" instead of <wait.h>
- or <sys/wait.h>.
+ remote-os9k.c, remote-es.c, remote-rdp.c, remote-vx960.c,
+ remote-vx.c, remote-st.c, remote-nindy.c, remote-mm.c,
+ convex-xdep.c, convex-tdep.c, target.c, win32-nat.c, standalone.c,
+ remote-vxmips.c, remote-vxsparc.c, remote-vx68.c, remote-vx29k.c,
+ remote-sim.c, remote-rdi.c, remote-mips.c, remote-eb.c,
+ remote-e7000.c, remote-bug.c, remote-array.c, remote-adapt.c,
+ ppc-bdm.c, ocd.c, monitor.c, m3-nat.c, linux-thread.c,
+ infttrace.c, lin-thread.c, infptrace.c, gnu-nat.c, gdbarch.c,
+ fork-child.c, command.c: Include "gdb_wait.h" instead of <wait.h>
+ or <sys/wait.h>.
* nindy-share/nindy.c, nindy-share/Onindy.c: Ditto.
* gdb_wait.h: New file. Based on ../include/wait.h. Include
- <sys/wait.h> or <wait.h> and then define any missing WIF macros.
+ <sys/wait.h> or <wait.h> and then define any missing WIF macros.
Wed Feb 9 01:14:54 2000 Andrew Cagney <cagney@amy.cygnus.com>
1999-08-23 J.T. Conklin <jtc@redback.com>
- * top.c (remote_timeout): Change default to 2. Add comment
- explaining history of changes to the default value.
- * remote.c (_initialize_remote): Remove code that adds set/
- show remotetimeout, as that's also done in top.c
+ * top.c (remote_timeout): Change default to 2. Add comment
+ explaining history of changes to the default value.
+ * remote.c (_initialize_remote): Remove code that adds set/
+ show remotetimeout, as that's also done in top.c
1999-10-18 J.T. Conklin <jtc@redback.com>
- * m32r-stub.c, sparcl-stub.c, sparclet-stub.c (handle_exception):
- Return E01 instead of P01 when 'P' command fails.
+ * m32r-stub.c, sparcl-stub.c, sparclet-stub.c (handle_exception):
+ Return E01 instead of P01 when 'P' command fails.
2000-02-05 J.T. Conklin <jtc@redback.com>
2000-02-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* infrun.c (resume): Make just one call to target_resume(), instead
- of four: set up correct parameters in all the cases ahead of time,
- and do call at the end.
+ of four: set up correct parameters in all the cases ahead of time,
+ and do call at the end.
2000-02-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* config/powerpc/tm-ppc-eabi.h: Define
- SOFUN_ADDRESS_MAYBE_MISSING.
+ SOFUN_ADDRESS_MAYBE_MISSING.
2000-02-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
(links): Link srcdir/gdbtk/library to gdbtcl2.
* gdbtcl2: Moved to gdbtk/library.
ChangeLog-gdbtk, gdbtk-cmds.c, gdbtk-hooks.c, gdbtk-variable.c,
- gdbtk-varobj.c, gdbtk-wrapper.c, gdbtk-wrapper.h, gdbtk.c,
- gdbtk.h: Moved to gdbtk/generic.
+ gdbtk-varobj.c, gdbtk-wrapper.c, gdbtk-wrapper.h, gdbtk.c,
+ gdbtk.h: Moved to gdbtk/generic.
2000-02-03 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* printcmd.c (build_address_symbolic): New function. Returns all
- the parts that are necessary to print an address in a symbolic
- form.
+ the parts that are necessary to print an address in a symbolic
+ form.
(print_address_symbolic): Split into a printing part and an
- information building part, build_address_symbolic().
+ information building part, build_address_symbolic().
* defs.h (build_address_symbolic): Export.
2000-02-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* remote.c (getpkt_sane): New function. It is the old getpkt(),
- which now returns a timeout indication.
+ which now returns a timeout indication.
(getpkt): New function. Wrapper for getpkt_sane(), so that return
- value can still be ignored.
+ value can still be ignored.
Tue Feb 1 18:47:31 2000 Andrew Cagney <cagney@b1.cygnus.com>
* top.c (print_gdb_version): Print ``UI_OUT'' when configured with
- UI_OUT.
+ UI_OUT.
Tue Feb 1 00:17:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
* ui-file.c, ui-file.h: Rename gdb-file.h, gdb-file.c. Rename
- ``struct gdb_file'' to ``struct ui_file''. Delete typedef
- GDB_FILE.
-
+ ``struct gdb_file'' to ``struct ui_file''. Delete typedef
+ GDB_FILE.
+
* Makefile.in: Update.
* ax-gdb.c, ax-general.c, ax.h, buildsym.c, c-lang.c, c-lang.h,
- c-typeprint.c, c-valprint.c, ch-lang.c, ch-lang.h, ch-typeprint.c,
- ch-valprint.c, command.c, command.h, convex-tdep.c, corefile.c,
- cp-valprint.c, d10v-tdep.c, d30v-tdep.c, defs.h, expprint.c,
- expression.h, f-lang.c, f-lang.h, f-typeprint.c, f-valprint.c,
- frame.h, gdb-events.sh, gdb-file.c, gdb-file.h, gdbcmd.h,
- gdbtypes.h, hppa-tdep.c, jv-lang.c, jv-lang.h, jv-typeprint.c,
- jv-valprint.c, language.c, language.h, m2-lang.c, m2-lang.h,
- m2-typeprint.c, m2-valprint.c, m3-nat.c, main.c, monitor.c,
- printcmd.c, pyr-tdep.c, remote-mips.c, remote-sim.c, remote-udi.c,
- remote.c, scm-lang.c, scm-lang.h, scm-valprint.c, ser-e7kpc.c,
- ser-go32.c, ser-mac.c, ser-ocd.c, ser-unix.c, ser-unix.h,
- serial.c, serial.h, stack.c, symfile.c, symmisc.c, tahoe-tdep.c,
- target.c, target.h, top.c, top.h, typeprint.c, typeprint.h,
- utils.c, v850ice.c, valprint.c, valprint.h, value.h,
- config/pa/tm-hppa.h: Update.
+ c-typeprint.c, c-valprint.c, ch-lang.c, ch-lang.h, ch-typeprint.c,
+ ch-valprint.c, command.c, command.h, convex-tdep.c, corefile.c,
+ cp-valprint.c, d10v-tdep.c, d30v-tdep.c, defs.h, expprint.c,
+ expression.h, f-lang.c, f-lang.h, f-typeprint.c, f-valprint.c,
+ frame.h, gdb-events.sh, gdb-file.c, gdb-file.h, gdbcmd.h,
+ gdbtypes.h, hppa-tdep.c, jv-lang.c, jv-lang.h, jv-typeprint.c,
+ jv-valprint.c, language.c, language.h, m2-lang.c, m2-lang.h,
+ m2-typeprint.c, m2-valprint.c, m3-nat.c, main.c, monitor.c,
+ printcmd.c, pyr-tdep.c, remote-mips.c, remote-sim.c, remote-udi.c,
+ remote.c, scm-lang.c, scm-lang.h, scm-valprint.c, ser-e7kpc.c,
+ ser-go32.c, ser-mac.c, ser-ocd.c, ser-unix.c, ser-unix.h,
+ serial.c, serial.h, stack.c, symfile.c, symmisc.c, tahoe-tdep.c,
+ target.c, target.h, top.c, top.h, typeprint.c, typeprint.h,
+ utils.c, v850ice.c, valprint.c, valprint.h, value.h,
+ config/pa/tm-hppa.h: Update.
* cli-out.c, cli-out.h, ui-out.c, ui-out.h, varobj.c: Update.
2000-01-31 Jason Molenda (jsm@bugshack.cygnus.com)
* top.c (fputs_unfiltered_hook): Moved to tui/tui-file.c.
* main.c (captured_main): Only use the legacy tui_file code when
- linking in older code such as the TUI.
+ linking in older code such as the TUI.
* gdb-file.h, gdb-file.c: New files.
* utils.c, defs.h (struct gdb_file, gdb_file_new, gdb_file_delete,
- null_file_isatty, null_file_rewind, null_file_put,
- null_file_flush, null_file_write, null_file_fputs,
- null_file_delete, gdb_file_data, gdb_flush, gdb_file_isatty,
- gdb_file_rewind, gdb_file_put, gdb_file_write, fputs_unfiltered,
- set_gdb_file_flush, set_gdb_file_isatty, set_gdb_file_rewind,
- set_gdb_file_put, set_gdb_file_write, set_gdb_file_fputs,
- set_gdb_file_data, struct accumulated_gdb_file,
- do_gdb_file_xstrdup, gdb_file_xstrdup, struct mem_file):
- mem_file_new, mem_file_delete, mem_fileopen, mem_file_rewind,
- mem_file_put, mem_file_write, struct stdio_file): stdio_file_new,
- stdio_file_delete, stdio_file_flush, stdio_file_write,
- stdio_file_fputs, stdio_file_isatty, stdio_fileopen, gdb_fopen):
- Moved to gdb-file.h and gdb-file.c.
+ null_file_isatty, null_file_rewind, null_file_put,
+ null_file_flush, null_file_write, null_file_fputs,
+ null_file_delete, gdb_file_data, gdb_flush, gdb_file_isatty,
+ gdb_file_rewind, gdb_file_put, gdb_file_write, fputs_unfiltered,
+ set_gdb_file_flush, set_gdb_file_isatty, set_gdb_file_rewind,
+ set_gdb_file_put, set_gdb_file_write, set_gdb_file_fputs,
+ set_gdb_file_data, struct accumulated_gdb_file,
+ do_gdb_file_xstrdup, gdb_file_xstrdup, struct mem_file):
+ mem_file_new, mem_file_delete, mem_fileopen, mem_file_rewind,
+ mem_file_put, mem_file_write, struct stdio_file): stdio_file_new,
+ stdio_file_delete, stdio_file_flush, stdio_file_write,
+ stdio_file_fputs, stdio_file_isatty, stdio_fileopen, gdb_fopen):
+ Moved to gdb-file.h and gdb-file.c.
* utils.c (enum streamtype, struct tui_stream, tui_file_new,
- tui_file_delete, tui_fileopen, tui_sfileopen, tui_file_isatty,
- tui_file_rewind, tui_file_put, tui_file_fputs,
- tui_file_get_strbuf, tui_file_adjust_strbuf, tui_file_flush,
+ tui_file_delete, tui_fileopen, tui_sfileopen, tui_file_isatty,
+ tui_file_rewind, tui_file_put, tui_file_fputs,
+ tui_file_get_strbuf, tui_file_adjust_strbuf, tui_file_flush,
fputs_unfiltered_hook):
- Moved to tui/tui-file.c and tui/tui-file.h.
-
+ Moved to tui/tui-file.c and tui/tui-file.h.
+
* Makefile.in (COMMON_OBS): Add gdb-file.o, tui-file.o.
(tui-file.o, gdb-file.o): Add dependencies.
(corefile.o, main.o, utils.o, simmisc.o): Update dependencies.
2000-01-27 Jim Blandy <jimb@cygnus.com>
* symtab.c (decode_line_1): Don't let commas that are within
- quotes or parenthesis terminate the line spec. Don't use pp when
- removing the final double quote of a double-quoted string. Don't
- forget to skip the opening double quote. I have no clue whether
- this change is correct; probably we've just moved this function
- from one buggy place to another buggy place, and never came within
- an outhouse whiff of correctness.
+ quotes or parenthesis terminate the line spec. Don't use pp when
+ removing the final double quote of a double-quoted string. Don't
+ forget to skip the opening double quote. I have no clue whether
+ this change is correct; probably we've just moved this function
+ from one buggy place to another buggy place, and never came within
+ an outhouse whiff of correctness.
(find_toplevel_char): New function.
2000-01-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
* arm-tdep.c (arm_push_arguments): Set the thumb mode bit when
- passing the pointer to a thumb function as an argument.
+ passing the pointer to a thumb function as an argument.
2000-01-27 Fernando Nasser <fnasser@totem.to.cygnus.com>
* proc-why.c: New file. Add include of proc-utils.h.
* procfs.c: Add includes of gdbthread.h, sys/wait.h, signal.h,
- ctype.h, proc-utils.h.
+ ctype.h, proc-utils.h.
(find_procinfo_or_die): Add braces to avoid ambiguous else clause.
(open_procinfo_files): Conditionalize local variable tmp, to avoid
- compiler warnings.
+ compiler warnings.
(proc_iterate_over_mappings): Conditionalize local vars mapfd and
- pathname.
+ pathname.
(procfs_wait): Adjust format in some printf_filetered calls to
- avoid compiler warnings.
+ avoid compiler warnings.
(make_signal_thread_runnable): Ifdef 0. The calls to this function
- are also ifdef'd 0 .
+ are also ifdef'd 0 .
(procfs_resume): Add parentheses around '&&' operation.
(procfs_set_exec_trap): Remove unused variable.
(info_proc_cmd): Add braces to avoid ambiguous else clause.
* Makefile.in (procfs.o, proc-api.o, proc-events.o, proc-flags.o,
- proc-why.o): Update dependencies.
+ proc-why.o): Update dependencies.
* config/sparc/sun4sol2.mh (NATDEPFILES): Change proc_*.o files to
proc-*.o.
2000-01-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* stack.c (print_frame_info_base): Break up into the frame info
- (location) printing part and the rest (source line printing).
+ (location) printing part and the rest (source line printing).
(print_frame): New function. Take care of printing the location
- information.
+ information.
Update copyright.
* infrun.c (normal_stop): Use enum values rather than integers for the
source_flag to be passed to show_and_print_stack_frame().
- Update copyright.
-
+ Update copyright.
+
* frame.h (print_what): New enum for 'source' argument to
- print_frame_info_base(). Use this instead of obscure numbers.
+ print_frame_info_base(). Use this instead of obscure numbers.
Update copyright.
-
+
Sun Jan 16 17:58:00 2000 David Taylor <taylor@texas.cygnus.com>
* event-top.c (stdin_event_handler): call quit_command rather than
- exit -- run cleanups, give target code a chance to say goodbye to
- the target. Fixes bug where the inferior processes were left
- around on Solaris (and probably elsewhere) by the testsuite.
+ exit -- run cleanups, give target code a chance to say goodbye to
+ the target. Fixes bug where the inferior processes were left
+ around on Solaris (and probably elsewhere) by the testsuite.
2000-01-14 Mark Salter <msalter@cygnus.com>
* v850-tdep.c (v850_target_architecture_hook): Setup correct
- machine id for disassembly.
+ machine id for disassembly.
2000-01-13 Jim Blandy <jimb@cygnus.com>
2000-01-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* thread.c (do_captured_thread_select): New function. Switch
- current thread, safely from within catch_errors().
+ current thread, safely from within catch_errors().
(gdb_thread_select): New function. Switch threads safely.
(thread_command): Use gdb_thread_select().
Include ui-out.h.
(proc_flags): combine flags that UnixWare splits into two locations.
(proc_modify_flag): add support for PR_KLC (kill on last close).
(proc_[un]set_kill_on_last_close): new functions.
-
+
2000-01-07 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* infrun.c (normal_stop): Print out thread id when we stop.
2000-01-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* breakpoint.c (until_break_command): Add an argument for the
- continuation, the beginning of the cleanups set up by this
- command.
+ continuation, the beginning of the cleanups set up by this
+ command.
(until_break_command_continuation): Do cleanups until the one
- passed in as argument instead of doing all of them.
+ passed in as argument instead of doing all of them.
* infcmd.c (finish_command_continuation): Expect a new argument,
- which indicates up to where to do cleanups. Update calls to
- do_exec_cleanups to use this marker, instead of ALL_CLEANUPS.
+ which indicates up to where to do cleanups. Update calls to
+ do_exec_cleanups to use this marker, instead of ALL_CLEANUPS.
(finish_command): Add another argument for the continuation: the
starting cleanup for this command.
#define STRCMP(a,b) (*(a) == *(b) ? strcmp ((a), (b)) : (int)*(a) - (int)*(b))
#define STREQ(a,b) (*(a) == *(b) ? !strcmp ((a), (b)) : 0)
+#define STREQ_IW(a,b) (*(a) == *(b) ? !strcmp_iw ((a), (b)) : 0)
#define STREQN(a,b,c) (*(a) == *(b) ? !strncmp ((a), (b), (c)) : 0)
/* The character GNU C++ uses to build identifiers that must be unique from
char *);
extern int build_address_symbolic (CORE_ADDR addr,
- int do_demangle,
- char **name,
- int *offset,
- char **filename,
- int *line,
+ int do_demangle,
+ char **name,
+ int *offset,
+ char **filename,
+ int *line,
int *unmapped);
extern void print_address_numeric (CORE_ADDR, int, struct ui_file *);
extern void free_command_lines (struct command_line **);
-/* To continue the execution commands when running gdb asynchronously.
- A continuation structure contains a pointer to a function to be called
+/* To continue the execution commands when running gdb asynchronously.
+ A continuation structure contains a pointer to a function to be called
to finish the command, once the target has stopped. Such mechanism is
used bt the finish and until commands, and in the remote protocol
when opening an extended-remote connection. */
extern int longest_to_int (LONGEST);
-/* Assorted functions we can declare, now that const and volatile are
+/* Assorted functions we can declare, now that const and volatile are
defined. */
extern char *savestring (const char *, int);
extern void (*init_ui_hook) (char *argv0);
extern void (*command_loop_hook) (void);
extern void (*show_load_progress) (const char *section,
- unsigned long section_sent,
- unsigned long section_size,
- unsigned long total_sent,
+ unsigned long section_sent,
+ unsigned long section_size,
+ unsigned long total_sent,
unsigned long total_size);
extern void (*print_frame_info_listing_hook) (struct symtab * s,
int line, int stopline,
Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
-This file is part of GDB.
+ This file is part of GDB.
-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
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ 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
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "gdb_string.h"
struct type *builtin_type_void;
struct type *builtin_type_char;
+struct type *builtin_type_true_char;
struct type *builtin_type_short;
struct type *builtin_type_int;
struct type *builtin_type_long;
struct type *builtin_type_int64;
struct type *builtin_type_uint64;
struct type *builtin_type_bool;
+struct type *builtin_type_v4sf;
+struct type *builtin_type_v4si;
+struct type *builtin_type_v8qi;
+struct type *builtin_type_v4hi;
+struct type *builtin_type_v2si;
+struct type *builtin_type_ptr;
+struct type *builtin_type_CORE_ADDR;
+struct type *builtin_type_bfd_vma;
int opaque_type_resolution = 1;
-struct extra { char str[128]; int len; }; /* maximum extention is 128! FIXME */
+struct extra
+ {
+ char str[128];
+ int len;
+ }; /* maximum extention is 128! FIXME */
static void add_name PARAMS ((struct extra *, char *));
static void add_mangled_type PARAMS ((struct extra *, struct type *));
static void print_arg_types PARAMS ((struct type **, int));
static void dump_fn_fieldlists PARAMS ((struct type *, int));
static void print_cplus_stuff PARAMS ((struct type *, int));
+static void virtual_base_list_aux PARAMS ((struct type * dclass));
+
/* Alloc a new type structure and fill it with some defaults. If
OBJFILE is non-NULL, then allocate the space for the type structure
if (objfile == NULL)
{
- type = (struct type *) xmalloc (sizeof (struct type));
+ type = (struct type *) xmalloc (sizeof (struct type));
}
else
{
- type = (struct type *) obstack_alloc (&objfile -> type_obstack,
- sizeof (struct type));
+ type = (struct type *) obstack_alloc (&objfile->type_obstack,
+ sizeof (struct type));
OBJSTAT (objfile, n_types++);
}
memset ((char *) type, 0, sizeof (struct type));
TYPE_CODE (type) = TYPE_CODE_UNDEF;
TYPE_OBJFILE (type) = objfile;
TYPE_VPTR_FIELDNO (type) = -1;
- TYPE_CV_TYPE (type) = type; /* chain back to itself */
+ TYPE_CV_TYPE (type) = type; /* chain back to itself */
return (type);
}
struct type *type;
struct type **typeptr;
{
- register struct type *ntype; /* New type */
+ register struct type *ntype; /* New type */
struct objfile *objfile;
ntype = TYPE_POINTER_TYPE (type);
- if (ntype)
+ if (ntype)
{
- if (typeptr == 0)
- return ntype; /* Don't care about alloc, and have new type. */
+ if (typeptr == 0)
+ return ntype; /* Don't care about alloc, and have new type. */
else if (*typeptr == 0)
- {
+ {
*typeptr = ntype; /* Tracking alloc, and we have new type. */
return ntype;
- }
+ }
}
if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */
if (typeptr)
*typeptr = ntype;
}
- else /* We have storage, but need to reset it. */
+ else
+ /* We have storage, but need to reset it. */
{
ntype = *typeptr;
objfile = TYPE_OBJFILE (ntype);
/* pointers are unsigned */
TYPE_FLAGS (ntype) |= TYPE_FLAG_UNSIGNED;
-
+
if (!TYPE_POINTER_TYPE (type)) /* Remember it, if don't have one. */
TYPE_POINTER_TYPE (type) = ntype;
lookup_pointer_type (type)
struct type *type;
{
- return make_pointer_type (type, (struct type **)0);
+ return make_pointer_type (type, (struct type **) 0);
}
/* Lookup a C++ `reference' to a type TYPE. TYPEPTR, if nonzero, points
struct type *type;
struct type **typeptr;
{
- register struct type *ntype; /* New type */
+ register struct type *ntype; /* New type */
struct objfile *objfile;
ntype = TYPE_REFERENCE_TYPE (type);
- if (ntype)
+ if (ntype)
{
- if (typeptr == 0)
- return ntype; /* Don't care about alloc, and have new type. */
+ if (typeptr == 0)
+ return ntype; /* Don't care about alloc, and have new type. */
else if (*typeptr == 0)
- {
+ {
*typeptr = ntype; /* Tracking alloc, and we have new type. */
return ntype;
- }
+ }
}
if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */
if (typeptr)
*typeptr = ntype;
}
- else /* We have storage, but need to reset it. */
+ else
+ /* We have storage, but need to reset it. */
{
ntype = *typeptr;
objfile = TYPE_OBJFILE (ntype);
TYPE_LENGTH (ntype) = TARGET_PTR_BIT / TARGET_CHAR_BIT;
TYPE_CODE (ntype) = TYPE_CODE_REF;
-
+
if (!TYPE_REFERENCE_TYPE (type)) /* Remember it, if don't have one. */
TYPE_REFERENCE_TYPE (type) = ntype;
lookup_reference_type (type)
struct type *type;
{
- return make_reference_type (type, (struct type **)0);
+ return make_reference_type (type, (struct type **) 0);
}
/* Lookup a function type that returns type TYPE. TYPEPTR, if nonzero, points
struct type *type;
struct type **typeptr;
{
- register struct type *ntype; /* New type */
+ register struct type *ntype; /* New type */
struct objfile *objfile;
if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */
if (typeptr)
*typeptr = ntype;
}
- else /* We have storage, but need to reset it. */
+ else
+ /* We have storage, but need to reset it. */
{
ntype = *typeptr;
objfile = TYPE_OBJFILE (ntype);
TYPE_LENGTH (ntype) = 1;
TYPE_CODE (ntype) = TYPE_CODE_FUNC;
-
+
return ntype;
}
lookup_function_type (type)
struct type *type;
{
- return make_function_type (type, (struct type **)0);
+ return make_function_type (type, (struct type **) 0);
}
struct type *type;
struct type **typeptr;
{
- register struct type *ntype; /* New type */
- register struct type *tmp_type = type; /* tmp type */
+ register struct type *ntype; /* New type */
+ register struct type *tmp_type = type; /* tmp type */
struct objfile *objfile;
ntype = TYPE_CV_TYPE (type);
while (ntype != type)
{
if ((TYPE_CONST (ntype) == cnst) &&
- (TYPE_VOLATILE (ntype) == voltl))
- {
- if (typeptr == 0)
- return ntype;
- else if (*typeptr == 0)
- {
- *typeptr = ntype; /* Tracking alloc, and we have new type. */
- return ntype;
- }
- }
+ (TYPE_VOLATILE (ntype) == voltl))
+ {
+ if (typeptr == 0)
+ return ntype;
+ else if (*typeptr == 0)
+ {
+ *typeptr = ntype; /* Tracking alloc, and we have new type. */
+ return ntype;
+ }
+ }
tmp_type = ntype;
ntype = TYPE_CV_TYPE (ntype);
}
if (typeptr)
*typeptr = ntype;
}
- else /* We have storage, but need to reset it. */
+ else
+ /* We have storage, but need to reset it. */
{
ntype = *typeptr;
objfile = TYPE_OBJFILE (ntype);
TYPE_OBJFILE (ntype) = objfile;
}
- /* Copy original type */
+ /* Copy original type */
memcpy ((char *) ntype, (char *) type, sizeof (struct type));
/* But zero out fields that shouldn't be copied */
- TYPE_POINTER_TYPE (ntype) = (struct type *) 0; /* Need new pointer kind */
- TYPE_REFERENCE_TYPE (ntype) = (struct type *) 0; /* Need new referene kind */
+ TYPE_POINTER_TYPE (ntype) = (struct type *) 0; /* Need new pointer kind */
+ TYPE_REFERENCE_TYPE (ntype) = (struct type *) 0; /* Need new referene kind */
/* Note: TYPE_TARGET_TYPE can be left as is */
/* Set flags appropriately */
if (cnst)
- TYPE_FLAGS (ntype) |= TYPE_FLAG_CONST;
+ TYPE_FLAGS (ntype) |= TYPE_FLAG_CONST;
else
- TYPE_FLAGS (ntype) &= ~TYPE_FLAG_CONST;
+ TYPE_FLAGS (ntype) &= ~TYPE_FLAG_CONST;
if (voltl)
- TYPE_FLAGS (ntype) |= TYPE_FLAG_VOLATILE;
+ TYPE_FLAGS (ntype) |= TYPE_FLAG_VOLATILE;
else
- TYPE_FLAGS (ntype) &= ~TYPE_FLAG_VOLATILE;
+ TYPE_FLAGS (ntype) &= ~TYPE_FLAG_VOLATILE;
/* Fix the chain of cv variants */
TYPE_CV_TYPE (ntype) = type;
return (mtype);
}
-/* Allocate a stub method whose return type is TYPE.
+/* Allocate a stub method whose return type is TYPE.
This apparently happens for speed of symbol reading, since parsing
out the arguments to the method is cpu-intensive, the way we are doing
it. So, we will fill in arguments later.
memset (TYPE_FIELDS (result_type), 0, 2 * sizeof (struct field));
TYPE_FIELD_BITPOS (result_type, 0) = low_bound;
TYPE_FIELD_BITPOS (result_type, 1) = high_bound;
- TYPE_FIELD_TYPE (result_type, 0) = builtin_type_int; /* FIXME */
- TYPE_FIELD_TYPE (result_type, 1) = builtin_type_int; /* FIXME */
+ TYPE_FIELD_TYPE (result_type, 0) = builtin_type_int; /* FIXME */
+ TYPE_FIELD_TYPE (result_type, 1) = builtin_type_int; /* FIXME */
- if(low_bound >= 0)
+ if (low_bound >= 0)
TYPE_FLAGS (result_type) |= TYPE_FLAG_UNSIGNED;
return (result_type);
}
/* Set unsigned indicator if warranted. */
- if(*lowp >= 0)
+ if (*lowp >= 0)
{
TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
}
*highp = 1;
return 0;
case TYPE_CODE_INT:
- if (TYPE_LENGTH (type) > sizeof (LONGEST)) /* Too big */
+ if (TYPE_LENGTH (type) > sizeof (LONGEST)) /* Too big */
return -1;
if (!TYPE_UNSIGNED (type))
{
- *lowp = - (1 << (TYPE_LENGTH (type) * TARGET_CHAR_BIT - 1));
+ *lowp = -(1 << (TYPE_LENGTH (type) * TARGET_CHAR_BIT - 1));
*highp = -*lowp - 1;
return 0;
}
TYPE_ALLOC (result_type, 1 * sizeof (struct field));
memset (TYPE_FIELDS (result_type), 0, sizeof (struct field));
- if (! (TYPE_FLAGS (domain_type) & TYPE_FLAG_STUB))
+ if (!(TYPE_FLAGS (domain_type) & TYPE_FLAG_STUB))
{
if (get_discrete_bounds (domain_type, &low_bound, &high_bound) < 0)
low_bound = high_bound = 0;
}
TYPE_FIELD_TYPE (result_type, 0) = domain_type;
- if(low_bound >= 0)
+ if (low_bound >= 0)
TYPE_FLAGS (result_type) |= TYPE_FLAG_UNSIGNED;
return (result_type);
}
-/* Smash TYPE to be a type of members of DOMAIN with type TO_TYPE.
+
+/* Construct and return a type of the form:
+ struct NAME { ELT_TYPE ELT_NAME[N]; }
+ We use these types for SIMD registers. For example, the type of
+ the SSE registers on the late x86-family processors is:
+ struct __builtin_v4sf { float f[4]; }
+ built by the function call:
+ init_simd_type ("__builtin_v4sf", builtin_type_float, "f", 4)
+ The type returned is a permanent type, allocated using malloc; it
+ doesn't live in any objfile's obstack. */
+static struct type *
+init_simd_type (char *name,
+ struct type *elt_type,
+ char *elt_name,
+ int n)
+{
+ struct type *t;
+ struct field *f;
+
+ /* Build the field structure. */
+ f = xmalloc (sizeof (*f));
+ memset (f, 0, sizeof (*f));
+ f->loc.bitpos = 0;
+ f->type = create_array_type (0, elt_type,
+ create_range_type (0, builtin_type_int,
+ 0, n-1));
+ f->name = elt_name;
+
+ /* Build a struct type with that field. */
+ t = init_type (TYPE_CODE_STRUCT, n * TYPE_LENGTH (elt_type), 0, 0, 0);
+ t->nfields = 1;
+ t->fields = f;
+ t->tag_name = name;
+
+ return t;
+}
+
+
+/* Smash TYPE to be a type of members of DOMAIN with type TO_TYPE.
A MEMBER is a wierd thing -- it amounts to a typed offset into
a struct, e.g. "an int at offset 8". A MEMBER TYPE doesn't
include the offset (that's the value of the MEMBER itself), but does
return TYPE_NAME (type);
}
-/* Lookup a primitive type named NAME.
- Return zero if NAME is not a primitive type.*/
+/* Lookup a primitive type named NAME.
+ Return zero if NAME is not a primitive type. */
struct type *
lookup_primitive_typename (name)
char *name;
{
- struct type ** const *p;
-
- for (p = current_language -> la_builtin_type_vector; *p != NULL; p++)
- {
- if (STREQ ((**p) -> name, name))
- {
- return (**p);
- }
- }
- return (NULL);
+ struct type **const *p;
+
+ for (p = current_language->la_builtin_type_vector; *p != NULL; p++)
+ {
+ if (STREQ ((**p)->name, name))
+ {
+ return (**p);
+ }
+ }
+ return (NULL);
}
/* Lookup a typedef or primitive type named NAME,
struct block *block;
{
register struct symbol *sym;
- struct type * t;
+ struct type *t;
sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0,
(struct symtab **) NULL);
if (sym == NULL)
error ("No union type named %s.", name);
- t = SYMBOL_TYPE(sym);
+ t = SYMBOL_TYPE (sym);
if (TYPE_CODE (t) == TYPE_CODE_UNION)
return (t);
/* C++ unions may come out with TYPE_CODE_CLASS, but we look at
* a further "declared_type" field to discover it is really a union.
*/
- if (HAVE_CPLUS_STRUCT (t))
- if (TYPE_DECLARED_TYPE(t) == DECLARED_TYPE_UNION)
+ if (HAVE_CPLUS_STRUCT (t))
+ if (TYPE_DECLARED_TYPE (t) == DECLARED_TYPE_UNION)
return (t);
/* If we get here, it's not a union */
{
register struct symbol *sym;
- sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0,
+ sym = lookup_symbol (name, block, STRUCT_NAMESPACE, 0,
(struct symtab **) NULL);
if (sym == NULL)
{
struct block *block;
{
struct symbol *sym;
- char *nam = (char*) alloca(strlen(name) + strlen(type->name) + 4);
+ char *nam = (char *) alloca (strlen (name) + strlen (type->name) + 4);
strcpy (nam, name);
strcat (nam, "<");
strcat (nam, type->name);
- strcat (nam, " >"); /* FIXME, extra space still introduced in gcc? */
+ strcat (nam, " >"); /* FIXME, extra space still introduced in gcc? */
- sym = lookup_symbol (nam, block, VAR_NAMESPACE, 0, (struct symtab **)NULL);
+ sym = lookup_symbol (nam, block, VAR_NAMESPACE, 0, (struct symtab **) NULL);
if (sym == NULL)
{
return (SYMBOL_TYPE (sym));
}
-/* Given a type TYPE, lookup the type of the component of type named NAME.
+/* Given a type TYPE, lookup the type of the component of type named NAME.
TYPE can be either a struct or union, or a pointer or reference to a struct or
union. If it is a pointer or reference, its target type is automatically used.
lookup_struct_elt_type (type, name, noerr)
struct type *type;
char *name;
- int noerr;
+ int noerr;
{
int i;
{
char *t_field_name = TYPE_FIELD_NAME (type, i);
- if (t_field_name && STREQ (t_field_name, name))
+ if (t_field_name && STREQ_IW (t_field_name, name))
{
return TYPE_FIELD_TYPE (type, i);
}
{
return NULL;
}
-
+
target_terminal_ours ();
gdb_flush (gdb_stdout);
fprintf_unfiltered (gdb_stderr, "Type ");
fprintf_unfiltered (gdb_stderr, " has no component named ");
fputs_filtered (name, gdb_stderr);
error (".");
- return (struct type *)-1; /* For lint */
+ return (struct type *) -1; /* For lint */
}
/* If possible, make the vptr_fieldno and vptr_basetype fields of TYPE
be a mistake, though--we might load in more symbols which contain a
full definition for the type.
- This used to be coded as a macro, but I don't think it is called
+ This used to be coded as a macro, but I don't think it is called
often enough to merit such treatment. */
struct complaint stub_noname_complaint =
- {"stub type has NULL name", 0, 0};
+{"stub type has NULL name", 0, 0};
struct type *
check_typedef (type)
{
if (!TYPE_TARGET_TYPE (type))
{
- char* name;
+ char *name;
struct symbol *sym;
/* It is dangerous to call lookup_symbol if we are currently
complain (&stub_noname_complaint);
return type;
}
- sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0,
+ sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0,
(struct symtab **) NULL);
if (sym)
TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym);
else
- TYPE_TARGET_TYPE (type) = alloc_type (NULL); /* TYPE_CODE_UNDEF */
+ TYPE_TARGET_TYPE (type) = alloc_type (NULL); /* TYPE_CODE_UNDEF */
}
type = TYPE_TARGET_TYPE (type);
}
/* If this is a struct/class/union with no fields, then check whether a
full definition exists somewhere else. This is for systems where a
type definition with no fields is issued for such types, instead of
- identifying them as stub types in the first place */
-
+ identifying them as stub types in the first place */
+
if (TYPE_IS_OPAQUE (type) && opaque_type_resolution && !currently_reading_symtab)
{
- char * name = type_name_no_tag (type);
- struct type * newtype;
+ char *name = type_name_no_tag (type);
+ struct type *newtype;
if (name == NULL)
{
complain (&stub_noname_complaint);
}
}
/* Otherwise, rely on the stub flag being set for opaque/stubbed types */
- else if ((TYPE_FLAGS(type) & TYPE_FLAG_STUB) && ! currently_reading_symtab)
+ else if ((TYPE_FLAGS (type) & TYPE_FLAG_STUB) && !currently_reading_symtab)
{
- char* name = type_name_no_tag (type);
+ char *name = type_name_no_tag (type);
/* FIXME: shouldn't we separately check the TYPE_NAME and the
TYPE_TAG_NAME, and look in STRUCT_NAMESPACE and/or VAR_NAMESPACE
as appropriate? (this code was written before TYPE_NAME and
sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0, (struct symtab **) NULL);
if (sym)
{
- memcpy ((char *)type, (char *)SYMBOL_TYPE(sym), sizeof (struct type));
+ memcpy ((char *) type, (char *) SYMBOL_TYPE (sym), sizeof (struct type));
}
}
struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
if (TYPE_FLAGS (target_type) & (TYPE_FLAG_STUB | TYPE_FLAG_TARGET_STUB))
- { }
+ {
+ }
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY
&& TYPE_NFIELDS (type) == 1
&& (TYPE_CODE (range_type = TYPE_FIELD_TYPE (type, 0))
#define INIT_EXTRA { pextras->len=0; pextras->str[0]='\0'; }
#define ADD_EXTRA(c) { pextras->str[pextras->len++]=c; }
-static void
-add_name(pextras,n)
- struct extra * pextras;
- char * n;
+static void
+add_name (pextras, n)
+ struct extra *pextras;
+ char *n;
{
int nlen;
- if ((nlen = (n ? strlen(n) : 0))==0)
+ if ((nlen = (n ? strlen (n) : 0)) == 0)
return;
- sprintf(pextras->str+pextras->len,"%d%s",nlen,n);
- pextras->len=strlen(pextras->str);
+ sprintf (pextras->str + pextras->len, "%d%s", nlen, n);
+ pextras->len = strlen (pextras->str);
}
-static void
-add_mangled_type(pextras,t)
- struct extra * pextras;
- struct type * t;
+static void
+add_mangled_type (pextras, t)
+ struct extra *pextras;
+ struct type *t;
{
enum type_code tcode;
int tlen, tflags;
- char * tname;
+ char *tname;
- tcode = TYPE_CODE(t);
- tlen = TYPE_LENGTH(t);
- tflags = TYPE_FLAGS(t);
- tname = TYPE_NAME(t);
+ tcode = TYPE_CODE (t);
+ tlen = TYPE_LENGTH (t);
+ tflags = TYPE_FLAGS (t);
+ tname = TYPE_NAME (t);
/* args of "..." seem to get mangled as "e" */
- switch (tcode)
- {
- case TYPE_CODE_INT:
- if (tflags==1)
- ADD_EXTRA('U');
- switch (tlen)
- {
- case 1:
- ADD_EXTRA('c');
- break;
- case 2:
- ADD_EXTRA('s');
- break;
- case 4:
- {
- char* pname;
- if ((pname=strrchr(tname,'l'),pname) && !strcmp(pname,"long"))
- ADD_EXTRA('l')
- else
- ADD_EXTRA('i')
- }
- break;
- default:
- {
-
- static struct complaint msg = {"Bad int type code length x%x\n",0,0};
-
- complain (&msg, tlen);
-
- }
- }
- break;
- case TYPE_CODE_FLT:
- switch (tlen)
- {
- case 4:
- ADD_EXTRA('f');
- break;
- case 8:
- ADD_EXTRA('d');
- break;
- case 16:
- ADD_EXTRA('r');
- break;
- default:
- {
- static struct complaint msg = {"Bad float type code length x%x\n",0,0};
- complain (&msg, tlen);
- }
- }
- break;
- case TYPE_CODE_REF:
- ADD_EXTRA('R');
- /* followed by what it's a ref to */
- break;
- case TYPE_CODE_PTR:
- ADD_EXTRA('P');
- /* followed by what it's a ptr to */
- break;
- case TYPE_CODE_TYPEDEF:
- {
- static struct complaint msg = {"Typedefs in overloaded functions not yet supported\n",0,0};
- complain (&msg);
- }
+ switch (tcode)
+ {
+ case TYPE_CODE_INT:
+ if (tflags == 1)
+ ADD_EXTRA ('U');
+ switch (tlen)
+ {
+ case 1:
+ ADD_EXTRA ('c');
+ break;
+ case 2:
+ ADD_EXTRA ('s');
+ break;
+ case 4:
+ {
+ char *pname;
+ if ((pname = strrchr (tname, 'l'), pname) && !strcmp (pname, "long"))
+ {
+ ADD_EXTRA ('l');
+ }
+ else
+ {
+ ADD_EXTRA ('i');
+ }
+ }
+ break;
+ default:
+ {
+
+ static struct complaint msg =
+ {"Bad int type code length x%x\n", 0, 0};
+
+ complain (&msg, tlen);
+
+ }
+ }
+ break;
+ case TYPE_CODE_FLT:
+ switch (tlen)
+ {
+ case 4:
+ ADD_EXTRA ('f');
+ break;
+ case 8:
+ ADD_EXTRA ('d');
+ break;
+ case 16:
+ ADD_EXTRA ('r');
+ break;
+ default:
+ {
+ static struct complaint msg =
+ {"Bad float type code length x%x\n", 0, 0};
+ complain (&msg, tlen);
+ }
+ }
+ break;
+ case TYPE_CODE_REF:
+ ADD_EXTRA ('R');
+ /* followed by what it's a ref to */
+ break;
+ case TYPE_CODE_PTR:
+ ADD_EXTRA ('P');
+ /* followed by what it's a ptr to */
+ break;
+ case TYPE_CODE_TYPEDEF:
+ {
+ static struct complaint msg =
+ {"Typedefs in overloaded functions not yet supported\n", 0, 0};
+ complain (&msg);
+ }
/* followed by type bytes & name */
break;
case TYPE_CODE_FUNC:
- ADD_EXTRA('F');
+ ADD_EXTRA ('F');
/* followed by func's arg '_' & ret types */
break;
case TYPE_CODE_VOID:
- ADD_EXTRA('v');
+ ADD_EXTRA ('v');
break;
case TYPE_CODE_METHOD:
- ADD_EXTRA('M');
+ ADD_EXTRA ('M');
/* followed by name of class and func's arg '_' & ret types */
- add_name(pextras,tname);
- ADD_EXTRA('F'); /* then mangle function */
+ add_name (pextras, tname);
+ ADD_EXTRA ('F'); /* then mangle function */
break;
- case TYPE_CODE_STRUCT: /* C struct */
- case TYPE_CODE_UNION: /* C union */
- case TYPE_CODE_ENUM: /* Enumeration type */
+ case TYPE_CODE_STRUCT: /* C struct */
+ case TYPE_CODE_UNION: /* C union */
+ case TYPE_CODE_ENUM: /* Enumeration type */
/* followed by name of type */
- add_name(pextras,tname);
+ add_name (pextras, tname);
break;
- /* errors possible types/not supported */
- case TYPE_CODE_CHAR:
- case TYPE_CODE_ARRAY: /* Array type */
- case TYPE_CODE_MEMBER: /* Member type */
+ /* errors possible types/not supported */
+ case TYPE_CODE_CHAR:
+ case TYPE_CODE_ARRAY: /* Array type */
+ case TYPE_CODE_MEMBER: /* Member type */
case TYPE_CODE_BOOL:
- case TYPE_CODE_COMPLEX: /* Complex float */
+ case TYPE_CODE_COMPLEX: /* Complex float */
case TYPE_CODE_UNDEF:
- case TYPE_CODE_SET: /* Pascal sets */
- case TYPE_CODE_RANGE:
+ case TYPE_CODE_SET: /* Pascal sets */
+ case TYPE_CODE_RANGE:
case TYPE_CODE_STRING:
case TYPE_CODE_BITSTRING:
case TYPE_CODE_ERROR:
- default:
+ default:
{
- static struct complaint msg = {"Unknown type code x%x\n",0,0};
- complain (&msg, tcode);
+ static struct complaint msg =
+ {"Unknown type code x%x\n", 0, 0};
+ complain (&msg, tcode);
}
}
if (t->target_type)
- add_mangled_type(pextras,t->target_type);
+ add_mangled_type (pextras, t->target_type);
}
#if 0
void
-cfront_mangle_name(type, i, j)
+cfront_mangle_name (type, i, j)
struct type *type;
int i;
int j;
{
- struct fn_field *f;
- char *mangled_name = gdb_mangle_name (type, i, j);
-
- f = TYPE_FN_FIELDLIST1 (type, i); /* moved from below */
-
- /* kludge to support cfront methods - gdb expects to find "F" for
- ARM_mangled names, so when we mangle, we have to add it here */
- if (ARM_DEMANGLING)
- {
- int k;
- char * arm_mangled_name;
- struct fn_field *method = &f[j];
- char *field_name = TYPE_FN_FIELDLIST_NAME (type, i);
- char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
- char *newname = type_name_no_tag (type);
-
- struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);
- int nargs = TYPE_NFIELDS(ftype); /* number of args */
- struct extra extras, * pextras = &extras;
- INIT_EXTRA
+ struct fn_field *f;
+ char *mangled_name = gdb_mangle_name (type, i, j);
+
+ f = TYPE_FN_FIELDLIST1 (type, i); /* moved from below */
+
+ /* kludge to support cfront methods - gdb expects to find "F" for
+ ARM_mangled names, so when we mangle, we have to add it here */
+ if (ARM_DEMANGLING)
+ {
+ int k;
+ char *arm_mangled_name;
+ struct fn_field *method = &f[j];
+ char *field_name = TYPE_FN_FIELDLIST_NAME (type, i);
+ char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
+ char *newname = type_name_no_tag (type);
+
+ struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);
+ int nargs = TYPE_NFIELDS (ftype); /* number of args */
+ struct extra extras, *pextras = &extras;
+ INIT_EXTRA
if (TYPE_FN_FIELD_STATIC_P (f, j)) /* j for sublist within this list */
- ADD_EXTRA('S')
- ADD_EXTRA('F')
+ ADD_EXTRA ('S')
+ ADD_EXTRA ('F')
/* add args here! */
- if (nargs <= 1) /* no args besides this */
- ADD_EXTRA('v')
- else {
- for (k=1; k<nargs; k++)
- {
- struct type * t;
- t = TYPE_FIELD_TYPE(ftype,k);
- add_mangled_type(pextras,t);
- }
- }
- ADD_EXTRA('\0')
- printf("add_mangled_type: %s\n",extras.str); /* FIXME */
- arm_mangled_name = malloc(strlen(mangled_name)+extras.len);
- sprintf(arm_mangled_name,"%s%s",mangled_name,extras.str);
- free(mangled_name);
- mangled_name = arm_mangled_name;
- }
+ if (nargs <= 1) /* no args besides this */
+ ADD_EXTRA ('v')
+ else
+ {
+ for (k = 1; k < nargs; k++)
+ {
+ struct type *t;
+ t = TYPE_FIELD_TYPE (ftype, k);
+ add_mangled_type (pextras, t);
+ }
+ }
+ ADD_EXTRA ('\0')
+ printf ("add_mangled_type: %s\n", extras.str); /* FIXME */
+ arm_mangled_name = malloc (strlen (mangled_name) + extras.len);
+ sprintf (arm_mangled_name, "%s%s", mangled_name, extras.str);
+ free (mangled_name);
+ mangled_name = arm_mangled_name;
+ }
}
-#endif /* 0 */
+#endif /* 0 */
#undef ADD_EXTRA
/* End of new code added to support parsing of Cfront stabs strings */
argtypes[0] = lookup_pointer_type (type);
argcount = 1;
- if (*p != ')') /* () means no args, skip while */
+ if (*p != ')') /* () means no args, skip while */
{
depth = 0;
while (*p)
if (strncmp (argtypetext, "...", p - argtypetext) != 0)
{
argtypes[argcount] =
- parse_and_eval_type (argtypetext, p - argtypetext);
+ parse_and_eval_type (argtypetext, p - argtypetext);
argcount += 1;
}
argtypetext = p + 1;
}
}
- if (p[-2] != '.') /* Not '...' */
+ if (p[-2] != '.') /* Not '...' */
{
argtypes[argcount] = builtin_type_void; /* List terminator */
}
else
{
- argtypes[argcount] = NULL; /* Ellist terminator */
+ argtypes[argcount] = NULL; /* Ellist terminator */
}
free (demangled_name);
- f = TYPE_FN_FIELDLIST1 (type, method_id);
+ f = TYPE_FN_FIELDLIST1 (type, method_id);
TYPE_FN_FIELD_PHYSNAME (f, signature_id) = mangled_name;
{
TYPE_CPLUS_SPECIFIC (type) = (struct cplus_struct_type *)
TYPE_ALLOC (type, sizeof (struct cplus_struct_type));
- *(TYPE_CPLUS_SPECIFIC(type)) = cplus_struct_default;
+ *(TYPE_CPLUS_SPECIFIC (type)) = cplus_struct_default;
}
}
if ((name != NULL) && (objfile != NULL))
{
TYPE_NAME (type) =
- obsavestring (name, strlen (name), &objfile -> type_obstack);
+ obsavestring (name, strlen (name), &objfile->type_obstack);
}
else
{
/* If this is the first time we need a fundamental type for this objfile
then we need to initialize the vector of type pointers. */
-
- if (objfile -> fundamental_types == NULL)
+
+ if (objfile->fundamental_types == NULL)
{
nbytes = FT_NUM_MEMBERS * sizeof (struct type *);
- objfile -> fundamental_types = (struct type **)
- obstack_alloc (&objfile -> type_obstack, nbytes);
- memset ((char *) objfile -> fundamental_types, 0, nbytes);
+ objfile->fundamental_types = (struct type **)
+ obstack_alloc (&objfile->type_obstack, nbytes);
+ memset ((char *) objfile->fundamental_types, 0, nbytes);
OBJSTAT (objfile, n_types += FT_NUM_MEMBERS);
}
/* Look for this particular type in the fundamental type vector. If one is
not found, create and install one appropriate for the current language. */
- typep = objfile -> fundamental_types + typeid;
+ typep = objfile->fundamental_types + typeid;
if (*typep == NULL)
{
*typep = create_fundamental_type (objfile, typeid);
&& TYPE_CODE (TYPE_TARGET_TYPE (t)) != TYPE_CODE_VOID);
}
+int
+is_integral_type (t)
+ struct type *t;
+{
+ CHECK_TYPEDEF (t);
+ return
+ ((t != NULL)
+ && ((TYPE_CODE (t) == TYPE_CODE_INT)
+ || (TYPE_CODE (t) == TYPE_CODE_ENUM)
+ || (TYPE_CODE (t) == TYPE_CODE_CHAR)
+ || (TYPE_CODE (t) == TYPE_CODE_RANGE)
+ || (TYPE_CODE (t) == TYPE_CODE_BOOL)));
+}
+
/* Chill varying string and arrays are represented as follows:
struct { int __var_length; ELEMENT_TYPE[MAX_SIZE] __var_data};
return 1;
}
-/* Check whether BASE is an ancestor or base class or DCLASS
+/* Check whether BASE is an ancestor or base class or DCLASS
Return 1 if so, and 0 if not.
Note: callers may want to check for identity of the types before
calling this function -- identical types are considered to satisfy
int
is_ancestor (base, dclass)
- struct type * base;
- struct type * dclass;
+ struct type *base;
+ struct type *dclass;
{
int i;
-
+
CHECK_TYPEDEF (base);
CHECK_TYPEDEF (dclass);
int
has_vtable (dclass)
- struct type * dclass;
+ struct type *dclass;
{
/* In the HP ANSI C++ runtime model, a class has a vtable only if it
has virtual functions or virtual bases. */
register int i;
- if (TYPE_CODE(dclass) != TYPE_CODE_CLASS)
+ if (TYPE_CODE (dclass) != TYPE_CODE_CLASS)
return 0;
-
+
/* First check for the presence of virtual bases */
- if (TYPE_FIELD_VIRTUAL_BITS(dclass))
- for (i=0; i < TYPE_N_BASECLASSES(dclass); i++)
- if (B_TST(TYPE_FIELD_VIRTUAL_BITS(dclass), i))
- return 1;
-
+ if (TYPE_FIELD_VIRTUAL_BITS (dclass))
+ for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
+ if (B_TST (TYPE_FIELD_VIRTUAL_BITS (dclass), i))
+ return 1;
+
/* Next check for virtual functions */
- if (TYPE_FN_FIELDLISTS(dclass))
- for (i=0; i < TYPE_NFN_FIELDS(dclass); i++)
- if (TYPE_FN_FIELD_VIRTUAL_P(TYPE_FN_FIELDLIST1(dclass, i), 0))
- return 1;
-
- /* Recurse on non-virtual bases to see if any of them needs a vtable */
- if (TYPE_FIELD_VIRTUAL_BITS(dclass))
- for (i=0; i < TYPE_N_BASECLASSES(dclass); i++)
- if ((!B_TST (TYPE_FIELD_VIRTUAL_BITS(dclass), i)) &&
- (has_vtable (TYPE_FIELD_TYPE(dclass, i))))
+ if (TYPE_FN_FIELDLISTS (dclass))
+ for (i = 0; i < TYPE_NFN_FIELDS (dclass); i++)
+ if (TYPE_FN_FIELD_VIRTUAL_P (TYPE_FN_FIELDLIST1 (dclass, i), 0))
return 1;
-
- /* Well, maybe we don't need a virtual table */
+
+ /* Recurse on non-virtual bases to see if any of them needs a vtable */
+ if (TYPE_FIELD_VIRTUAL_BITS (dclass))
+ for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
+ if ((!B_TST (TYPE_FIELD_VIRTUAL_BITS (dclass), i)) &&
+ (has_vtable (TYPE_FIELD_TYPE (dclass, i))))
+ return 1;
+
+ /* Well, maybe we don't need a virtual table */
return 0;
}
/* Return a pointer to the "primary base class" of DCLASS.
-
+
A NULL return indicates that DCLASS has no primary base, or that it
couldn't be found (insufficient information).
-
+
This routine is aimed at the HP/Taligent ANSI C++ runtime model,
and may not work with other runtime models. */
struct type *
primary_base_class (dclass)
- struct type * dclass;
+ struct type *dclass;
{
/* In HP ANSI C++'s runtime model, a "primary base class" of a class
is the first directly inherited, non-virtual base class that
register int i;
- if (TYPE_CODE(dclass) != TYPE_CODE_CLASS)
+ if (TYPE_CODE (dclass) != TYPE_CODE_CLASS)
return NULL;
- for (i=0; i < TYPE_N_BASECLASSES(dclass); i++)
- if (!TYPE_FIELD_VIRTUAL(dclass, i) &&
- has_vtable(TYPE_FIELD_TYPE(dclass, i)))
- return TYPE_FIELD_TYPE(dclass, i);
+ for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
+ if (!TYPE_FIELD_VIRTUAL (dclass, i) &&
+ has_vtable (TYPE_FIELD_TYPE (dclass, i)))
+ return TYPE_FIELD_TYPE (dclass, i);
return NULL;
}
/* Global manipulated by virtual_base_list[_aux]() */
-static struct vbase * current_vbase_list = NULL;
+static struct vbase *current_vbase_list = NULL;
/* Return a pointer to a null-terminated list of struct vbase
items. The vbasetype pointer of each item in the list points to the
type information for a virtual base of the argument DCLASS.
-
- Helper function for virtual_base_list().
+
+ Helper function for virtual_base_list().
Note: the list goes backward, right-to-left. virtual_base_list()
copies the items out in reverse order. */
-struct vbase *
+static void
virtual_base_list_aux (dclass)
- struct type * dclass;
+ struct type *dclass;
{
- struct vbase * tmp_vbase;
+ struct vbase *tmp_vbase;
register int i;
- if (TYPE_CODE(dclass) != TYPE_CODE_CLASS)
- return NULL;
+ if (TYPE_CODE (dclass) != TYPE_CODE_CLASS)
+ return;
for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
{
/* Recurse on this ancestor, first */
- virtual_base_list_aux(TYPE_FIELD_TYPE(dclass, i));
+ virtual_base_list_aux (TYPE_FIELD_TYPE (dclass, i));
/* If this current base is itself virtual, add it to the list */
- if (BASETYPE_VIA_VIRTUAL(dclass, i))
- {
- struct type * basetype = TYPE_FIELD_TYPE (dclass, i);
-
- /* Check if base already recorded */
- tmp_vbase = current_vbase_list;
- while (tmp_vbase)
- {
- if (tmp_vbase->vbasetype == basetype)
- break; /* found it */
- tmp_vbase = tmp_vbase->next;
- }
-
- if (!tmp_vbase) /* normal exit from loop */
- {
- /* Allocate new item for this virtual base */
- tmp_vbase = (struct vbase *) xmalloc (sizeof (struct vbase));
-
- /* Stick it on at the end of the list */
- tmp_vbase->vbasetype = basetype;
- tmp_vbase->next = current_vbase_list;
- current_vbase_list = tmp_vbase;
- }
- } /* if virtual */
- } /* for loop over bases */
+ if (BASETYPE_VIA_VIRTUAL (dclass, i))
+ {
+ struct type *basetype = TYPE_FIELD_TYPE (dclass, i);
+
+ /* Check if base already recorded */
+ tmp_vbase = current_vbase_list;
+ while (tmp_vbase)
+ {
+ if (tmp_vbase->vbasetype == basetype)
+ break; /* found it */
+ tmp_vbase = tmp_vbase->next;
+ }
+
+ if (!tmp_vbase) /* normal exit from loop */
+ {
+ /* Allocate new item for this virtual base */
+ tmp_vbase = (struct vbase *) xmalloc (sizeof (struct vbase));
+
+ /* Stick it on at the end of the list */
+ tmp_vbase->vbasetype = basetype;
+ tmp_vbase->next = current_vbase_list;
+ current_vbase_list = tmp_vbase;
+ }
+ } /* if virtual */
+ } /* for loop over bases */
}
bases are laid out in the object's memory area in order of their
occurrence in a depth-first, left-to-right search through the
ancestors.
-
+
Argument DCLASS is the type whose virtual bases are required.
Return value is the address of a null-terminated array of pointers
to struct type items.
-
+
This routine is aimed at the HP/Taligent ANSI C++ runtime model,
and may not work with other runtime models.
-
+
This routine merely hands off the argument to virtual_base_list_aux()
and then copies the result into an array to save space. */
struct type **
virtual_base_list (dclass)
- struct type * dclass;
+ struct type *dclass;
{
- register struct vbase * tmp_vbase;
- register struct vbase * tmp_vbase_2;
+ register struct vbase *tmp_vbase;
+ register struct vbase *tmp_vbase_2;
register int i;
int count;
- struct type ** vbase_array;
+ struct type **vbase_array;
current_vbase_list = NULL;
- virtual_base_list_aux(dclass);
+ virtual_base_list_aux (dclass);
- for (i=0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; i++, tmp_vbase = tmp_vbase->next)
+ for (i = 0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; i++, tmp_vbase = tmp_vbase->next)
/* no body */ ;
count = i;
- vbase_array = (struct type **) xmalloc((count + 1) * sizeof (struct type *));
+ vbase_array = (struct type **) xmalloc ((count + 1) * sizeof (struct type *));
- for (i=count -1, tmp_vbase = current_vbase_list; i >= 0; i--, tmp_vbase = tmp_vbase->next)
+ for (i = count - 1, tmp_vbase = current_vbase_list; i >= 0; i--, tmp_vbase = tmp_vbase->next)
vbase_array[i] = tmp_vbase->vbasetype;
/* Get rid of constructed chain */
while (tmp_vbase)
{
tmp_vbase = tmp_vbase->next;
- free(tmp_vbase_2);
+ free (tmp_vbase_2);
tmp_vbase_2 = tmp_vbase;
}
-
+
vbase_array[count] = NULL;
return vbase_array;
}
int
virtual_base_list_length (dclass)
- struct type * dclass;
+ struct type *dclass;
{
register int i;
- register struct vbase * tmp_vbase;
-
+ register struct vbase *tmp_vbase;
+
current_vbase_list = NULL;
- virtual_base_list_aux(dclass);
+ virtual_base_list_aux (dclass);
- for (i=0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; i++, tmp_vbase = tmp_vbase->next)
+ for (i = 0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; i++, tmp_vbase = tmp_vbase->next)
/* no body */ ;
return i;
}
int
virtual_base_list_length_skip_primaries (dclass)
- struct type * dclass;
+ struct type *dclass;
{
register int i;
- register struct vbase * tmp_vbase;
- struct type * primary;
+ register struct vbase *tmp_vbase;
+ struct type *primary;
primary = TYPE_RUNTIME_PTR (dclass) ? TYPE_PRIMARY_BASE (dclass) : NULL;
return virtual_base_list_length (dclass);
current_vbase_list = NULL;
- virtual_base_list_aux(dclass);
+ virtual_base_list_aux (dclass);
- for (i=0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; tmp_vbase = tmp_vbase->next)
+ for (i = 0, tmp_vbase = current_vbase_list; tmp_vbase != NULL; tmp_vbase = tmp_vbase->next)
{
if (virtual_base_index (tmp_vbase->vbasetype, primary) >= 0)
- continue;
+ continue;
i++;
}
return i;
indicates "not found" or a problem. */
int
-virtual_base_index(base, dclass)
- struct type * base;
- struct type * dclass;
+virtual_base_index (base, dclass)
+ struct type *base;
+ struct type *dclass;
{
- register struct type * vbase;
+ register struct type *vbase;
register int i;
- if ((TYPE_CODE(dclass) != TYPE_CODE_CLASS) ||
- (TYPE_CODE(base) != TYPE_CODE_CLASS))
+ if ((TYPE_CODE (dclass) != TYPE_CODE_CLASS) ||
+ (TYPE_CODE (base) != TYPE_CODE_CLASS))
return -1;
i = 0;
- vbase = TYPE_VIRTUAL_BASE_LIST(dclass)[0];
+ vbase = TYPE_VIRTUAL_BASE_LIST (dclass)[0];
while (vbase)
{
if (vbase == base)
- break;
- vbase = TYPE_VIRTUAL_BASE_LIST(dclass)[++i];
+ break;
+ vbase = TYPE_VIRTUAL_BASE_LIST (dclass)[++i];
}
return vbase ? i : -1;
found" or a problem. */
int
-virtual_base_index_skip_primaries(base, dclass)
- struct type * base;
- struct type * dclass;
+virtual_base_index_skip_primaries (base, dclass)
+ struct type *base;
+ struct type *dclass;
{
- register struct type * vbase;
+ register struct type *vbase;
register int i, j;
- struct type * primary;
+ struct type *primary;
- if ((TYPE_CODE(dclass) != TYPE_CODE_CLASS) ||
- (TYPE_CODE(base) != TYPE_CODE_CLASS))
+ if ((TYPE_CODE (dclass) != TYPE_CODE_CLASS) ||
+ (TYPE_CODE (base) != TYPE_CODE_CLASS))
return -1;
- primary = TYPE_RUNTIME_PTR(dclass) ? TYPE_PRIMARY_BASE(dclass) : NULL;
+ primary = TYPE_RUNTIME_PTR (dclass) ? TYPE_PRIMARY_BASE (dclass) : NULL;
j = -1;
i = 0;
- vbase = TYPE_VIRTUAL_BASE_LIST(dclass)[0];
+ vbase = TYPE_VIRTUAL_BASE_LIST (dclass)[0];
while (vbase)
{
- if (!primary || (virtual_base_index_skip_primaries(vbase, primary) < 0))
- j++;
+ if (!primary || (virtual_base_index_skip_primaries (vbase, primary) < 0))
+ j++;
if (vbase == base)
- break;
- vbase = TYPE_VIRTUAL_BASE_LIST(dclass)[++i];
+ break;
+ vbase = TYPE_VIRTUAL_BASE_LIST (dclass)[++i];
}
return vbase ? j : -1;
int
class_index_in_primary_list (dclass)
- struct type * dclass;
+ struct type *dclass;
{
- struct type * pbc; /* primary base class */
+ struct type *pbc; /* primary base class */
- /* Simply recurse on primary base */
+ /* Simply recurse on primary base */
pbc = TYPE_PRIMARY_BASE (dclass);
if (pbc)
return 1 + class_index_in_primary_list (pbc);
int
count_virtual_fns (dclass)
- struct type * dclass;
+ struct type *dclass;
{
- int base; /* index for base classes */
- int fn, oi; /* function and overloaded instance indices */
-
- int vfuncs; /* count to return */
+ int fn, oi; /* function and overloaded instance indices */
+ int vfuncs; /* count to return */
- /* recurse on bases that can share virtual table */
- struct type * pbc = primary_base_class (dclass);
+ /* recurse on bases that can share virtual table */
+ struct type *pbc = primary_base_class (dclass);
if (pbc)
vfuncs = count_virtual_fns (pbc);
-
+
for (fn = 0; fn < TYPE_NFN_FIELDS (dclass); fn++)
for (oi = 0; oi < TYPE_FN_FIELDLIST_LENGTH (dclass, fn); oi++)
if (TYPE_FN_FIELD_VIRTUAL_P (TYPE_FN_FIELDLIST1 (dclass, fn), oi))
- vfuncs++;
+ vfuncs++;
return vfuncs;
}
-
\f
+
/* Functions for overload resolution begin here */
/* Compare two badness vectors A and B and return the result.
int
compare_badness (a, b)
- struct badness_vector * a;
- struct badness_vector * b;
+ struct badness_vector *a;
+ struct badness_vector *b;
{
int i;
int tmp;
- short found_pos = 0; /* any positives in c? */
- short found_neg = 0; /* any negatives in c? */
-
- /* differing lengths => incomparable */
+ short found_pos = 0; /* any positives in c? */
+ short found_neg = 0; /* any negatives in c? */
+
+ /* differing lengths => incomparable */
if (a->length != b->length)
return 1;
- /* Subtract b from a */
- for (i=0; i < a->length; i++)
+ /* Subtract b from a */
+ for (i = 0; i < a->length; i++)
{
tmp = a->rank[i] - b->rank[i];
if (tmp > 0)
- found_pos = 1;
+ found_pos = 1;
else if (tmp < 0)
- found_neg = 1;
+ found_neg = 1;
}
if (found_pos)
{
if (found_neg)
- return 1; /* incomparable */
+ return 1; /* incomparable */
else
- return 3; /* A > B */
+ return 3; /* A > B */
}
- else /* no positives */
+ else
+ /* no positives */
{
if (found_neg)
- return 2; /* A < B */
+ return 2; /* A < B */
else
- return 0; /* A == B */
+ return 0; /* A == B */
}
}
struct badness_vector *
rank_function (parms, nparms, args, nargs)
- struct type ** parms;
- int nparms;
- struct type ** args;
- int nargs;
+ struct type **parms;
+ int nparms;
+ struct type **args;
+ int nargs;
{
int i;
- struct badness_vector * bv;
+ struct badness_vector *bv;
int min_len = nparms < nargs ? nparms : nargs;
bv = xmalloc (sizeof (struct badness_vector));
- bv->length = nargs + 1; /* add 1 for the length-match rank */
+ bv->length = nargs + 1; /* add 1 for the length-match rank */
bv->rank = xmalloc ((nargs + 1) * sizeof (int));
/* First compare the lengths of the supplied lists.
* If there is a mismatch, set it to a high value. */
-
+
/* pai/1997-06-03 FIXME: when we have debug info about default
* arguments and ellipsis parameter lists, we should consider those
* and rank the length-match more finely. */
LENGTH_MATCH (bv) = (nargs != nparms) ? LENGTH_MISMATCH_BADNESS : 0;
/* Now rank all the parameters of the candidate function */
- for (i=1; i <= min_len; i++)
- bv->rank[i] = rank_one_type (parms[i-1], args[i-1]);
+ for (i = 1; i < min_len; i++)
+ bv->rank[i] = rank_one_type (parms[i], args[i]);
- /* If more arguments than parameters, add dummy entries */
- for (i = min_len +1; i <= nargs; i++)
+ /* If more arguments than parameters, add dummy entries */
+ for (i = min_len + 1; i <= nargs; i++)
bv->rank[i] = TOO_FEW_PARAMS_BADNESS;
return bv;
int
rank_one_type (parm, arg)
- struct type * parm;
- struct type * arg;
+ struct type *parm;
+ struct type *arg;
{
/* Identical type pointers */
/* However, this still doesn't catch all cases of same type for arg
if (parm == arg)
return 0;
-#if 0
- /* Debugging only */
- printf("------ Arg is %s [%d], parm is %s [%d]\n",
- TYPE_NAME (arg), TYPE_CODE (arg), TYPE_NAME (parm), TYPE_CODE (parm));
+ /* See through references, since we can almost make non-references references*/
+ if (TYPE_CODE (arg) == TYPE_CODE_REF)
+ return rank_one_type(TYPE_TARGET_TYPE(arg),parm) + REFERENCE_CONVERSION_BADNESS;
+ if (TYPE_CODE (parm) == TYPE_CODE_REF)
+ return rank_one_type(arg,TYPE_TARGET_TYPE(parm)) + REFERENCE_CONVERSION_BADNESS;
+
+#ifdef DEBUG_OLOAD
+ /* Debugging only */
+ printf ("------ Arg is %s [%d], parm is %s [%d]\n",
+ TYPE_NAME (arg), TYPE_CODE (arg), TYPE_NAME (parm), TYPE_CODE (parm));
#endif
/* x -> y means arg of type x being supplied for parameter of type y */
switch (TYPE_CODE (parm))
{
- case TYPE_CODE_PTR:
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_PTR:
- if (TYPE_CODE (TYPE_TARGET_TYPE (parm)) == TYPE_CODE_VOID)
- return VOID_PTR_CONVERSION_BADNESS;
- else
- return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
- case TYPE_CODE_ARRAY:
- return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
- case TYPE_CODE_FUNC:
- return rank_one_type (TYPE_TARGET_TYPE (parm), arg);
- case TYPE_CODE_INT:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_BOOL:
- return POINTER_CONVERSION_BADNESS;
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- case TYPE_CODE_ARRAY:
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_PTR:
- case TYPE_CODE_ARRAY:
- return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- case TYPE_CODE_FUNC:
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_PTR: /* funcptr -> func */
- return rank_one_type (parm, TYPE_TARGET_TYPE (arg));
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- case TYPE_CODE_INT:
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_INT:
- if (TYPE_LENGTH (arg) == TYPE_LENGTH (parm))
- {
- /* Deal with signed, unsigned, and plain chars and
- signed and unsigned ints */
- if (TYPE_NOSIGN (parm))
- {
- /* This case only for character types */
- if (TYPE_NOSIGN (arg)) /* plain char -> plain char */
- return 0;
- else
- return INTEGER_COERCION_BADNESS; /* signed/unsigned char -> plain char */
- }
- else if (TYPE_UNSIGNED (parm))
- {
- if (TYPE_UNSIGNED (arg))
- {
- if (!strcmp (TYPE_NAME (parm), TYPE_NAME (arg)))
- return 0; /* unsigned int -> unsigned int, or unsigned long -> unsigned long */
- else if (!strcmp (TYPE_NAME (arg), "int") && !strcmp (TYPE_NAME (parm), "long"))
- return INTEGER_PROMOTION_BADNESS; /* unsigned int -> unsigned long */
- else
- return INTEGER_COERCION_BADNESS; /* unsigned long -> unsigned int */
- }
- else
- {
- if (!strcmp (TYPE_NAME (arg), "long") && !strcmp (TYPE_NAME (parm), "int"))
- return INTEGER_COERCION_BADNESS; /* signed long -> unsigned int */
- else
- return INTEGER_CONVERSION_BADNESS; /* signed int/long -> unsigned int/long */
- }
- }
- else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
- {
- if (!strcmp (TYPE_NAME (parm), TYPE_NAME (arg)))
- return 0;
- else if (!strcmp (TYPE_NAME (arg), "int") && !strcmp (TYPE_NAME (parm), "long"))
- return INTEGER_PROMOTION_BADNESS;
- else
- return INTEGER_COERCION_BADNESS;
- }
- else
- return INTEGER_COERCION_BADNESS;
- }
- else if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
- return INTEGER_PROMOTION_BADNESS;
- else
- return INTEGER_COERCION_BADNESS;
- case TYPE_CODE_ENUM:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_BOOL:
- return INTEGER_PROMOTION_BADNESS;
- case TYPE_CODE_FLT:
- return INT_FLOAT_CONVERSION_BADNESS;
- case TYPE_CODE_PTR:
- return NS_POINTER_CONVERSION_BADNESS;
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_ENUM:
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_INT:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_BOOL:
- case TYPE_CODE_ENUM:
- return INTEGER_COERCION_BADNESS;
- case TYPE_CODE_FLT:
- return INT_FLOAT_CONVERSION_BADNESS;
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_CHAR:
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_RANGE:
- case TYPE_CODE_BOOL:
- case TYPE_CODE_ENUM:
- return INTEGER_COERCION_BADNESS;
- case TYPE_CODE_FLT:
- return INT_FLOAT_CONVERSION_BADNESS;
- case TYPE_CODE_INT:
- if (TYPE_LENGTH (arg) > TYPE_LENGTH (parm))
- return INTEGER_COERCION_BADNESS;
- else if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
- return INTEGER_PROMOTION_BADNESS;
- /* >>> !! else fall through !! <<< */
- case TYPE_CODE_CHAR:
- /* Deal with signed, unsigned, and plain chars for C++
- and with int cases falling through from previous case */
- if (TYPE_NOSIGN (parm))
- {
- if (TYPE_NOSIGN (arg))
- return 0;
- else
- return INTEGER_COERCION_BADNESS;
- }
- else if (TYPE_UNSIGNED (parm))
- {
- if (TYPE_UNSIGNED (arg))
- return 0;
- else
- return INTEGER_PROMOTION_BADNESS;
- }
- else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
- return 0;
- else
- return INTEGER_COERCION_BADNESS;
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_RANGE:
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_INT:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_BOOL:
- case TYPE_CODE_ENUM:
- return INTEGER_COERCION_BADNESS;
- case TYPE_CODE_FLT:
- return INT_FLOAT_CONVERSION_BADNESS;
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_BOOL:
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_INT:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_FLT:
- case TYPE_CODE_PTR:
- return BOOLEAN_CONVERSION_BADNESS;
- case TYPE_CODE_BOOL:
- return 0;
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_FLT:
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_FLT:
- if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
- return FLOAT_PROMOTION_BADNESS;
- else if (TYPE_LENGTH (arg) == TYPE_LENGTH (parm))
- return 0;
- else
- return FLOAT_CONVERSION_BADNESS;
- case TYPE_CODE_INT:
- case TYPE_CODE_BOOL:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_CHAR:
- return INT_FLOAT_CONVERSION_BADNESS;
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_COMPLEX:
- switch (TYPE_CODE (arg))
- { /* Strictly not needed for C++, but... */
- case TYPE_CODE_FLT:
- return FLOAT_PROMOTION_BADNESS;
- case TYPE_CODE_COMPLEX:
- return 0;
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_STRUCT:
+ case TYPE_CODE_PTR:
+ switch (TYPE_CODE (arg))
+ {
+ case TYPE_CODE_PTR:
+ if (TYPE_CODE (TYPE_TARGET_TYPE (parm)) == TYPE_CODE_VOID)
+ return VOID_PTR_CONVERSION_BADNESS;
+ else
+ return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
+ case TYPE_CODE_ARRAY:
+ return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
+ case TYPE_CODE_FUNC:
+ return rank_one_type (TYPE_TARGET_TYPE (parm), arg);
+ case TYPE_CODE_INT:
+ case TYPE_CODE_ENUM:
+ case TYPE_CODE_CHAR:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_BOOL:
+ return POINTER_CONVERSION_BADNESS;
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ case TYPE_CODE_ARRAY:
+ switch (TYPE_CODE (arg))
+ {
+ case TYPE_CODE_PTR:
+ case TYPE_CODE_ARRAY:
+ return rank_one_type (TYPE_TARGET_TYPE (parm), TYPE_TARGET_TYPE (arg));
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ case TYPE_CODE_FUNC:
+ switch (TYPE_CODE (arg))
+ {
+ case TYPE_CODE_PTR: /* funcptr -> func */
+ return rank_one_type (parm, TYPE_TARGET_TYPE (arg));
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ case TYPE_CODE_INT:
+ switch (TYPE_CODE (arg))
+ {
+ case TYPE_CODE_INT:
+ if (TYPE_LENGTH (arg) == TYPE_LENGTH (parm))
+ {
+ /* Deal with signed, unsigned, and plain chars and
+ signed and unsigned ints */
+ if (TYPE_NOSIGN (parm))
+ {
+ /* This case only for character types */
+ if (TYPE_NOSIGN (arg)) /* plain char -> plain char */
+ return 0;
+ else
+ return INTEGER_COERCION_BADNESS; /* signed/unsigned char -> plain char */
+ }
+ else if (TYPE_UNSIGNED (parm))
+ {
+ if (TYPE_UNSIGNED (arg))
+ {
+ if (!strcmp_iw (TYPE_NAME (parm), TYPE_NAME (arg)))
+ return 0; /* unsigned int -> unsigned int, or unsigned long -> unsigned long */
+ else if (!strcmp_iw (TYPE_NAME (arg), "int") && !strcmp_iw (TYPE_NAME (parm), "long"))
+ return INTEGER_PROMOTION_BADNESS; /* unsigned int -> unsigned long */
+ else
+ return INTEGER_COERCION_BADNESS; /* unsigned long -> unsigned int */
+ }
+ else
+ {
+ if (!strcmp_iw (TYPE_NAME (arg), "long") && !strcmp_iw (TYPE_NAME (parm), "int"))
+ return INTEGER_COERCION_BADNESS; /* signed long -> unsigned int */
+ else
+ return INTEGER_CONVERSION_BADNESS; /* signed int/long -> unsigned int/long */
+ }
+ }
+ else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
+ {
+ if (!strcmp_iw (TYPE_NAME (parm), TYPE_NAME (arg)))
+ return 0;
+ else if (!strcmp_iw (TYPE_NAME (arg), "int") && !strcmp_iw (TYPE_NAME (parm), "long"))
+ return INTEGER_PROMOTION_BADNESS;
+ else
+ return INTEGER_COERCION_BADNESS;
+ }
+ else
+ return INTEGER_COERCION_BADNESS;
+ }
+ else if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
+ return INTEGER_PROMOTION_BADNESS;
+ else
+ return INTEGER_COERCION_BADNESS;
+ case TYPE_CODE_ENUM:
+ case TYPE_CODE_CHAR:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_BOOL:
+ return INTEGER_PROMOTION_BADNESS;
+ case TYPE_CODE_FLT:
+ return INT_FLOAT_CONVERSION_BADNESS;
+ case TYPE_CODE_PTR:
+ return NS_POINTER_CONVERSION_BADNESS;
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_ENUM:
+ switch (TYPE_CODE (arg))
+ {
+ case TYPE_CODE_INT:
+ case TYPE_CODE_CHAR:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_BOOL:
+ case TYPE_CODE_ENUM:
+ return INTEGER_COERCION_BADNESS;
+ case TYPE_CODE_FLT:
+ return INT_FLOAT_CONVERSION_BADNESS;
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_CHAR:
+ switch (TYPE_CODE (arg))
+ {
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_BOOL:
+ case TYPE_CODE_ENUM:
+ return INTEGER_COERCION_BADNESS;
+ case TYPE_CODE_FLT:
+ return INT_FLOAT_CONVERSION_BADNESS;
+ case TYPE_CODE_INT:
+ if (TYPE_LENGTH (arg) > TYPE_LENGTH (parm))
+ return INTEGER_COERCION_BADNESS;
+ else if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
+ return INTEGER_PROMOTION_BADNESS;
+ /* >>> !! else fall through !! <<< */
+ case TYPE_CODE_CHAR:
+ /* Deal with signed, unsigned, and plain chars for C++
+ and with int cases falling through from previous case */
+ if (TYPE_NOSIGN (parm))
+ {
+ if (TYPE_NOSIGN (arg))
+ return 0;
+ else
+ return INTEGER_COERCION_BADNESS;
+ }
+ else if (TYPE_UNSIGNED (parm))
+ {
+ if (TYPE_UNSIGNED (arg))
+ return 0;
+ else
+ return INTEGER_PROMOTION_BADNESS;
+ }
+ else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
+ return 0;
+ else
+ return INTEGER_COERCION_BADNESS;
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_RANGE:
+ switch (TYPE_CODE (arg))
+ {
+ case TYPE_CODE_INT:
+ case TYPE_CODE_CHAR:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_BOOL:
+ case TYPE_CODE_ENUM:
+ return INTEGER_COERCION_BADNESS;
+ case TYPE_CODE_FLT:
+ return INT_FLOAT_CONVERSION_BADNESS;
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_BOOL:
+ switch (TYPE_CODE (arg))
+ {
+ case TYPE_CODE_INT:
+ case TYPE_CODE_CHAR:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_ENUM:
+ case TYPE_CODE_FLT:
+ case TYPE_CODE_PTR:
+ return BOOLEAN_CONVERSION_BADNESS;
+ case TYPE_CODE_BOOL:
+ return 0;
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_FLT:
+ switch (TYPE_CODE (arg))
+ {
+ case TYPE_CODE_FLT:
+ if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
+ return FLOAT_PROMOTION_BADNESS;
+ else if (TYPE_LENGTH (arg) == TYPE_LENGTH (parm))
+ return 0;
+ else
+ return FLOAT_CONVERSION_BADNESS;
+ case TYPE_CODE_INT:
+ case TYPE_CODE_BOOL:
+ case TYPE_CODE_ENUM:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_CHAR:
+ return INT_FLOAT_CONVERSION_BADNESS;
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_COMPLEX:
+ switch (TYPE_CODE (arg))
+ { /* Strictly not needed for C++, but... */
+ case TYPE_CODE_FLT:
+ return FLOAT_PROMOTION_BADNESS;
+ case TYPE_CODE_COMPLEX:
+ return 0;
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_STRUCT:
/* currently same as TYPE_CODE_CLASS */
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_STRUCT:
- /* Check for derivation */
- if (is_ancestor (parm, arg))
- return BASE_CONVERSION_BADNESS;
- /* else fall through */
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_UNION:
- switch (TYPE_CODE (arg))
- {
- case TYPE_CODE_UNION:
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_MEMBER:
- switch (TYPE_CODE (arg))
- {
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_METHOD:
- switch (TYPE_CODE (arg))
- {
-
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_REF:
- switch (TYPE_CODE (arg))
- {
-
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
-
- break;
- case TYPE_CODE_SET:
- switch (TYPE_CODE (arg))
- {
- /* Not in C++ */
- case TYPE_CODE_SET:
- return rank_one_type (TYPE_FIELD_TYPE (parm, 0), TYPE_FIELD_TYPE (arg, 0));
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- }
- break;
- case TYPE_CODE_VOID:
- default:
- return INCOMPATIBLE_TYPE_BADNESS;
- } /* switch (TYPE_CODE (arg)) */
-}
+ switch (TYPE_CODE (arg))
+ {
+ case TYPE_CODE_STRUCT:
+ /* Check for derivation */
+ if (is_ancestor (parm, arg))
+ return BASE_CONVERSION_BADNESS;
+ /* else fall through */
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_UNION:
+ switch (TYPE_CODE (arg))
+ {
+ case TYPE_CODE_UNION:
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_MEMBER:
+ switch (TYPE_CODE (arg))
+ {
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_METHOD:
+ switch (TYPE_CODE (arg))
+ {
+
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_REF:
+ switch (TYPE_CODE (arg))
+ {
-
-/* End of functions for overload resolution */
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_SET:
+ switch (TYPE_CODE (arg))
+ {
+ /* Not in C++ */
+ case TYPE_CODE_SET:
+ return rank_one_type (TYPE_FIELD_TYPE (parm, 0), TYPE_FIELD_TYPE (arg, 0));
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ }
+ break;
+ case TYPE_CODE_VOID:
+ default:
+ return INCOMPATIBLE_TYPE_BADNESS;
+ } /* switch (TYPE_CODE (arg)) */
+}
-#if MAINTENANCE_CMDS
+/* End of functions for overload resolution */
static void
print_bit_vector (bits, nbits)
while (*args != NULL)
{
recursive_dump_type (*args, spaces + 2);
- if ((*args++) -> code == TYPE_CODE_VOID)
+ if ((*args++)->code == TYPE_CODE_VOID)
{
break;
}
struct fn_field *f;
printfi_filtered (spaces, "fn_fieldlists ");
- gdb_print_address (TYPE_FN_FIELDLISTS (type), gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELDLISTS (type), gdb_stdout);
printf_filtered ("\n");
for (method_idx = 0; method_idx < TYPE_NFN_FIELDS (type); method_idx++)
{
printfi_filtered (spaces + 2, "[%d] name '%s' (",
method_idx,
TYPE_FN_FIELDLIST_NAME (type, method_idx));
- gdb_print_address (TYPE_FN_FIELDLIST_NAME (type, method_idx),
- gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELDLIST_NAME (type, method_idx),
+ gdb_stdout);
printf_filtered (") length %d\n",
TYPE_FN_FIELDLIST_LENGTH (type, method_idx));
for (overload_idx = 0;
printfi_filtered (spaces + 4, "[%d] physname '%s' (",
overload_idx,
TYPE_FN_FIELD_PHYSNAME (f, overload_idx));
- gdb_print_address (TYPE_FN_FIELD_PHYSNAME (f, overload_idx),
- gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELD_PHYSNAME (f, overload_idx),
+ gdb_stdout);
printf_filtered (")\n");
printfi_filtered (spaces + 8, "type ");
- gdb_print_address (TYPE_FN_FIELD_TYPE (f, overload_idx), gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELD_TYPE (f, overload_idx), gdb_stdout);
printf_filtered ("\n");
recursive_dump_type (TYPE_FN_FIELD_TYPE (f, overload_idx),
spaces + 8 + 2);
printfi_filtered (spaces + 8, "args ");
- gdb_print_address (TYPE_FN_FIELD_ARGS (f, overload_idx), gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELD_ARGS (f, overload_idx), gdb_stdout);
printf_filtered ("\n");
print_arg_types (TYPE_FN_FIELD_ARGS (f, overload_idx), spaces);
printfi_filtered (spaces + 8, "fcontext ");
- gdb_print_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
- gdb_stdout);
+ gdb_print_host_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
+ gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces + 8, "is_const %d\n",
{
printfi_filtered (spaces, "virtual_field_bits (%d bits at *",
TYPE_N_BASECLASSES (type));
- gdb_print_address (TYPE_FIELD_VIRTUAL_BITS (type), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELD_VIRTUAL_BITS (type), gdb_stdout);
printf_filtered (")");
print_bit_vector (TYPE_FIELD_VIRTUAL_BITS (type),
{
printfi_filtered (spaces, "private_field_bits (%d bits at *",
TYPE_NFIELDS (type));
- gdb_print_address (TYPE_FIELD_PRIVATE_BITS (type), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELD_PRIVATE_BITS (type), gdb_stdout);
printf_filtered (")");
print_bit_vector (TYPE_FIELD_PRIVATE_BITS (type),
TYPE_NFIELDS (type));
{
printfi_filtered (spaces, "protected_field_bits (%d bits at *",
TYPE_NFIELDS (type));
- gdb_print_address (TYPE_FIELD_PROTECTED_BITS (type), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELD_PROTECTED_BITS (type), gdb_stdout);
printf_filtered (")");
print_bit_vector (TYPE_FIELD_PROTECTED_BITS (type),
TYPE_NFIELDS (type));
|| (TYPE_CPLUS_SPECIFIC (type) && TYPE_NFN_FIELDS (type) > 0))
{
struct type **first_dont_print
- = (struct type **)obstack_base (&dont_print_type_obstack);
+ = (struct type **) obstack_base (&dont_print_type_obstack);
- int i = (struct type **)obstack_next_free (&dont_print_type_obstack)
- - first_dont_print;
+ int i = (struct type **) obstack_next_free (&dont_print_type_obstack)
+ - first_dont_print;
while (--i >= 0)
{
if (type == first_dont_print[i])
{
printfi_filtered (spaces, "type node ");
- gdb_print_address (type, gdb_stdout);
+ gdb_print_host_address (type, gdb_stdout);
printf_filtered (" <same as already seen type>\n");
return;
}
}
printfi_filtered (spaces, "type node ");
- gdb_print_address (type, gdb_stdout);
+ gdb_print_host_address (type, gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "name '%s' (",
TYPE_NAME (type) ? TYPE_NAME (type) : "<NULL>");
- gdb_print_address (TYPE_NAME (type), gdb_stdout);
+ gdb_print_host_address (TYPE_NAME (type), gdb_stdout);
printf_filtered (")\n");
if (TYPE_TAG_NAME (type) != NULL)
{
printfi_filtered (spaces, "tagname '%s' (",
TYPE_TAG_NAME (type));
- gdb_print_address (TYPE_TAG_NAME (type), gdb_stdout);
+ gdb_print_host_address (TYPE_TAG_NAME (type), gdb_stdout);
printf_filtered (")\n");
}
printfi_filtered (spaces, "code 0x%x ", TYPE_CODE (type));
switch (TYPE_CODE (type))
{
- case TYPE_CODE_UNDEF:
- printf_filtered ("(TYPE_CODE_UNDEF)");
- break;
- case TYPE_CODE_PTR:
- printf_filtered ("(TYPE_CODE_PTR)");
- break;
- case TYPE_CODE_ARRAY:
- printf_filtered ("(TYPE_CODE_ARRAY)");
- break;
- case TYPE_CODE_STRUCT:
- printf_filtered ("(TYPE_CODE_STRUCT)");
- break;
- case TYPE_CODE_UNION:
- printf_filtered ("(TYPE_CODE_UNION)");
- break;
- case TYPE_CODE_ENUM:
- printf_filtered ("(TYPE_CODE_ENUM)");
- break;
- case TYPE_CODE_FUNC:
- printf_filtered ("(TYPE_CODE_FUNC)");
- break;
- case TYPE_CODE_INT:
- printf_filtered ("(TYPE_CODE_INT)");
- break;
- case TYPE_CODE_FLT:
- printf_filtered ("(TYPE_CODE_FLT)");
- break;
- case TYPE_CODE_VOID:
- printf_filtered ("(TYPE_CODE_VOID)");
- break;
- case TYPE_CODE_SET:
- printf_filtered ("(TYPE_CODE_SET)");
- break;
- case TYPE_CODE_RANGE:
- printf_filtered ("(TYPE_CODE_RANGE)");
- break;
- case TYPE_CODE_STRING:
- printf_filtered ("(TYPE_CODE_STRING)");
- break;
- case TYPE_CODE_ERROR:
- printf_filtered ("(TYPE_CODE_ERROR)");
- break;
- case TYPE_CODE_MEMBER:
- printf_filtered ("(TYPE_CODE_MEMBER)");
- break;
- case TYPE_CODE_METHOD:
- printf_filtered ("(TYPE_CODE_METHOD)");
- break;
- case TYPE_CODE_REF:
- printf_filtered ("(TYPE_CODE_REF)");
- break;
- case TYPE_CODE_CHAR:
- printf_filtered ("(TYPE_CODE_CHAR)");
- break;
- case TYPE_CODE_BOOL:
- printf_filtered ("(TYPE_CODE_BOOL)");
- break;
- case TYPE_CODE_TYPEDEF:
- printf_filtered ("(TYPE_CODE_TYPEDEF)");
- break;
- default:
- printf_filtered ("(UNKNOWN TYPE CODE)");
- break;
+ case TYPE_CODE_UNDEF:
+ printf_filtered ("(TYPE_CODE_UNDEF)");
+ break;
+ case TYPE_CODE_PTR:
+ printf_filtered ("(TYPE_CODE_PTR)");
+ break;
+ case TYPE_CODE_ARRAY:
+ printf_filtered ("(TYPE_CODE_ARRAY)");
+ break;
+ case TYPE_CODE_STRUCT:
+ printf_filtered ("(TYPE_CODE_STRUCT)");
+ break;
+ case TYPE_CODE_UNION:
+ printf_filtered ("(TYPE_CODE_UNION)");
+ break;
+ case TYPE_CODE_ENUM:
+ printf_filtered ("(TYPE_CODE_ENUM)");
+ break;
+ case TYPE_CODE_FUNC:
+ printf_filtered ("(TYPE_CODE_FUNC)");
+ break;
+ case TYPE_CODE_INT:
+ printf_filtered ("(TYPE_CODE_INT)");
+ break;
+ case TYPE_CODE_FLT:
+ printf_filtered ("(TYPE_CODE_FLT)");
+ break;
+ case TYPE_CODE_VOID:
+ printf_filtered ("(TYPE_CODE_VOID)");
+ break;
+ case TYPE_CODE_SET:
+ printf_filtered ("(TYPE_CODE_SET)");
+ break;
+ case TYPE_CODE_RANGE:
+ printf_filtered ("(TYPE_CODE_RANGE)");
+ break;
+ case TYPE_CODE_STRING:
+ printf_filtered ("(TYPE_CODE_STRING)");
+ break;
+ case TYPE_CODE_ERROR:
+ printf_filtered ("(TYPE_CODE_ERROR)");
+ break;
+ case TYPE_CODE_MEMBER:
+ printf_filtered ("(TYPE_CODE_MEMBER)");
+ break;
+ case TYPE_CODE_METHOD:
+ printf_filtered ("(TYPE_CODE_METHOD)");
+ break;
+ case TYPE_CODE_REF:
+ printf_filtered ("(TYPE_CODE_REF)");
+ break;
+ case TYPE_CODE_CHAR:
+ printf_filtered ("(TYPE_CODE_CHAR)");
+ break;
+ case TYPE_CODE_BOOL:
+ printf_filtered ("(TYPE_CODE_BOOL)");
+ break;
+ case TYPE_CODE_TYPEDEF:
+ printf_filtered ("(TYPE_CODE_TYPEDEF)");
+ break;
+ default:
+ printf_filtered ("(UNKNOWN TYPE CODE)");
+ break;
}
puts_filtered ("\n");
printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
printfi_filtered (spaces, "objfile ");
- gdb_print_address (TYPE_OBJFILE (type), gdb_stdout);
+ gdb_print_host_address (TYPE_OBJFILE (type), gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "target_type ");
- gdb_print_address (TYPE_TARGET_TYPE (type), gdb_stdout);
+ gdb_print_host_address (TYPE_TARGET_TYPE (type), gdb_stdout);
printf_filtered ("\n");
if (TYPE_TARGET_TYPE (type) != NULL)
{
recursive_dump_type (TYPE_TARGET_TYPE (type), spaces + 2);
}
printfi_filtered (spaces, "pointer_type ");
- gdb_print_address (TYPE_POINTER_TYPE (type), gdb_stdout);
+ gdb_print_host_address (TYPE_POINTER_TYPE (type), gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "reference_type ");
- gdb_print_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
+ gdb_print_host_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "flags 0x%x", TYPE_FLAGS (type));
if (TYPE_FLAGS (type) & TYPE_FLAG_UNSIGNED)
}
puts_filtered ("\n");
printfi_filtered (spaces, "nfields %d ", TYPE_NFIELDS (type));
- gdb_print_address (TYPE_FIELDS (type), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELDS (type), gdb_stdout);
puts_filtered ("\n");
for (idx = 0; idx < TYPE_NFIELDS (type); idx++)
{
"[%d] bitpos %d bitsize %d type ",
idx, TYPE_FIELD_BITPOS (type, idx),
TYPE_FIELD_BITSIZE (type, idx));
- gdb_print_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout);
printf_filtered (" name '%s' (",
TYPE_FIELD_NAME (type, idx) != NULL
? TYPE_FIELD_NAME (type, idx)
: "<NULL>");
- gdb_print_address (TYPE_FIELD_NAME (type, idx), gdb_stdout);
+ gdb_print_host_address (TYPE_FIELD_NAME (type, idx), gdb_stdout);
printf_filtered (")\n");
if (TYPE_FIELD_TYPE (type, idx) != NULL)
{
}
}
printfi_filtered (spaces, "vptr_basetype ");
- gdb_print_address (TYPE_VPTR_BASETYPE (type), gdb_stdout);
+ gdb_print_host_address (TYPE_VPTR_BASETYPE (type), gdb_stdout);
puts_filtered ("\n");
if (TYPE_VPTR_BASETYPE (type) != NULL)
{
printfi_filtered (spaces, "vptr_fieldno %d\n", TYPE_VPTR_FIELDNO (type));
switch (TYPE_CODE (type))
{
- case TYPE_CODE_METHOD:
- case TYPE_CODE_FUNC:
- printfi_filtered (spaces, "arg_types ");
- gdb_print_address (TYPE_ARG_TYPES (type), gdb_stdout);
- puts_filtered ("\n");
- print_arg_types (TYPE_ARG_TYPES (type), spaces);
- break;
+ case TYPE_CODE_METHOD:
+ case TYPE_CODE_FUNC:
+ printfi_filtered (spaces, "arg_types ");
+ gdb_print_host_address (TYPE_ARG_TYPES (type), gdb_stdout);
+ puts_filtered ("\n");
+ print_arg_types (TYPE_ARG_TYPES (type), spaces);
+ break;
- case TYPE_CODE_STRUCT:
- printfi_filtered (spaces, "cplus_stuff ");
- gdb_print_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
- puts_filtered ("\n");
- print_cplus_stuff (type, spaces);
- break;
+ case TYPE_CODE_STRUCT:
+ printfi_filtered (spaces, "cplus_stuff ");
+ gdb_print_host_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
+ puts_filtered ("\n");
+ print_cplus_stuff (type, spaces);
+ break;
- default:
- /* 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 ");
- gdb_print_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
- if (TYPE_CPLUS_SPECIFIC (type) != NULL)
- {
- printf_filtered (" (unknown data form)");
- }
- printf_filtered ("\n");
- break;
+ default:
+ /* 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 ");
+ gdb_print_host_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
+ if (TYPE_CPLUS_SPECIFIC (type) != NULL)
+ {
+ printf_filtered (" (unknown data form)");
+ }
+ printf_filtered ("\n");
+ break;
}
if (spaces == 0)
obstack_free (&dont_print_type_obstack, NULL);
}
-#endif /* MAINTENANCE_CMDS */
-
-
static void build_gdbtypes PARAMS ((void));
static void
build_gdbtypes ()
0,
"char", (struct objfile *) NULL);
TYPE_FLAGS (builtin_type_char) |= TYPE_FLAG_NOSIGN;
-
+ builtin_type_true_char =
+ init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ 0,
+ "true character", (struct objfile *) NULL);
builtin_type_signed_char =
init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0,
init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
0,
"long long", (struct objfile *) NULL);
- builtin_type_unsigned_long_long =
+ builtin_type_unsigned_long_long =
init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED,
"unsigned long long", (struct objfile *) NULL);
0,
"bool", (struct objfile *) NULL);
- /* Add user knob for controlling resolution of opaque types */
+ /* Add user knob for controlling resolution of opaque types */
add_show_from_set
- (add_set_cmd ("opaque-type-resolution", class_support, var_boolean, (char *)&opaque_type_resolution,
+ (add_set_cmd ("opaque-type-resolution", class_support, var_boolean, (char *) &opaque_type_resolution,
"Set resolution of opaque struct/class/union types (if set before loading symbols).",
&setlist),
&showlist);
opaque_type_resolution = 1;
+
+ /* Build SIMD types. */
+ builtin_type_v4sf
+ = init_simd_type ("__builtin_v4sf", builtin_type_float, "f", 4);
+ builtin_type_v4si
+ = init_simd_type ("__builtin_v4si", builtin_type_int32, "f", 4);
+ builtin_type_v8qi
+ = init_simd_type ("__builtin_v8qi", builtin_type_int8, "f", 8);
+ builtin_type_v4hi
+ = init_simd_type ("__builtin_v4hi", builtin_type_int16, "f", 4);
+ builtin_type_v2si
+ = init_simd_type ("__builtin_v2si", builtin_type_int32, "f", 2);
+
+ /* Pointer/Address types. */
+ /* NOTE: At present there is no way of differentiating between at
+ target address and the target C language pointer type type even
+ though the two can be different (cf d10v) */
+ builtin_type_ptr =
+ init_type (TYPE_CODE_INT, TARGET_PTR_BIT / 8,
+ TYPE_FLAG_UNSIGNED,
+ "__ptr", (struct objfile *) NULL);
+ builtin_type_CORE_ADDR =
+ init_type (TYPE_CODE_INT, TARGET_PTR_BIT / 8,
+ TYPE_FLAG_UNSIGNED,
+ "__CORE_ADDR", (struct objfile *) NULL);
+ builtin_type_bfd_vma =
+ init_type (TYPE_CODE_INT, TARGET_BFD_VMA_BIT / 8,
+ TYPE_FLAG_UNSIGNED,
+ "__bfd_vma", (struct objfile *) NULL);
}
_initialize_gdbtypes ()
{
build_gdbtypes ();
+
+ /* FIXME - For the moment, handle types by swapping them in and out.
+ Should be using the per-architecture data-pointer and a large
+ struct. */
+ register_gdbarch_swap (&builtin_type_void, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_char, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_short, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_int, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_long, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_long_long, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_signed_char, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_unsigned_char, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_unsigned_short, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_unsigned_int, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_unsigned_long, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_unsigned_long_long, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_float, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_double, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_long_double, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_complex, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_double_complex, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_string, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_int8, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_uint8, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_int16, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_uint16, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_int32, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_uint32, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_int64, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_uint64, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v4sf, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v4si, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v8qi, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v4hi, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v2si, sizeof (struct type *), NULL);
+ REGISTER_GDBARCH_SWAP (builtin_type_ptr);
+ REGISTER_GDBARCH_SWAP (builtin_type_CORE_ADDR);
+ REGISTER_GDBARCH_SWAP (builtin_type_bfd_vma);
+ register_gdbarch_swap (NULL, 0, build_gdbtypes);
}
/* Internal type definitions for GDB.
- Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999
- Free Software Foundation, Inc.
+ Copyright (C) 1992-1994, 1996, 1998-2000 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
-This file is part of GDB.
+ This file is part of GDB.
-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
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ 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
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#if !defined (GDBTYPES_H)
#define GDBTYPES_H 1
#define FT_VOID 0
#define FT_BOOLEAN 1
-#define FT_CHAR 2 /* we use this for not-unsigned C/C++ chars */
-#define FT_SIGNED_CHAR 3 /* we use this for C++ signed chars */
-#define FT_UNSIGNED_CHAR 4 /* we use this for C/C++ unsigned chars */
+#define FT_CHAR 2 /* we use this for not-unsigned C/C++ chars */
+#define FT_SIGNED_CHAR 3 /* we use this for C++ signed chars */
+#define FT_UNSIGNED_CHAR 4 /* we use this for C/C++ unsigned chars */
#define FT_SHORT 5
#define FT_SIGNED_SHORT 6
#define FT_UNSIGNED_SHORT 7
/* Different kinds of data types are distinguished by the `code' field. */
enum type_code
-{
- TYPE_CODE_UNDEF, /* Not used; catches errors */
- TYPE_CODE_PTR, /* Pointer type */
- TYPE_CODE_ARRAY, /* Array type with lower & upper bounds. */
- TYPE_CODE_STRUCT, /* C struct or Pascal record */
- TYPE_CODE_UNION, /* C union or Pascal variant part */
- TYPE_CODE_ENUM, /* Enumeration type */
- TYPE_CODE_FUNC, /* Function type */
- TYPE_CODE_INT, /* Integer type */
-
- /* Floating type. This is *NOT* a complex type. Beware, there are parts
- of GDB which bogusly assume that TYPE_CODE_FLT can mean complex. */
- TYPE_CODE_FLT,
-
- /* Void type. The length field specifies the length (probably always
- one) which is used in pointer arithmetic involving pointers to
- this type, but actually dereferencing such a pointer is invalid;
- a void type has no length and no actual representation in memory
- or registers. A pointer to a void type is a generic pointer. */
- TYPE_CODE_VOID,
-
- TYPE_CODE_SET, /* Pascal sets */
- TYPE_CODE_RANGE, /* Range (integers within spec'd bounds) */
-
- /* A string type which is like an array of character but prints
- differently (at least for CHILL). It does not contain a length
- field as Pascal strings (for many Pascals, anyway) do; if we want
- to deal with such strings, we should use a new type code. */
- TYPE_CODE_STRING,
-
- /* String of bits; like TYPE_CODE_SET but prints differently (at least
- for CHILL). */
- TYPE_CODE_BITSTRING,
-
- /* Unknown type. The length field is valid if we were able to
- deduce that much about the type, or 0 if we don't even know that. */
- TYPE_CODE_ERROR,
-
- /* C++ */
- TYPE_CODE_MEMBER, /* Member type */
- TYPE_CODE_METHOD, /* Method type */
- TYPE_CODE_REF, /* C++ Reference types */
-
- TYPE_CODE_CHAR, /* *real* character type */
-
- /* Boolean type. 0 is false, 1 is true, and other values are non-boolean
- (e.g. FORTRAN "logical" used as unsigned int). */
- TYPE_CODE_BOOL,
-
- /* Fortran */
- TYPE_CODE_COMPLEX, /* Complex float */
-
- TYPE_CODE_TYPEDEF,
- TYPE_CODE_TEMPLATE, /* C++ template */
- TYPE_CODE_TEMPLATE_ARG /* C++ template arg */
-
-};
+ {
+ TYPE_CODE_UNDEF, /* Not used; catches errors */
+ TYPE_CODE_PTR, /* Pointer type */
+ TYPE_CODE_ARRAY, /* Array type with lower & upper bounds. */
+ TYPE_CODE_STRUCT, /* C struct or Pascal record */
+ TYPE_CODE_UNION, /* C union or Pascal variant part */
+ TYPE_CODE_ENUM, /* Enumeration type */
+ TYPE_CODE_FUNC, /* Function type */
+ TYPE_CODE_INT, /* Integer type */
+
+ /* Floating type. This is *NOT* a complex type. Beware, there are parts
+ of GDB which bogusly assume that TYPE_CODE_FLT can mean complex. */
+ TYPE_CODE_FLT,
+
+ /* Void type. The length field specifies the length (probably always
+ one) which is used in pointer arithmetic involving pointers to
+ this type, but actually dereferencing such a pointer is invalid;
+ a void type has no length and no actual representation in memory
+ or registers. A pointer to a void type is a generic pointer. */
+ TYPE_CODE_VOID,
+
+ TYPE_CODE_SET, /* Pascal sets */
+ TYPE_CODE_RANGE, /* Range (integers within spec'd bounds) */
+
+ /* A string type which is like an array of character but prints
+ differently (at least for CHILL). It does not contain a length
+ field as Pascal strings (for many Pascals, anyway) do; if we want
+ to deal with such strings, we should use a new type code. */
+ TYPE_CODE_STRING,
+
+ /* String of bits; like TYPE_CODE_SET but prints differently (at least
+ for CHILL). */
+ TYPE_CODE_BITSTRING,
+
+ /* Unknown type. The length field is valid if we were able to
+ deduce that much about the type, or 0 if we don't even know that. */
+ TYPE_CODE_ERROR,
+
+ /* C++ */
+ TYPE_CODE_MEMBER, /* Member type */
+ TYPE_CODE_METHOD, /* Method type */
+ TYPE_CODE_REF, /* C++ Reference types */
+
+ TYPE_CODE_CHAR, /* *real* character type */
+
+ /* Boolean type. 0 is false, 1 is true, and other values are non-boolean
+ (e.g. FORTRAN "logical" used as unsigned int). */
+ TYPE_CODE_BOOL,
+
+ /* Fortran */
+ TYPE_CODE_COMPLEX, /* Complex float */
+
+ TYPE_CODE_TYPEDEF,
+ TYPE_CODE_TEMPLATE, /* C++ template */
+ TYPE_CODE_TEMPLATE_ARG /* C++ template arg */
+
+ };
/* For now allow source to use TYPE_CODE_CLASS for C++ classes, as an
alias for TYPE_CODE_STRUCT. This is for DWARF, which has a distinct
#define TYPE_FLAG_TARGET_STUB (1 << 3)
-/* Static type. If this is set, the corresponding type had
+/* Static type. If this is set, the corresponding type had
* a static modifier.
* Note: This may be unnecessary, since static data members
* are indicated by other means (bitpos == -1)
/* This flag is used to indicate that processing for this type
is incomplete.
-
+
(Mostly intended for HP platforms, where class methods, for
instance, can be encountered before their classes in the debug
info; the incomplete type has to be marked so that the class and
struct type
-{
+ {
- /* Code for kind of type */
+ /* Code for kind of type */
- enum type_code code;
+ enum type_code code;
- /* Name of this type, or NULL if none.
+ /* Name of this type, or NULL if none.
- This is used for printing only, except by poorly designed C++ code.
- For looking up a name, look for a symbol in the VAR_NAMESPACE. */
+ This is used for printing only, except by poorly designed C++ code.
+ For looking up a name, look for a symbol in the VAR_NAMESPACE. */
- char *name;
+ char *name;
- /* Tag name for this type, or NULL if none. This means that the
- name of the type consists of a keyword followed by the tag name.
- Which keyword is determined by the type code ("struct" for
- TYPE_CODE_STRUCT, etc.). As far as I know C/C++ are the only languages
- with this feature.
+ /* Tag name for this type, or NULL if none. This means that the
+ name of the type consists of a keyword followed by the tag name.
+ Which keyword is determined by the type code ("struct" for
+ TYPE_CODE_STRUCT, etc.). As far as I know C/C++ are the only languages
+ with this feature.
- This is used for printing only, except by poorly designed C++ code.
- For looking up a name, look for a symbol in the STRUCT_NAMESPACE.
- One more legitimate use is that if TYPE_FLAG_STUB is set, this is
- the name to use to look for definitions in other files. */
+ This is used for printing only, except by poorly designed C++ code.
+ For looking up a name, look for a symbol in the STRUCT_NAMESPACE.
+ One more legitimate use is that if TYPE_FLAG_STUB is set, this is
+ the name to use to look for definitions in other files. */
- char *tag_name;
+ char *tag_name;
- /* Length of storage for a value of this type. Various places pass
- this to memcpy and such, meaning it must be in units of
- HOST_CHAR_BIT. Various other places expect they can calculate
- addresses by adding it and such, meaning it must be in units of
- TARGET_CHAR_BIT. For some DSP targets, in which HOST_CHAR_BIT
- will (presumably) be 8 and TARGET_CHAR_BIT will be (say) 32, this
- is a problem. One fix would be to make this field in bits
- (requiring that it always be a multiple of HOST_CHAR_BIT and
- TARGET_CHAR_BIT)--the other choice would be to make it
- consistently in units of HOST_CHAR_BIT. */
+ /* Length of storage for a value of this type. Various places pass
+ this to memcpy and such, meaning it must be in units of
+ HOST_CHAR_BIT. Various other places expect they can calculate
+ addresses by adding it and such, meaning it must be in units of
+ TARGET_CHAR_BIT. For some DSP targets, in which HOST_CHAR_BIT
+ will (presumably) be 8 and TARGET_CHAR_BIT will be (say) 32, this
+ is a problem. One fix would be to make this field in bits
+ (requiring that it always be a multiple of HOST_CHAR_BIT and
+ TARGET_CHAR_BIT)--the other choice would be to make it
+ consistently in units of HOST_CHAR_BIT. */
- unsigned length;
+ unsigned length;
- /* FIXME, these should probably be restricted to a Fortran-specific
- field in some fashion. */
+ /* FIXME, these should probably be restricted to a Fortran-specific
+ field in some fashion. */
#define BOUND_CANNOT_BE_DETERMINED 5
#define BOUND_BY_REF_ON_STACK 4
#define BOUND_BY_VALUE_ON_STACK 3
#define BOUND_BY_REF_IN_REG 2
#define BOUND_BY_VALUE_IN_REG 1
#define BOUND_SIMPLE 0
- int upper_bound_type;
- int lower_bound_type;
+ int upper_bound_type;
+ int lower_bound_type;
- /* Every type is now associated with a particular objfile, and the
- type is allocated on the type_obstack for that objfile. One problem
- however, is that there are times when gdb allocates new types while
- it is not in the process of reading symbols from a particular objfile.
- Fortunately, these happen when the type being created is a derived
- type of an existing type, such as in lookup_pointer_type(). So
- we can just allocate the new type using the same objfile as the
- existing type, but to do this we need a backpointer to the objfile
- from the existing type. Yes this is somewhat ugly, but without
- major overhaul of the internal type system, it can't be avoided
- for now. */
+ /* Every type is now associated with a particular objfile, and the
+ type is allocated on the type_obstack for that objfile. One problem
+ however, is that there are times when gdb allocates new types while
+ it is not in the process of reading symbols from a particular objfile.
+ Fortunately, these happen when the type being created is a derived
+ type of an existing type, such as in lookup_pointer_type(). So
+ we can just allocate the new type using the same objfile as the
+ existing type, but to do this we need a backpointer to the objfile
+ from the existing type. Yes this is somewhat ugly, but without
+ major overhaul of the internal type system, it can't be avoided
+ for now. */
- struct objfile *objfile;
+ struct objfile *objfile;
- /* For a pointer type, describes the type of object pointed to.
- For an array type, describes the type of the elements.
- For a function or method type, describes the type of the return value.
- For a range type, describes the type of the full range.
- For a complex type, describes the type of each coordinate.
- Unused otherwise. */
+ /* For a pointer type, describes the type of object pointed to.
+ For an array type, describes the type of the elements.
+ For a function or method type, describes the type of the return value.
+ For a range type, describes the type of the full range.
+ For a complex type, describes the type of each coordinate.
+ Unused otherwise. */
- struct type *target_type;
+ struct type *target_type;
- /* Type that is a pointer to this type.
- NULL if no such pointer-to type is known yet.
- The debugger may add the address of such a type
- if it has to construct one later. */
+ /* Type that is a pointer to this type.
+ NULL if no such pointer-to type is known yet.
+ The debugger may add the address of such a type
+ if it has to construct one later. */
- struct type *pointer_type;
+ struct type *pointer_type;
- /* C++: also need a reference type. */
+ /* C++: also need a reference type. */
- struct type *reference_type;
+ struct type *reference_type;
- /* C-v variant chain. This points to a type that
- differs from this one only in a const or volatile
- attribute (or both). The various c-v variants
- are chained together in a ring. */
- struct type *cv_type;
+ /* C-v variant chain. This points to a type that
+ differs from this one only in a const or volatile
+ attribute (or both). The various c-v variants
+ are chained together in a ring. */
+ struct type *cv_type;
- /* Flags about this type. */
+ /* Flags about this type. */
- int flags;
+ int flags;
- /* Number of fields described for this type */
+ /* Number of fields described for this type */
- short nfields;
+ short nfields;
- /* For structure and union types, a description of each field.
- For set and pascal array types, there is one "field",
- whose type is the domain type of the set or array.
- For range types, there are two "fields",
- the minimum and maximum values (both inclusive).
- For enum types, each possible value is described by one "field".
- For a function type, a "field" for each parameter type.
- For C++ classes, there is one field for each base class (if it is
- a derived class) plus one field for each class data member. Member
- functions are recorded elsewhere.
+ /* For structure and union types, a description of each field.
+ For set and pascal array types, there is one "field",
+ whose type is the domain type of the set or array.
+ For range types, there are two "fields",
+ the minimum and maximum values (both inclusive).
+ For enum types, each possible value is described by one "field".
+ For a function type, a "field" for each parameter type.
+ For C++ classes, there is one field for each base class (if it is
+ a derived class) plus one field for each class data member. Member
+ functions are recorded elsewhere.
- Using a pointer to a separate array of fields
- allows all types to have the same size, which is useful
- because we can allocate the space for a type before
- we know what to put in it. */
+ Using a pointer to a separate array of fields
+ allows all types to have the same size, which is useful
+ because we can allocate the space for a type before
+ we know what to put in it. */
- struct field
- {
+ struct field
+ {
- union field_location
- {
- /* Position of this field, counting in bits from start of
- containing structure.
- For BITS_BIG_ENDIAN=1 targets, it is the bit offset to the MSB.
- For BITS_BIG_ENDIAN=0 targets, it is the bit offset to the LSB.
- For a function type, this is the position in the argument list
- of this argument.
- For a range bound or enum value, this is the value itself. */
+ union field_location
+ {
+ /* Position of this field, counting in bits from start of
+ containing structure.
+ For BITS_BIG_ENDIAN=1 targets, it is the bit offset to the MSB.
+ For BITS_BIG_ENDIAN=0 targets, it is the bit offset to the LSB.
+ For a function type, this is the position in the argument list
+ of this argument.
+ For a range bound or enum value, this is the value itself. */
- int bitpos;
+ int bitpos;
- /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr
- is the location (in the target) of the static field.
- Otherwise, physname is the mangled label of the static field. */
+ /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr
+ is the location (in the target) of the static field.
+ Otherwise, physname is the mangled label of the static field. */
- CORE_ADDR physaddr;
- char* physname;
- } loc;
+ CORE_ADDR physaddr;
+ char *physname;
+ }
+ loc;
- /* 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.
- A value of -1 or -2 indicates a static field; -1 means the location
- is specified by the label loc.physname; -2 means that loc.physaddr
- specifies the actual address. */
+ /* 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.
+ A value of -1 or -2 indicates a static field; -1 means the location
+ is specified by the label loc.physname; -2 means that loc.physaddr
+ specifies the actual address. */
- int bitsize;
+ int bitsize;
- /* In a struct or union type, type of this field.
- In a function type, type of this argument.
- In an array type, the domain-type of the array. */
+ /* In a struct or union type, type of this field.
+ In a function type, type of this argument.
+ In an array type, the domain-type of the array. */
- struct type *type;
+ struct type *type;
- /* Name of field, value or argument.
- NULL for range bounds and array domains. */
+ /* Name of field, value or argument.
+ NULL for range bounds and array domains. */
- char *name;
+ char *name;
- } *fields;
+ }
+ *fields;
- /* For types with virtual functions (TYPE_CODE_STRUCT), VPTR_BASETYPE
- is the base class which defined the virtual function table pointer.
+ /* For types with virtual functions (TYPE_CODE_STRUCT), VPTR_BASETYPE
+ is the base class which defined the virtual function table pointer.
- For types that are pointer to member types (TYPE_CODE_MEMBER),
- VPTR_BASETYPE is the type that this pointer is a member of.
+ For types that are pointer to member types (TYPE_CODE_MEMBER),
+ VPTR_BASETYPE is the type that this pointer is a member of.
- For method types (TYPE_CODE_METHOD), VPTR_BASETYPE is the aggregate
- type that contains the method.
+ For method types (TYPE_CODE_METHOD), VPTR_BASETYPE is the aggregate
+ type that contains the method.
- Unused otherwise. */
+ Unused otherwise. */
- struct type *vptr_basetype;
+ struct type *vptr_basetype;
- /* Field number of the virtual function table pointer in
- VPTR_BASETYPE. If -1, we were unable to find the virtual
- function table pointer in initial symbol reading, and
- fill_in_vptr_fieldno should be called to find it if possible.
+ /* Field number of the virtual function table pointer in
+ VPTR_BASETYPE. If -1, we were unable to find the virtual
+ function table pointer in initial symbol reading, and
+ fill_in_vptr_fieldno should be called to find it if possible.
- Unused if this type does not have virtual functions. */
+ Unused if this type does not have virtual functions. */
- int vptr_fieldno;
+ int vptr_fieldno;
- /* Slot to point to additional language-specific fields of this type. */
+ /* Slot to point to additional language-specific fields of this type. */
- union type_specific
- {
+ union type_specific
+ {
- /* ARG_TYPES is for TYPE_CODE_METHOD.
- Contains the type of each argument, ending with a void type
- after the last argument for normal member functions or a NULL
- pointer after the last argument for functions with variable
- arguments. */
+ /* ARG_TYPES is for TYPE_CODE_METHOD.
+ Contains the type of each argument, ending with a void type
+ after the last argument for normal member functions or a NULL
+ pointer after the last argument for functions with variable
+ arguments. */
- struct type **arg_types;
+ struct type **arg_types;
- /* CPLUS_STUFF is for TYPE_CODE_STRUCT. It is initialized to point to
- cplus_struct_default, a default static instance of a struct
- cplus_struct_type. */
+ /* CPLUS_STUFF is for TYPE_CODE_STRUCT. It is initialized to point to
+ cplus_struct_default, a default static instance of a struct
+ cplus_struct_type. */
- struct cplus_struct_type *cplus_stuff;
+ struct cplus_struct_type *cplus_stuff;
- } type_specific;
-};
+ }
+ type_specific;
+ };
#define NULL_TYPE ((struct type *) 0)
nodes. */
struct cplus_struct_type
-{
- /* Number of base classes this type derives from. The baseclasses are
- stored in the first N_BASECLASSES fields (i.e. the `fields' field of
- the struct type). I think only the `type' field of such a field has
- any meaning. */
+ {
+ /* Number of base classes this type derives from. The baseclasses are
+ stored in the first N_BASECLASSES fields (i.e. the `fields' field of
+ the struct type). I think only the `type' field of such a field has
+ any meaning. */
- short n_baseclasses;
+ short n_baseclasses;
- /* Number of methods with unique names. All overloaded methods with
- the same name count only once. */
+ /* Number of methods with unique names. All overloaded methods with
+ the same name count only once. */
- short nfn_fields;
+ short nfn_fields;
- /* Number of methods described for this type, not including the
- methods that it derives from. */
+ /* Number of methods described for this type, not including the
+ methods that it derives from. */
- short nfn_fields_total;
+ short nfn_fields_total;
- /* The "declared_type" field contains a code saying how the
- user really declared this type, e.g., "class s", "union s",
- "struct s".
- The 3 above things come out from the C++ compiler looking like classes,
- but we keep track of the real declaration so we can give
- the correct information on "ptype". (Note: TEMPLATE may not
- belong in this list...) */
+ /* The "declared_type" field contains a code saying how the
+ user really declared this type, e.g., "class s", "union s",
+ "struct s".
+ The 3 above things come out from the C++ compiler looking like classes,
+ but we keep track of the real declaration so we can give
+ the correct information on "ptype". (Note: TEMPLATE may not
+ belong in this list...) */
#define DECLARED_TYPE_CLASS 0
#define DECLARED_TYPE_UNION 1
#define DECLARED_TYPE_STRUCT 2
#define DECLARED_TYPE_TEMPLATE 3
- short declared_type; /* One of the above codes */
-
- /* For derived classes, the number of base classes is given by n_baseclasses
- and virtual_field_bits is a bit vector containing one bit per base class.
- If the base class is virtual, the corresponding bit will be set.
- I.E, given:
+ short declared_type; /* One of the above codes */
+
+ /* For derived classes, the number of base classes is given by n_baseclasses
+ and virtual_field_bits is a bit vector containing one bit per base class.
+ If the base class is virtual, the corresponding bit will be set.
+ I.E, given:
- class A{};
- class B{};
- class C : public B, public virtual A {};
+ class A{};
+ class B{};
+ class C : public B, public virtual A {};
- B is a baseclass of C; A is a virtual baseclass for C.
- This is a C++ 2.0 language feature. */
+ B is a baseclass of C; A is a virtual baseclass for C.
+ This is a C++ 2.0 language feature. */
- B_TYPE *virtual_field_bits;
+ B_TYPE *virtual_field_bits;
- /* For classes with private fields, the number of fields is given by
- nfields and private_field_bits is a bit vector containing one bit
- per field.
- If the field is private, the corresponding bit will be set. */
+ /* For classes with private fields, the number of fields is given by
+ nfields and private_field_bits is a bit vector containing one bit
+ per field.
+ If the field is private, the corresponding bit will be set. */
- B_TYPE *private_field_bits;
+ B_TYPE *private_field_bits;
- /* For classes with protected fields, the number of fields is given by
- nfields and protected_field_bits is a bit vector containing one bit
- per field.
- If the field is private, the corresponding bit will be set. */
+ /* For classes with protected fields, the number of fields is given by
+ nfields and protected_field_bits is a bit vector containing one bit
+ per field.
+ If the field is private, the corresponding bit will be set. */
- B_TYPE *protected_field_bits;
+ B_TYPE *protected_field_bits;
- /* for classes with fields to be ignored, either this is optimized out
- or this field has length 0 */
+ /* for classes with fields to be ignored, either this is optimized out
+ or this field has length 0 */
- B_TYPE *ignore_field_bits;
+ B_TYPE *ignore_field_bits;
- /* For classes, structures, and unions, a description of each field,
- which consists of an overloaded name, followed by the types of
- arguments that the method expects, and then the name after it
- has been renamed to make it distinct.
+ /* For classes, structures, and unions, a description of each field,
+ which consists of an overloaded name, followed by the types of
+ arguments that the method expects, and then the name after it
+ has been renamed to make it distinct.
- fn_fieldlists points to an array of nfn_fields of these. */
+ fn_fieldlists points to an array of nfn_fields of these. */
- struct fn_fieldlist
- {
+ struct fn_fieldlist
+ {
- /* The overloaded name. */
+ /* The overloaded name. */
- char *name;
+ char *name;
- /* The number of methods with this name. */
+ /* The number of methods with this name. */
- int length;
+ int length;
- /* The list of methods. */
+ /* The list of methods. */
- struct fn_field
- {
+ struct fn_field
+ {
- /* If is_stub is clear, this is the mangled name which we can
- look up to find the address of the method (FIXME: it would
- be cleaner to have a pointer to the struct symbol here
- instead). */
+ /* If is_stub is clear, this is the mangled name which we can
+ look up to find the address of the method (FIXME: it would
+ be cleaner to have a pointer to the struct symbol here
+ instead). */
- /* If is_stub is set, this is the portion of the mangled
- name which specifies the arguments. For example, "ii",
- if there are two int arguments, or "" if there are no
- arguments. See gdb_mangle_name for the conversion from this
- format to the one used if is_stub is clear. */
+ /* If is_stub is set, this is the portion of the mangled
+ name which specifies the arguments. For example, "ii",
+ if there are two int arguments, or "" if there are no
+ arguments. See gdb_mangle_name for the conversion from this
+ format to the one used if is_stub is clear. */
- char *physname;
+ char *physname;
- /* The function type for the method.
- (This comment used to say "The return value of the method",
- but that's wrong. The function type
- is expected here, i.e. something with TYPE_CODE_FUNC,
- and *not* the return-value type). */
+ /* The function type for the method.
+ (This comment used to say "The return value of the method",
+ but that's wrong. The function type
+ is expected here, i.e. something with TYPE_CODE_FUNC,
+ and *not* the return-value type). */
- struct type *type;
+ struct type *type;
- /* The argument list. Only valid if is_stub is clear. Contains
- the type of each argument, including `this', and ending with
- a NULL pointer after the last argument. Should not contain
- a `this' pointer for static member functions. */
+ /* The argument list. Only valid if is_stub is clear. Contains
+ the type of each argument, including `this', and ending with
+ a NULL pointer after the last argument. Should not contain
+ a `this' pointer for static member functions. */
- struct type **args;
+ struct type **args;
- /* For virtual functions.
- First baseclass that defines this virtual function. */
+ /* For virtual functions.
+ First baseclass that defines this virtual function. */
- struct type *fcontext;
+ struct type *fcontext;
- /* Attributes. */
+ /* Attributes. */
- unsigned int is_const : 1;
- unsigned int is_volatile : 1;
- unsigned int is_private : 1;
- unsigned int is_protected : 1;
- unsigned int is_public : 1;
- unsigned int is_abstract : 1;
- unsigned int is_static : 1;
- unsigned int is_final : 1;
- unsigned int is_synchronized : 1;
- unsigned int is_native : 1;
+ unsigned int is_const:1;
+ unsigned int is_volatile:1;
+ unsigned int is_private:1;
+ unsigned int is_protected:1;
+ unsigned int is_public:1;
+ unsigned int is_abstract:1;
+ unsigned int is_static:1;
+ unsigned int is_final:1;
+ unsigned int is_synchronized:1;
+ unsigned int is_native:1;
- /* A stub method only has some fields valid (but they are enough
- to reconstruct the rest of the fields). */
- unsigned int is_stub : 1;
+ /* A stub method only has some fields valid (but they are enough
+ to reconstruct the rest of the fields). */
+ unsigned int is_stub:1;
- /* C++ method that is inlined */
- unsigned int is_inlined : 1;
+ /* C++ method that is inlined */
+ unsigned int is_inlined:1;
- /* Unused. */
- unsigned int dummy : 4;
+ /* Unused. */
+ unsigned int dummy:4;
- /* Index into that baseclass's virtual function table,
- minus 2; else if static: VOFFSET_STATIC; else: 0. */
+ /* Index into that baseclass's virtual function table,
+ minus 2; else if static: VOFFSET_STATIC; else: 0. */
- unsigned int voffset : 16;
+ unsigned int voffset:16;
-# define VOFFSET_STATIC 1
+#define VOFFSET_STATIC 1
- } *fn_fields;
+ }
+ *fn_fields;
- } *fn_fieldlists;
+ }
+ *fn_fieldlists;
- /* If this "struct type" describes a template, then it
+ /* If this "struct type" describes a template, then it
* has arguments. "template_args" points to an array of
* template arg descriptors, of length "ntemplate_args".
* The only real information in each of these template arg descriptors
*/
short ntemplate_args;
struct template_arg
- {
- char *name;
- struct type *type;
- } *template_args;
+ {
+ char *name;
+ struct type *type;
+ }
+ *template_args;
/* If this "struct type" describes a template, it has a list
* of instantiations. "instantiations" is a pointer to an array
*
* Fields in structure pointed to:
* ->HAS_VTABLE : 0 => no virtual table, 1 => vtable present
- *
+ *
* ->PRIMARY_BASE points to the first non-virtual base class that has
* a virtual table.
*
* point to the type information for all virtual bases among this type's
* ancestors.
*/
- struct runtime_info {
- short has_vtable;
- struct type * primary_base;
- struct type ** virtual_base_list;
- } * runtime_ptr;
+ struct runtime_info
+ {
+ short has_vtable;
+ struct type *primary_base;
+ struct type **virtual_base_list;
+ }
+ *runtime_ptr;
/* Pointer to information about enclosing scope, if this is a
* local type. If it is not a local type, this is NULL
*/
- struct local_type_info {
- char * file;
- int line;
- } * localtype_ptr;
-};
+ struct local_type_info
+ {
+ char *file;
+ int line;
+ }
+ *localtype_ptr;
+ };
/* Struct used in computing virtual base list */
struct vbase
-{
- struct type * vbasetype; /* pointer to virtual base */
- struct vbase * next; /* next in chain */
-};
+ {
+ struct type *vbasetype; /* pointer to virtual base */
+ struct vbase *next; /* next in chain */
+ };
/* Struct used for ranking a function for overload resolution */
-struct badness_vector {
- int length;
- int * rank;
-};
+struct badness_vector
+ {
+ int length;
+ int *rank;
+ };
/* The default value of TYPE_CPLUS_SPECIFIC(T) points to the
this shared static structure. */
#define TYPE_HAS_VTABLE(thistype) (TYPE_RUNTIME_PTR(thistype) && TYPE_VTABLE(thistype))
#define TYPE_PRIMARY_BASE(thistype) (TYPE_RUNTIME_PTR(thistype)->primary_base)
#define TYPE_VIRTUAL_BASE_LIST(thistype) (TYPE_RUNTIME_PTR(thistype)->virtual_base_list)
-
+
#define TYPE_LOCALTYPE_PTR(thistype) (TYPE_CPLUS_SPECIFIC(thistype)->localtype_ptr)
#define TYPE_LOCALTYPE_FILE(thistype) (TYPE_CPLUS_SPECIFIC(thistype)->localtype_ptr->file)
#define TYPE_LOCALTYPE_LINE(thistype) (TYPE_CPLUS_SPECIFIC(thistype)->localtype_ptr->line)
-
+
#define TYPE_IS_OPAQUE(thistype) (((TYPE_CODE (thistype) == TYPE_CODE_STRUCT) || \
- (TYPE_CODE (thistype) == TYPE_CODE_UNION)) && \
- (TYPE_NFIELDS (thistype) == 0) && \
- (TYPE_CPLUS_SPECIFIC (thistype) && (TYPE_NFN_FIELDS (thistype) == 0)))
-
-
-
+ (TYPE_CODE (thistype) == TYPE_CODE_UNION)) && \
+ (TYPE_NFIELDS (thistype) == 0) && \
+ (TYPE_CPLUS_SPECIFIC (thistype) && (TYPE_NFN_FIELDS (thistype) == 0)))
+
+
+
/* Implicit sizes */
extern struct type *builtin_type_void;
extern struct type *builtin_type_char;
extern struct type *builtin_type_string;
extern struct type *builtin_type_bool;
-/* Explicit sizes - see <intypes.h> for naming schema */
+/* Address/pointer types: */
+/* (C) Language pointer type. Some target platforms use an implicitly
+ {sign,zero} -extended 32 bit C language pointer on a 64 bit ISA. */
+extern struct type *builtin_type_ptr;
+/* The target CPU's address type. This is the ISA address size. */
+extern struct type *builtin_type_CORE_ADDR;
+/* The symbol table address type. Some object file formats have a 32
+ bit address type even though the TARGET has a 64 bit pointer type
+ (cf MIPS). */
+extern struct type *builtin_type_bfd_vma;
+
+/* Explicit sizes - see C9X <intypes.h> for naming scheme */
extern struct type *builtin_type_int8;
extern struct type *builtin_type_uint8;
extern struct type *builtin_type_int16;
extern struct type *builtin_type_int64;
extern struct type *builtin_type_uint64;
+/* SIMD types. We inherit these names from GCC. */
+extern struct type *builtin_type_v4sf;
+extern struct type *builtin_type_v4si;
+extern struct type *builtin_type_v8qi;
+extern struct type *builtin_type_v4hi;
+extern struct type *builtin_type_v2si;
+
+/* We use this for the '/c' print format, because builtin_type_char is
+ just a one-byte integral type, which languages less laid back than
+ C will print as ... well, a one-byte integral type. */
+extern struct type *builtin_type_true_char;
+
/* This type represents a type that was unrecognized in symbol
read-in. */
extern struct type *builtin_type_f_logical;
extern struct type *builtin_type_f_logical_s1;
extern struct type *builtin_type_f_logical_s2;
-extern struct type *builtin_type_f_integer;
+extern struct type *builtin_type_f_integer;
extern struct type *builtin_type_f_integer_s2;
extern struct type *builtin_type_f_real;
extern struct type *builtin_type_f_real_s8;
extern struct type *builtin_type_f_void;
/* RTTI for C++ */
-/* extern struct type *builtin_type_cxx_typeinfo; */
+/* extern struct type *builtin_type_cxx_typeinfo; */
/* Maximum and minimum values of built-in types */
: xmalloc (size))
extern struct type *
-alloc_type PARAMS ((struct objfile *));
+ alloc_type PARAMS ((struct objfile *));
extern struct type *
-init_type PARAMS ((enum type_code, int, int, char *, struct objfile *));
+ init_type PARAMS ((enum type_code, int, int, char *, struct objfile *));
extern struct type *
-lookup_reference_type PARAMS ((struct type *));
+ lookup_reference_type PARAMS ((struct type *));
extern struct type *
-make_reference_type PARAMS ((struct type *, struct type **));
+ make_reference_type PARAMS ((struct type *, struct type **));
extern struct type *
-make_cv_type PARAMS ((int, int, struct type *, struct type **));
+ make_cv_type PARAMS ((int, int, struct type *, struct type **));
extern struct type *
-lookup_member_type PARAMS ((struct type *, struct type *));
+ lookup_member_type PARAMS ((struct type *, struct type *));
extern void
smash_to_method_type PARAMS ((struct type *, struct type *, struct type *,
smash_to_member_type PARAMS ((struct type *, struct type *, struct type *));
extern struct type *
-allocate_stub_method PARAMS ((struct type *));
+ allocate_stub_method PARAMS ((struct type *));
extern char *
-type_name_no_tag PARAMS ((const struct type *));
+ type_name_no_tag PARAMS ((const struct type *));
extern struct type *
-lookup_struct_elt_type PARAMS ((struct type *, char *, int));
+ lookup_struct_elt_type PARAMS ((struct type *, char *, int));
extern struct type *
-make_pointer_type PARAMS ((struct type *, struct type **));
+ make_pointer_type PARAMS ((struct type *, struct type **));
extern struct type *
-lookup_pointer_type PARAMS ((struct type *));
+ lookup_pointer_type PARAMS ((struct type *));
extern struct type *
-make_function_type PARAMS ((struct type *, struct type **));
+ make_function_type PARAMS ((struct type *, struct type **));
extern struct type *
-lookup_function_type PARAMS ((struct type *));
+ lookup_function_type PARAMS ((struct type *));
extern struct type *
-create_range_type PARAMS ((struct type *, struct type *, int, int));
+ create_range_type PARAMS ((struct type *, struct type *, int, int));
extern struct type *
-create_array_type PARAMS ((struct type *, struct type *, struct type *));
+ create_array_type PARAMS ((struct type *, struct type *, struct type *));
extern struct type *
-create_string_type PARAMS ((struct type *, struct type *));
+ create_string_type PARAMS ((struct type *, struct type *));
extern struct type *create_set_type PARAMS ((struct type *, struct type *));
-extern int chill_varying_type PARAMS ((struct type*));
+extern int chill_varying_type PARAMS ((struct type *));
extern struct type *
-lookup_unsigned_typename PARAMS ((char *));
+ lookup_unsigned_typename PARAMS ((char *));
extern struct type *
-lookup_signed_typename PARAMS ((char *));
+ lookup_signed_typename PARAMS ((char *));
extern struct type *
-check_typedef PARAMS ((struct type *));
+ check_typedef PARAMS ((struct type *));
#define CHECK_TYPEDEF(TYPE) (TYPE) = check_typedef (TYPE)
check_stub_method PARAMS ((struct type *, int, int));
extern struct type *
-lookup_primitive_typename PARAMS ((char *));
+ lookup_primitive_typename PARAMS ((char *));
extern char *
-gdb_mangle_name PARAMS ((struct type *, int, int));
+ gdb_mangle_name PARAMS ((struct type *, int, int));
extern struct type *
-builtin_type PARAMS ((char **));
+ builtin_type PARAMS ((char **));
extern struct type *
-lookup_typename PARAMS ((char *, struct block *, int));
+ lookup_typename PARAMS ((char *, struct block *, int));
extern struct type *
-lookup_template_type PARAMS ((char *, struct type *, struct block *));
+ lookup_template_type PARAMS ((char *, struct type *, struct block *));
extern struct type *
-lookup_fundamental_type PARAMS ((struct objfile *, int));
+ lookup_fundamental_type PARAMS ((struct objfile *, int));
extern void
fill_in_vptr_fieldno PARAMS ((struct type *));
extern int get_destructor_fn_field PARAMS ((struct type *, int *, int *));
-extern int get_discrete_bounds PARAMS ((struct type*, LONGEST*, LONGEST*));
+extern int get_discrete_bounds PARAMS ((struct type *, LONGEST *, LONGEST *));
extern int
is_ancestor PARAMS ((struct type *, struct type *));
has_vtable PARAMS ((struct type *));
extern struct type *
-primary_base_class PARAMS ((struct type *));
+ primary_base_class PARAMS ((struct type *));
extern struct type **
-virtual_base_list PARAMS ((struct type *));
+ virtual_base_list PARAMS ((struct type *));
extern int
virtual_base_list_length PARAMS ((struct type *));
class_index_in_primary_list PARAMS ((struct type *));
extern int
-count_virtual_fns PARAMS ((struct type*));
+count_virtual_fns PARAMS ((struct type *));
/* Constants for HP/Taligent ANSI C++ runtime model */
* typeinfo pointer, and dup base info pointer */
#define HP_ACC_VFUNC_START 4
-/* (Negative) Offset where virtual base offset entries begin
+/* (Negative) Offset where virtual base offset entries begin
* in the virtual table. Skips over metavtable pointer and
- * the self-offset entry.
+ * the self-offset entry.
* NOTE: NEGATE THIS BEFORE USING! The virtual base offsets
* appear before the address point of the vtable (the slot
* pointed to by the object's vtable pointer), i.e. at lower
#define LENGTH_MATCH(bv) ((bv)->rank[0])
-/* Badness if parameter list length doesn't match arg list length */
+/* Badness if parameter list length doesn't match arg list length */
#define LENGTH_MISMATCH_BADNESS 100
-/* Dummy badness value for nonexistent parameter positions */
+/* Dummy badness value for nonexistent parameter positions */
#define TOO_FEW_PARAMS_BADNESS 100
/* Badness if no conversion among types */
#define INCOMPATIBLE_TYPE_BADNESS 100
#define POINTER_CONVERSION_BADNESS 2
/* Badness of conversion of pointer to void pointer */
#define VOID_PTR_CONVERSION_BADNESS 2
-/* Badness of convering derived to base class */
+/* Badness of converting derived to base class */
#define BASE_CONVERSION_BADNESS 2
-
+/* Badness of converting from non-reference to reference*/
+#define REFERENCE_CONVERSION_BADNESS 2
/* Non-standard conversions allowed by the debugger */
/* Converting a pointer to an int is usually OK */
#define NS_POINTER_CONVERSION_BADNESS 10
compare_badness PARAMS ((struct badness_vector *, struct badness_vector *));
extern struct badness_vector *
-rank_function PARAMS ((struct type **, int, struct type **, int));
+ rank_function PARAMS ((struct type **, int, struct type **, int));
extern int
rank_one_type PARAMS ((struct type *, struct type *));
-
-#if MAINTENANCE_CMDS
extern void recursive_dump_type PARAMS ((struct type *, int));
-#endif
/* printcmd.c */
-extern void
-print_scalar_formatted PARAMS ((char *, struct type *, int, int, GDB_FILE *));
+extern void print_scalar_formatted (char *, struct type *, int, int,
+ struct ui_file *);
extern int can_dereference PARAMS ((struct type *));
-#if MAINTENANCE_CMDS
+extern int is_integral_type PARAMS ((struct type *));
+
extern void maintenance_print_type PARAMS ((char *, int));
-#endif
/* typeprint.c */
-extern void print_type_scalar PARAMS ((struct type *, LONGEST, GDB_FILE *));
+extern void print_type_scalar (struct type *, LONGEST, struct ui_file *);
-#endif /* GDBTYPES_H */
+#endif /* GDBTYPES_H */
&& TYPE_NAME (type) != 0)
{
/* Look in the type of the source to see if it contains the
- type of the target as a superclass. If so, we'll need to
- offset the object in addition to changing its type. */
+ type of the target as a superclass. If so, we'll need to
+ offset the object in addition to changing its type. */
value_ptr v = search_struct_field (type_name_no_tag (type),
arg2, 0, type2, 1);
if (v)
value_ptr v;
/* Look in the type of the source to see if it contains the
- type of the target as a superclass. If so, we'll need to
- offset the pointer rather than just change its type. */
+ type of the target as a superclass. If so, we'll need to
+ offset the pointer rather than just change its type. */
if (TYPE_NAME (t1) != NULL)
{
v = search_struct_field (type_name_no_tag (t1),
}
/* Look in the type of the target to see if it contains the
- type of the source as a superclass. If so, we'll need to
- offset the pointer rather than just change its type.
- FIXME: This fails silently with virtual inheritance. */
+ type of the source as a superclass. If so, we'll need to
+ offset the pointer rather than just change its type.
+ FIXME: This fails silently with virtual inheritance. */
if (TYPE_NAME (t2) != NULL)
{
v = search_struct_field (type_name_no_tag (t2),
return val;
}
-/* Return a value with type TYPE located at ADDR.
+/* Return a value with type TYPE located at ADDR.
Call value_at only if the data needs to be fetched immediately;
if we can be 'lazy' and defer the fetch, perhaps indefinately, call
value_at_lazy instead. value_at_lazy simply records the address of
- the data and sets the lazy-evaluation-required flag. The lazy flag
- is tested in the VALUE_CONTENTS macro, which is used if and when
- the contents are actually required.
+ the data and sets the lazy-evaluation-required flag. The lazy flag
+ is tested in the VALUE_CONTENTS macro, which is used if and when
+ the contents are actually required.
Note: value_at does *NOT* handle embedded offsets; perform such
adjustments before or after calling it. */
return val;
}
-/* Called only from the VALUE_CONTENTS and VALUE_CONTENTS_ALL macros,
- if the current data for a variable needs to be loaded into
- VALUE_CONTENTS(VAL). Fetches the data from the user's process, and
+/* Called only from the VALUE_CONTENTS and VALUE_CONTENTS_ALL macros,
+ if the current data for a variable needs to be loaded into
+ VALUE_CONTENTS(VAL). Fetches the data from the user's process, and
clears the lazy flag to indicate that the data in the buffer is valid.
If the value is zero-length, we avoid calling read_memory, which would
#endif
}
/* Assigning to the stack pointer, frame pointer, and other
- (architecture and calling convention specific) registers may
- cause the frame cache to be out of date. We just do this
- on all assignments to registers for simplicity; I doubt the slowdown
- matters. */
+ (architecture and calling convention specific) registers may
+ cause the frame cache to be out of date. We just do this
+ on all assignments to registers for simplicity; I doubt the slowdown
+ matters. */
reinit_frame_cache ();
break;
if (TYPE_CODE (type) == TYPE_CODE_REF)
{
/* Copy the value, but change the type from (T&) to (T*).
- We keep the same location information, which is efficient,
- and allows &(&X) to get the location containing the reference. */
+ We keep the same location information, which is efficient,
+ and allows &(&X) to get the location containing the reference. */
arg2 = value_copy (arg1);
VALUE_TYPE (arg2) = lookup_pointer_type (TYPE_TARGET_TYPE (type));
return arg2;
#ifndef COERCE_FLOAT_TO_DOUBLE
#define COERCE_FLOAT_TO_DOUBLE(formal, actual) \
(default_coerce_float_to_double ((formal), (actual)))
-#endif
+#endif
/* A default function for COERCE_FLOAT_TO_DOUBLE: do the coercion only
type = builtin_type_int;
}
/* Currently all target ABIs require at least the width of an integer
- type for an argument. We may have to conditionalize the following
- type coercion for future targets. */
+ type for an argument. We may have to conditionalize the following
+ type coercion for future targets. */
if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_int))
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. */
+ 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 (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_double))
return value_cast (type, arg);
}
-/* Determine a function's address and its return type from its value.
+/* Determine a function's address and its return type from its value.
Calls error() if the function is not valid for calling. */
static CORE_ADDR
else if (code == TYPE_CODE_INT)
{
/* Handle the case of functions lacking debugging info.
- Their values are characters since their addresses are char */
+ Their values are characters since their addresses are char */
if (TYPE_LENGTH (ftype) == 1)
funaddr = value_as_pointer (value_addr (function));
else
/* CALL_DUMMY is an array of words (REGISTER_SIZE), but each word
is in host byte order. Before calling FIX_CALL_DUMMY, we byteswap it
and remove any extra bytes which might exist because ULONGEST is
- bigger than REGISTER_SIZE.
+ bigger than REGISTER_SIZE.
NOTE: This is pretty wierd, as the call dummy is actually a
sequence of instructions. But CISC machines will have
for (i = nargs - 1; i >= 0; i--)
{
/* If we're off the end of the known arguments, do the standard
- promotions. FIXME: if we had a prototype, this should only
- be allowed if ... were present. */
+ promotions. FIXME: if we had a prototype, this should only
+ be allowed if ... were present. */
if (i >= TYPE_NFIELDS (ftype))
args[i] = value_arg_coerce (args[i], NULL, 0);
args[i] = value_arg_coerce (args[i], param_type, is_prototyped);
}
- /*elz: this code is to handle the case in which the function to be called
- has a pointer to function as parameter and the corresponding actual argument
- is the address of a function and not a pointer to function variable.
- In aCC compiled code, the calls through pointers to functions (in the body
- of the function called by hand) are made via $$dyncall_external which
- requires some registers setting, this is taken care of if we call
- via a function pointer variable, but not via a function address.
- In cc this is not a problem. */
+ /*elz: this code is to handle the case in which the function to be called
+ has a pointer to function as parameter and the corresponding actual argument
+ is the address of a function and not a pointer to function variable.
+ In aCC compiled code, the calls through pointers to functions (in the body
+ of the function called by hand) are made via $$dyncall_external which
+ requires some registers setting, this is taken care of if we call
+ via a function pointer variable, but not via a function address.
+ In cc this is not a problem. */
if (using_gcc == 0)
if (param_type)
/* if this parameter is a pointer to function */
if (TYPE_CODE (param_type) == TYPE_CODE_PTR)
if (TYPE_CODE (param_type->target_type) == TYPE_CODE_FUNC)
- /* elz: FIXME here should go the test about the compiler used
- to compile the target. We want to issue the error
- message only if the compiler used was HP's aCC.
- If we used HP's cc, then there is no problem and no need
- to return at this point */
+ /* elz: FIXME here should go the test about the compiler used
+ to compile the target. We want to issue the error
+ message only if the compiler used was HP's aCC.
+ If we used HP's cc, then there is no problem and no need
+ to return at this point */
if (using_gcc == 0) /* && compiler == aCC */
/* go see if the actual parameter is a variable of type
pointer to function or just a function */
int len = TYPE_LENGTH (value_type);
#ifdef STACK_ALIGN
/* MVS 11/22/96: I think at least some of this stack_align code is
- really broken. Better to let PUSH_ARGUMENTS adjust the stack in
- a target-defined manner. */
+ really broken. Better to let PUSH_ARGUMENTS adjust the stack in
+ a target-defined manner. */
len = STACK_ALIGN (len);
#endif
if (INNER_THAN (1, 2))
/* elz: on HPPA no need for this extra alignment, maybe it is needed
on other architectures. This is because all the alignment is taken care
- of in the above code (ifdef REG_STRUCT_HAS_ADDR) and in
+ of in the above code (ifdef REG_STRUCT_HAS_ADDR) and in
hppa_push_arguments */
#ifndef NO_EXTRA_ALIGNMENT_NEEDED
function. Since this doesn't actually involve executing a JSR/BSR
instruction, the return address must be set up by hand, either by
pushing onto the stack or copying into a return-address register
- as appropriate. Formerly this has been done in PUSH_ARGUMENTS,
+ as appropriate. Formerly this has been done in PUSH_ARGUMENTS,
but that's overloading its functionality a bit, so I'm making it
explicit to do it here. */
sp = PUSH_RETURN_ADDRESS (real_pc, sp);
if (!INNER_THAN (1, 2))
{
/* If stack grows up, we must leave a hole at the bottom, note
- that sp already has been advanced for the arguments! */
+ that sp already has been advanced for the arguments! */
if (CALL_DUMMY_STACK_ADJUST_P)
sp += CALL_DUMMY_STACK_ADJUST;
sp = STACK_ALIGN (sp);
it doesn't cost us anything but space and if the function is pcc
it will ignore this value, we will make that assumption.
- Also note that on some machines (like the sparc) pcc uses a
+ Also note that on some machines (like the sparc) pcc uses a
convention like gcc's. */
if (struct_return)
/* We stopped inside the FUNCTION because of a random signal.
Further execution of the FUNCTION is not allowed. */
- if (unwind_on_signal_p)
+ if (unwind_on_signal_p)
{
/* The user wants the context restored. */
- /* We must get back to the frame we were before the dummy call. */
- POP_FRAME;
+ /* We must get back to the frame we were before the dummy call. */
+ POP_FRAME;
/* FIXME: Insert a bunch of wrap_here; name can be very long if it's
a C++ name with arguments and stuff. */
/* Array to pointer is a `trivial conversion' according to the ARM. */
/* We should be doing much hairier argument matching (see section 13.2
- of the ARM), but as a quick kludge, just check for the same type
- code. */
+ of the ARM), but as a quick kludge, just check for the same type
+ code. */
if (TYPE_CODE (t1[i]) != TYPE_CODE (VALUE_TYPE (t2[i])))
return i + 1;
}
{
char *t_field_name = TYPE_FIELD_NAME (type, i);
- if (t_field_name && STREQ (t_field_name, name))
+ if (t_field_name && STREQ_IW (t_field_name, name))
{
value_ptr v;
if (TYPE_FIELD_STATIC (type, i))
if (t_field_name
&& (t_field_name[0] == '\0'
|| (TYPE_CODE (type) == TYPE_CODE_UNION
- && STREQ (t_field_name, "else"))))
+ && STREQ_IW (t_field_name, "else"))))
{
struct type *field_type = TYPE_FIELD_TYPE (type, i);
if (TYPE_CODE (field_type) == TYPE_CODE_UNION
value_ptr v;
struct type *basetype = check_typedef (TYPE_BASECLASS (type, i));
/* If we are looking for baseclasses, this is what we get when we
- hit them. But it could happen that the base part's member name
- is not yet filled in. */
+ hit them. But it could happen that the base part's member name
+ is not yet filled in. */
int found_baseclass = (looking_for_baseclass
&& TYPE_BASECLASS_NAME (type, i) != NULL
- && STREQ (name, TYPE_BASECLASS_NAME (type, i)));
+ && STREQ_IW (name, TYPE_BASECLASS_NAME (type, i)));
if (BASETYPE_VIA_VIRTUAL (type, i))
{
* virtual base entries. Offset is negative -- virtual base entries
* appear _before_ the address point of the virtual table. */
- /* pai: FIXME -- 32x64 problem, if word = 8 bytes, change multiplier
+ /* pai: FIXME -- 32x64 problem, if word = 8 bytes, change multiplier
& use long type */
/* epstein : FIXME -- added param for overlay section. May not be correct */
else if (cplus_demangle_opname (t_field_name, dem_opname, 0))
t_field_name = dem_opname;
}
- if (t_field_name && STREQ (t_field_name, name))
+ if (t_field_name && !strcmp_iw (t_field_name, name))
{
int j = TYPE_FN_FIELDLIST_LENGTH (type, i) - 1;
struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
if (TYPE_HAS_VTABLE (type))
{
/* HP aCC compiled type, search for virtual base offset
- according to HP/Taligent runtime spec. */
+ according to HP/Taligent runtime spec. */
int skip;
find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
VALUE_CONTENTS_ALL (*arg1p),
char *base_valaddr;
/* The virtual base class pointer might have been clobbered by the
- user program. Make sure that it still points to a valid memory
- location. */
+ user program. Make sure that it still points to a valid memory
+ location. */
if (offset < 0 || offset >= TYPE_LENGTH (type))
{
/* if there are no arguments ...do this... */
/* Try as a field first, because if we succeed, there
- is less work to be done. */
+ is less work to be done. */
v = search_struct_field (name, *argp, 0, t, 0);
if (v)
return v;
/* C++: If it was not found as a data field, then try to
- return it as a pointer to a method. */
+ return it as a pointer to a method. */
if (destructor_name_p (name, t))
error ("Cannot get value of destructor");
else if (v == 0)
{
/* See if user tried to invoke data as function. If so,
- hand it back. If it's not callable (i.e., a pointer to function),
- gdb should give an error. */
+ hand it back. If it's not callable (i.e., a pointer to function),
+ gdb should give an error. */
v = search_struct_field (name, *argp, 0, t, 0);
}
{
/* pai: FIXME What about operators and type conversions? */
char *fn_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
- if (fn_field_name && STREQ (fn_field_name, method))
+ if (fn_field_name && STREQ_IW (fn_field_name, method))
{
*num_fns = TYPE_FN_FIELDLIST_LENGTH (type, i);
*basetype = type;
char *obj_type_name = NULL;
char *func_name = NULL;
+ int i,j,len,len2;
+ struct type *domain;
+ struct fn_field *f;
/* Get the list of overloaded methods or functions */
if (method)
{
obj_type_name = TYPE_NAME (VALUE_TYPE (obj));
/* Hack: evaluate_subexp_standard often passes in a pointer
- value rather than the object itself, so try again */
+ value rather than the object itself, so try again */
if ((!obj_type_name || !*obj_type_name) &&
(TYPE_CODE (VALUE_TYPE (obj)) == TYPE_CODE_PTR))
obj_type_name = TYPE_NAME (TYPE_TARGET_TYPE (VALUE_TYPE (obj)));
obj_type_name,
(obj_type_name && *obj_type_name) ? "::" : "",
name);
+ domain=TYPE_DOMAIN_TYPE(fns_ptr[0].type);
+ len = TYPE_NFN_FIELDS (domain);
+ /*This stuff is for STABS, which won't give us the info we need directly in the types.
+ * We have to use the method stub conversion to get it.
+ * Be aware that this is by no means perfect, and if you use
+ * STABS, please move to DWARF-2, or something like it, because
+ * trying to improve overloading using STABS is really a waste
+ * of time.
+ */
+ for (i = 0; i < len; i++)
+ {
+ f = TYPE_FN_FIELDLIST1 (domain, i);
+ len2 = TYPE_FN_FIELDLIST_LENGTH (domain, i);
+
+ for (j = 0; j < len2; j++)
+ {
+ if (TYPE_FN_FIELD_STUB (f, j))
+ check_stub_method (domain, i, j);
+ }
+ }
}
else
{
func_name = cplus_demangle (SYMBOL_NAME (fsym), DMGL_NO_OPTS);
/* If the name is NULL this must be a C-style function.
- Just return the same symbol. */
+ Just return the same symbol. */
if (!func_name)
- {
+ {
*symp = fsym;
- return 0;
- }
+ return 0;
+ }
oload_syms = make_symbol_overload_list (fsym);
while (oload_syms[++i])
/* Consider each candidate in turn */
for (ix = 0; ix < num_fns; ix++)
{
- /* Number of parameters for current candidate */
- nparms = method ? TYPE_NFIELDS (fns_ptr[ix].type)
- : TYPE_NFIELDS (SYMBOL_TYPE (oload_syms[ix]));
+ if (method)
+ {
+ /* For static member functions, we won't have a this pointer, but nothing
+ else seems to handle them right now, so we just pretend ourselves */
+ nparms=0;
+
+ if (TYPE_FN_FIELD_ARGS(fns_ptr,ix))
+ {
+ while (TYPE_CODE(TYPE_FN_FIELD_ARGS(fns_ptr,ix)[nparms]) != TYPE_CODE_VOID)
+ nparms++;
+ }
+ }
+ else
+ {
+ /* If it's not a method, this is the proper place */
+ nparms=TYPE_NFIELDS(SYMBOL_TYPE(oload_syms[ix]));
+ }
/* Prepare array of parameter types */
parm_types = (struct type **) xmalloc (nparms * (sizeof (struct type *)));
for (jj = 0; jj < nparms; jj++)
- parm_types[jj] = method ? TYPE_FIELD_TYPE (fns_ptr[ix].type, jj)
+ parm_types[jj] = method ? (TYPE_FN_FIELD_ARGS(fns_ptr,ix)[jj])
: TYPE_FIELD_TYPE (SYMBOL_TYPE (oload_syms[ix]), jj);
/* Compare parameter types to supplied argument types */
printf ("Overloaded method instance %s, # of parms %d\n", fns_ptr[ix].physname, nparms);
else
printf ("Overloaded function instance %s # of parms %d\n", SYMBOL_DEMANGLED_NAME (oload_syms[ix]), nparms);
- for (jj = 0; jj <= nargs; jj++)
+ for (jj = 0; jj < nargs; jj++)
printf ("...Badness @ %d : %d\n", jj, bv->rank[jj]);
printf ("Overload resolution champion is %d, ambiguous? %d\n", oload_champ, oload_ambiguous);
#endif
} /* end loop over all candidates */
+/* Seems to be a better idea to just pick one if they have the exact same goodness.
+ * This is because there is no way to differentiate based on return type, which we need
+ * to in cases like overloads of .begin() <It's both const and non-const> */
+#if 0
if (oload_ambiguous)
{
if (method)
error ("Cannot resolve overloaded function %s to unique instance; disambiguate by specifying function signature",
func_name);
}
+#endif
/* Check how bad the best match is */
for (ix = 1; ix <= nargs; ix++)
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{
char *t_field_name = TYPE_FIELD_NAME (type, i);
- if (t_field_name && STREQ (t_field_name, name))
+ if (t_field_name && STREQ_IW (t_field_name, name))
return 1;
}
for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
{
- if (STREQ (TYPE_FN_FIELDLIST_NAME (type, i), name))
+ if (STREQ_IW (TYPE_FN_FIELDLIST_NAME (type, i), name))
return 1;
}
* USING_ENC is the flag that distinguishes the two cases.
* If it is 1, then the offset is for the enclosing object,
* otherwise for the embedded object.
- *
+ *
* This currently works only for RTTI information generated
* by the HP ANSI C++ compiler (aCC). g++ today (1997-06-10)
* does not appear to support RTTI. This function returns a
}
}
/* We should set the address, bitssize, and bitspos, so the clice
- can be used on the LHS, but that may require extensions to
- value_assign. For now, just leave as a non_lval. FIXME. */
+ can be used on the LHS, but that may require extensions to
+ value_assign. For now, just leave as a non_lval. FIXME. */
}
else
{
return value_slice (value_primitive_field (varray, 0, 1, vtype), 0, length);
}
-/* Create a value for a FORTRAN complex number. Currently most of
- the time values are coerced to COMPLEX*16 (i.e. a complex number
- composed of 2 doubles. This really should be a smarter routine
- that figures out precision inteligently as opposed to assuming
+/* Create a value for a FORTRAN complex number. Currently most of
+ the time values are coerced to COMPLEX*16 (i.e. a complex number
+ composed of 2 doubles. This really should be a smarter routine
+ that figures out precision inteligently as opposed to assuming
doubles. FIXME: fmb */
value_ptr