From: Jim Kingdon <kingdon@redhat.com>
To: hjl@lucon.org
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: Make threads architecture-independent on Linux
Date: Fri, 12 Nov 1999 10:58:00 -0000 [thread overview]
Message-ID: <199911121858.NAA29893@devserv.devel.redhat.com> (raw)
In-Reply-To: <19991110234852.420C61B493@ocean.lucon.org>
> You should have config/tm-linux.h enclosed here and modify all the
> Linux tm files to include it. Otherwise, linuxthreads won't work
> right if REALTIME_HI and REALTIME_LO are not correct.
Ouch. Thanks for pointing this out. I've fixed that and another
problem and here's another try (this time I tested it on alpha as well
as x86).
To apply, cd to the gdb/gdb directory and run
patch -p 1 <this-message
> My gdb tree is a mess. I don't have the time to clean it up.
Don't worry about it - we'll get there one way or another.
1999-11-08 Jim Kingdon < http://developer.redhat.com/ >
Enable threads for all linux architectures:
* config/nm-linux.h: New file.
* config/{alpha,i386,m68k,sparc}/nm-linux.h: Use it.
* config/tm-linux.h: New file.
* config/{i386,m68k,sparc}/tm-linux.h,
config/alpha/tm-alphalinux.h: Use it.
* config/{m68k,sparc}/linux.mh, config/alpha/alpha-linux.mh:
Add linux-thread.o.
--- /dev/null Tue May 5 16:32:27 1998
+++ gdb/config/nm-linux.h Mon Nov 1 15:33:51 1999
@@ -0,0 +1,52 @@
+/* Native support for GNU/Linux, for GDB, the GNU debugger.
+ Copyright (C) 1999
+ Free Software Foundation, Inc.
+
+ 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 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. */
+
+/* Linux is svr4ish but not that much */
+#undef USE_PROC_FS
+
+/* Tell gdb that we can attach and detach other processes */
+#define ATTACH_DETACH
+
+/* We define this if link.h is available, because with ELF we use SVR4 style
+ shared libraries. */
+
+#ifdef HAVE_LINK_H
+#define SVR4_SHARED_LIBS
+#include "solib.h" /* Support for shared libraries. */
+#endif
+
+/* Support for the glibc linuxthreads package. */
+
+#ifdef __STDC__
+struct objfile;
+#endif
+
+extern void
+linuxthreads_new_objfile PARAMS ((struct objfile *objfile));
+#define target_new_objfile(OBJFILE) linuxthreads_new_objfile (OBJFILE)
+
+extern char *
+linuxthreads_pid_to_str PARAMS ((int pid));
+#define target_pid_to_str(PID) linuxthreads_pid_to_str (PID)
+
+extern int
+linuxthreads_prepare_to_proceed PARAMS ((int step));
+#define PREPARE_TO_PROCEED(select_it) linuxthreads_prepare_to_proceed (1)
Index: gdb/config/alpha/nm-linux.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/config/alpha/nm-linux.h,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 nm-linux.h
--- gdb/config/alpha/nm-linux.h 1999/07/07 20:11:53 1.1.1.3
+++ gdb/config/alpha/nm-linux.h 1999/11/08 23:09:59
@@ -18,6 +18,8 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include "nm-linux.h"
+
/* Figure out where the longjmp will land. We expect that we have just entered
longjmp and haven't yet setup the stack frame, so the args are still in the
argument regs. A0_REGNUM points at the jmp_buf structure from which we
@@ -28,13 +30,12 @@
extern int
get_longjmp_target PARAMS ((CORE_ADDR *));
-/* Tell gdb that we can attach and detach other processes */
-#define ATTACH_DETACH
-
/* ptrace register ``addresses'' are absolute. */
#define U_REGS_OFFSET 0
+/* FIXME: This is probably true, or should be, on all Linux ports.
+ IA64? Sparc64? */
#define PTRACE_ARG3_TYPE long
/* ptrace transfers longs, the ptrace man page is lying. */
@@ -51,10 +52,7 @@
/* Support for shared libraries. */
-#include "solib.h"
-
#ifdef __ELF__
-#define SVR4_SHARED_LIBS
#define TARGET_ELF64
#endif
@@ -65,3 +63,4 @@
/* Given a pointer to either a gregset_t or fpregset_t, return a
pointer to the first register. */
#define ALPHA_REGSET_BASE(regsetp) ((long *) (regsetp))
+
Index: gdb/config/i386/nm-linux.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/config/i386/nm-linux.h,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 nm-linux.h
--- gdb/config/i386/nm-linux.h 1999/09/08 23:59:52 1.1.1.3
+++ gdb/config/i386/nm-linux.h 1999/11/08 23:09:59
@@ -23,14 +23,12 @@
#define NM_LINUX_H
#include "i386/nm-i386v.h"
+#include "nm-linux.h"
/* Return sizeof user struct to callers in less machine dependent routines */
#define KERNEL_U_SIZE kernel_u_size()
extern int kernel_u_size PARAMS ((void));
-
-/* Tell gdb that we can attach and detach other processes */
-#define ATTACH_DETACH
#define U_REGS_OFFSET 0
Index: gdb/config/m68k/nm-linux.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/config/m68k/nm-linux.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 nm-linux.h
--- gdb/config/m68k/nm-linux.h 1999/07/07 20:14:04 1.1.1.2
+++ gdb/config/m68k/nm-linux.h 1999/11/08 23:10:00
@@ -21,23 +21,14 @@
#ifndef NM_LINUX_H
#define NM_LINUX_H
+#include "nm-linux.h"
+
/* Return sizeof user struct to callers in less machine dependent routines */
#define KERNEL_U_SIZE kernel_u_size()
extern int kernel_u_size PARAMS ((void));
-/* Tell gdb that we can attach and detach other processes */
-#define ATTACH_DETACH
-
#define U_REGS_OFFSET 0
-
-/* We define this if link.h is available, because with ELF we use SVR4 style
- shared libraries. */
-
-#ifdef HAVE_LINK_H
-#define SVR4_SHARED_LIBS
-#include "solib.h" /* Support for shared libraries. */
-#endif
#define REGISTER_U_ADDR(addr, blockend, regno) \
(addr) = m68k_linux_register_u_addr ((blockend),(regno));
Index: gdb/config/sparc/nm-linux.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/config/sparc/nm-linux.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 nm-linux.h
--- gdb/config/sparc/nm-linux.h 1999/07/07 20:17:01 1.1.1.2
+++ gdb/config/sparc/nm-linux.h 1999/11/08 23:10:00
@@ -27,6 +27,3 @@
#define KERNEL_U_SIZE kernel_u_size()
extern int kernel_u_size PARAMS ((void));
-
-/* Linux is svr4ish but not that much */
-#undef USE_PROC_FS
Index: sparc/tm-linux.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/config/sparc/tm-linux.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 tm-linux.h
--- tm-linux.h 1999/07/07 20:17:06 1.1.1.2
+++ gdb/config/sparc/tm-linux.h 1999/11/12 13:35:58
@@ -25,6 +25,6 @@
#define SIGCONTEXT_PC_OFFSET 12
-#include "tm-sysv4.h"
+#include "tm-linux.h"
#endif /* TM_SPARCLINUX_H */
Index: m68k/tm-linux.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/config/m68k/tm-linux.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 tm-linux.h
--- tm-linux.h 1999/07/07 20:14:22 1.1.1.2
+++ gdb/config/m68k/tm-linux.h 1999/11/12 13:36:01
@@ -72,7 +72,7 @@
} \
}
-#include "tm-sysv4.h"
+#include "tm-linux.h"
#include "m68k/tm-m68k.h"
/* Extract from an array REGBUF containing the (raw) register state
Index: i386/tm-linux.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/config/i386/tm-linux.h,v
retrieving revision 1.1.1.7
diff -u -r1.1.1.7 tm-linux.h
--- tm-linux.h 1999/11/02 04:44:22 1.1.1.7
+++ gdb/config/i386/tm-linux.h 1999/11/12 13:36:03
@@ -28,6 +28,7 @@
#endif
#include "i386/tm-i386.h"
+#include "tm-linux.h"
/* Size of sigcontext, from <asm/sigcontext.h>. */
#define LINUX_SIGCONTEXT_SIZE (88)
@@ -38,10 +39,6 @@
/* Offset to saved SP in sigcontext, from <asm/sigcontext.h>. */
#define LINUX_SIGCONTEXT_SP_OFFSET (28)
-/* We need this file for the SOLIB_TRAMPOLINE stuff. */
-
-#include "tm-sysv4.h"
-
#define LOW_RETURN_REGNUM 0 /* holds low four bytes of result */
#define HIGH_RETURN_REGNUM 2 /* holds high four bytes of result */
@@ -166,18 +163,6 @@
: read_memory_integer ((FRAME)->frame + 4, 4)))
extern CORE_ADDR i386_linux_sigtramp_saved_sp PARAMS ((struct frame_info *));
-
-/* Some versions of Linux have real-time signal support in the C library, and
- some don't. We have to include this file to find out. */
-#include <signal.h>
-
-#ifdef __SIGRTMIN
-#define REALTIME_LO __SIGRTMIN
-#define REALTIME_HI (__SIGRTMAX + 1)
-#else
-#define REALTIME_LO 32
-#define REALTIME_HI 64
-#endif
/* When we call a function in a shared library, and the PLT sends us
into the dynamic linker to find the function's real address, we
Index: alpha/tm-alphalinux.h
===================================================================
RCS file: /cvs/gdb/gdb/gdb/config/alpha/tm-alphalinux.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 tm-alphalinux.h
--- tm-alphalinux.h 1999/07/07 20:11:59 1.1.1.2
+++ gdb/config/alpha/tm-alphalinux.h 1999/11/12 13:36:05
@@ -75,7 +75,6 @@
#undef FRAME_PAST_SIGTRAMP_FRAME
#define FRAME_PAST_SIGTRAMP_FRAME(frame, pc) (0)
-/* We need this for the SOLIB_TRAMPOLINE stuff. */
-#include "tm-sysv4.h"
+#include "tm-linux.h"
#endif /* TM_LINUXALPHA_H */
--- /dev/null Tue May 5 16:32:27 1998
+++ gdb/config/tm-linux.h Thu Nov 11 21:51:21 1999
@@ -0,0 +1,36 @@
+/* Native support for GNU/Linux, for GDB, the GNU debugger.
+ Copyright (C) 1999
+ Free Software Foundation, Inc.
+
+ 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 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. */
+
+/* Some versions of Linux have real-time signal support in the C library, and
+ some don't. We have to include this file to find out. */
+#include <signal.h>
+
+#ifdef __SIGRTMIN
+#define REALTIME_LO __SIGRTMIN
+#define REALTIME_HI (__SIGRTMAX + 1)
+#else
+#define REALTIME_LO 32
+#define REALTIME_HI 64
+#endif
+
+/* We need this file for the SOLIB_TRAMPOLINE stuff. */
+
+#include "tm-sysv4.h"
Index: gdb/config/alpha/alpha-linux.mh
===================================================================
RCS file: /cvs/gdb/gdb/gdb/config/alpha/alpha-linux.mh,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 alpha-linux.mh
--- alpha-linux.mh 1999/04/16 01:34:14 1.1.1.1
+++ gdb/config/alpha/alpha-linux.mh 1999/11/12 17:54:12
@@ -3,7 +3,7 @@
XM_FILE= xm-alphalinux.h
NAT_FILE= nm-linux.h
NATDEPFILES= infptrace.o inftarg.o corelow.o core-regset.o alpha-nat.o \
- fork-child.o solib.o
+ fork-child.o solib.o linux-thread.o
MMALLOC =
MMALLOC_CFLAGS = -DNO_MMALLOC
Index: gdb/config/sparc/linux.mh
===================================================================
RCS file: /cvs/gdb/gdb/gdb/config/sparc/linux.mh,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 linux.mh
--- linux.mh 1999/04/16 01:34:25 1.1.1.1
+++ gdb/config/sparc/linux.mh 1999/11/12 17:54:12
@@ -2,6 +2,7 @@
XDEPFILES= ser-tcp.o
XM_FILE= xm-linux.h
NAT_FILE= nm-linux.h
-NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o sparc-nat.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o sparc-nat.o \
+ linux-thread.o
HOST_IPC=-DBSD_IPC
GDBSERVER_DEPFILES= low-sparc.o
Index: gdb/config/m68k/linux.mh
===================================================================
RCS file: /cvs/gdb/gdb/gdb/config/m68k/linux.mh,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 linux.mh
--- linux.mh 1999/04/16 01:34:21 1.1.1.1
+++ gdb/config/m68k/linux.mh 1999/11/12 17:54:12
@@ -4,6 +4,7 @@
XDEPFILES= ser-tcp.o
NAT_FILE= nm-linux.h
-NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o core-aout.o core-regset.o m68klinux-nat.o
+NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o \
+ corelow.o core-aout.o core-regset.o m68klinux-nat.o linux-thread.o
GDBSERVER_DEPFILES= low-linux.o
From jtc@redback.com Fri Nov 12 11:56:00 1999
From: jtc@redback.com (J.T. Conklin)
To: gdb-patches@sourceware.cygnus.com
Subject: fp update for embedded x86 config
Date: Fri, 12 Nov 1999 11:56:00 -0000
Message-id: <5m7ljntrg9.fsf@jtc.redbacknetworks.com>
X-SW-Source: 1999-q4/msg00249.html
Content-length: 2218
1999-11-12 J.T. Conklin <jtc@redback.com>
* config/i386/tm-embed.h: New file.
* config/i386/embed.mt: Updated to use tm-embed.h.
Index: gdb/gdb/config/i386/embed.mt
diff -c gdb/gdb/config/i386/embed.mt:1.1.1.1 gdb/gdb/config/i386/embed.mt:1.2
*** gdb/gdb/config/i386/embed.mt:1.1.1.1 Tue Aug 17 16:52:14 1999
--- gdb/gdb/config/i386/embed.mt Fri Nov 12 11:48:31 1999
***************
*** 1,3 ****
# Target: Embedded Intel 386
TDEPFILES= i386-tdep.o i387-tdep.o
! TM_FILE= tm-i386v.h
--- 1,3 ----
# Target: Embedded Intel 386
TDEPFILES= i386-tdep.o i387-tdep.o
! TM_FILE= tm-embed.h
Index: gdb/gdb/config/i386/tm-embed.h
diff -c /dev/null gdb/gdb/config/i386/tm-embed.h:1.1
*** /dev/null Fri Nov 12 11:49:47 1999
--- gdb/gdb/config/i386/tm-embed.h Fri Nov 12 11:48:31 1999
***************
*** 0 ****
--- 1,35 ----
+ /* Target machine description for embedded 80[3456]86,
+ for GDB, the GNU debugger.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
+ 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 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. */
+
+ #ifndef TM_EMBED_H
+ #define TM_EMBED_H
+
+ /* Because GDB's embedded x86 targets did not support floating point
+ registers before the x86 FP support reorganization effort, it seems
+ prudent to continue doing the same until a mechanism is in place to
+ select processor type at run time. */
+
+ #undef HAVE_I387_REGS
+ #undef HAVE_SSE_REGS
+
+ #include "i386/tm-i386v.h"
+
+ #endif /* ifndef TM_EMBED_H */
--
J.T. Conklin
RedBack Networks
From guo@cup.hp.com Fri Nov 12 12:32:00 1999
From: Jimmy Guo <guo@cup.hp.com>
To: gdb-patches@sourceware.cygnus.com
Subject: (patch) hpjyg23: gdbtypes.[ch] & values.c
Date: Fri, 12 Nov 1999 12:32:00 -0000
Message-id: <Pine.LNX.4.10.9911121213280.2889-100000@hpcll168.cup.hp.com>
X-SW-Source: 1999-q4/msg00250.html
Content-length: 15251
***
Patch dependency: hpjyg11 (gdbtypes.h)
***
This patch covers misc. fixes to gdbtypes.c and values.c, and introduces
builtin_type_CORE_ADDR (for 32x64 fix) as well as is_float_type.
ChangeLog:
1999-11-12 Jimmy Guo <guo@cup.hp.com>
* gdbtypes.c: Misc. fixes and builtin_type_CORE_ADDR support.
(rank_one_type): return INTEGER_PROMOTION_BADNESS if parm is of
TYPE_CODE_ENUM, arg is of a compatible type, but TYPE_LENGTH
(arg) <= TYPE_LENGTH (parm); when both parm and arg are of
TYPE_CODE_STRUCT, return 0 if the tag names are the same (for
same type in different shared libraries), same for
TYPE_CODE_UNION.
(build_gdbtypes): init builtin_type_CORE_ADDR to
builtin_type_unsigned_long_long (64bit) or
builtin_type_unsigned_long (32bit).
(is_float_type): New function.
* gdbtypes.h: Misc. fixes and builtin_type_CORE_ADDR support.
(TYPE_IS_OPAQUE): include TYPE_CODE_TEMPLATE too.
(builtin_type_CORE_ADDR): Declare.
(builtin_type_f_integer_s2,builtin_type_f_integer_s8,
builtin_type_f_logical_s8): Declare, for Fortran support.
(is_float_type): Declare.
* values.c: Misc. 32x64 fixes.
Index: gdb/gdbtypes.c
/opt/gnu/bin/diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/gdbtypes.c gdb/gdbtypes.c
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/gdbtypes.c Thu Nov 11 14:32:32 1999
--- gdb/gdbtypes.c Fri Nov 12 12:11:03 1999
***************
*** 65,70 ****
--- 65,71 ----
struct type *builtin_type_int64;
struct type *builtin_type_uint64;
struct type *builtin_type_bool;
+ struct type *builtin_type_CORE_ADDR;
struct type *builtin_type_v4sf;
int opaque_type_resolution = 1;
***************
*** 1435,1441 ****
char *mangled_name = gdb_mangle_name (type, method_id, signature_id);
char *demangled_name = cplus_demangle (mangled_name,
DMGL_PARAMS | DMGL_ANSI);
! char *argtypetext, *p;
int depth = 0, argcount = 1;
struct type **argtypes;
struct type *mtype;
--- 1436,1442 ----
char *mangled_name = gdb_mangle_name (type, method_id, signature_id);
char *demangled_name = cplus_demangle (mangled_name,
DMGL_PARAMS | DMGL_ANSI);
! char *argtypetext, *p = NULL;
int depth = 0, argcount = 1;
struct type **argtypes;
struct type *mtype;
***************
*** 1669,1674 ****
--- 1670,1685 ----
|| (TYPE_CODE (t) == TYPE_CODE_BOOL)));
}
+ int
+ is_float_type (t)
+ struct type *t;
+ {
+ CHECK_TYPEDEF (t);
+ return
+ ((t != NULL) &&
+ (TYPE_CODE(t) == TYPE_CODE_FLT));
+ }
+
/* Chill varying string and arrays are represented as follows:
struct { int __var_length; ELEMENT_TYPE[MAX_SIZE] __var_data};
***************
*** 2025,2040 ****
* base classes too.
*/
! /* pai: FIXME This doesn't do the right thing: count redefined virtual
! * functions only once (latest redefinition)
! */
int
count_virtual_fns (dclass)
struct type *dclass;
{
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);
--- 2036,2051 ----
* base classes too.
*/
! /* pai: FIXME I'm not sure that this does the right thing: it should
! probably count redefined virtual functions only once (latest redefinition).
! But see use in cp-valprint.c before changing this. */
int
count_virtual_fns (dclass)
struct type *dclass;
{
int fn, oi; /* function and overloaded instance indices */
! int vfuncs = 0; /* count to return */
/* recurse on bases that can share virtual table */
struct type *pbc = primary_base_class (dclass);
***************
*** 2291,2297 ****
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:
--- 2302,2311 ----
case TYPE_CODE_RANGE:
case TYPE_CODE_BOOL:
case TYPE_CODE_ENUM:
! if (TYPE_LENGTH (arg) <= TYPE_LENGTH (parm))
! return INTEGER_PROMOTION_BADNESS;
! else
! return INTEGER_COERCION_BADNESS;
case TYPE_CODE_FLT:
return INT_FLOAT_CONVERSION_BADNESS;
default:
***************
*** 2405,2410 ****
--- 2419,2435 ----
switch (TYPE_CODE (arg))
{
case TYPE_CODE_STRUCT:
+ /* RM: the two structs may be the same type but in
+ different shared libraries. The type ptrs won't
+ compare equal, but they really are the same type (or
+ we have a violation of C++'s one definition
+ rule). Compare names to see if the two types refer to
+ the same struct. */
+ /* RM: compare tag names -- one or both names may have a
+ class/struct prefix */
+ if (!strcmp(TYPE_TAG_NAME(arg), TYPE_TAG_NAME(parm)))
+ return 0;
+
/* Check for derivation */
if (is_ancestor (parm, arg))
return BASE_CONVERSION_BADNESS;
***************
*** 2417,2422 ****
--- 2442,2456 ----
switch (TYPE_CODE (arg))
{
case TYPE_CODE_UNION:
+ /* RM: the two unions may be the same type but in
+ different shared libraries. The type ptrs won't
+ compare equal, but they really are the same type (or
+ we have a violation of C++'s one definition
+ rule). Compare names to see if the two types refer to
+ the same union. */
+ if (!strcmp(TYPE_NAME(arg), TYPE_NAME(parm)))
+ return 0;
+ /* else fall through */
default:
return INCOMPATIBLE_TYPE_BADNESS;
}
***************
*** 2955,2960 ****
--- 2989,3000 ----
init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0,
"bool", (struct objfile *) NULL);
+
+ #ifdef BFD64
+ builtin_type_CORE_ADDR = builtin_type_unsigned_long_long;
+ #else
+ builtin_type_CORE_ADDR = builtin_type_unsigned_long;
+ #endif
/* Add user knob for controlling resolution of opaque types */
add_show_from_set
Index: gdb/gdbtypes.h
/opt/gnu/bin/diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/gdbtypes.h gdb/gdbtypes.h
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/gdbtypes.h Fri Nov 5 13:04:38 1999
--- gdb/gdbtypes.h Thu Nov 11 14:49:10 1999
***************
*** 827,836 ****
#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)))
--- 827,839 ----
#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) || \
! /* RM: templates too */ \
! (TYPE_CODE (thistype) == TYPE_CODE_TEMPLATE)) && \
! (TYPE_NFIELDS (thistype) == 0) && \
! (TYPE_CPLUS_SPECIFIC (thistype) && (TYPE_NFN_FIELDS (thistype) == 0)))
***************
*** 877,882 ****
--- 880,891 ----
extern struct type *builtin_type_long_long;
extern struct type *builtin_type_unsigned_long_long;
+ /* builtin_type_CORE_ADDR in a 32-bit gdb will point to the same thing
+ as builtin_type_unsigned_long. In a 64-bit gdb it will point to
+ builtin_type_unsigned_long_long */
+
+ extern struct type *builtin_type_CORE_ADDR;
+
/* Modula-2 types */
extern struct type *builtin_type_m2_char;
***************
*** 897,907 ****
extern struct type *builtin_type_f_character;
extern struct type *builtin_type_f_integer;
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_s2;
extern struct type *builtin_type_f_real;
extern struct type *builtin_type_f_real_s8;
extern struct type *builtin_type_f_real_s16;
--- 906,917 ----
extern struct type *builtin_type_f_character;
extern struct type *builtin_type_f_integer;
+ extern struct type *builtin_type_f_integer_s2;
+ extern struct type *builtin_type_f_integer_s8;
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_logical_s8;
extern struct type *builtin_type_f_real;
extern struct type *builtin_type_f_real_s8;
extern struct type *builtin_type_f_real_s16;
***************
*** 1147,1152 ****
--- 1157,1164 ----
extern int can_dereference PARAMS ((struct type *));
extern int is_integral_type PARAMS ((struct type *));
+
+ extern int is_float_type PARAMS ((struct type *));
extern void maintenance_print_type PARAMS ((char *, int));
Index: gdb/values.c
/opt/gnu/bin/diff -r -c -N /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/values.c gdb/values.c
*** /view/guo.wdb.c//CLO/Components/WDB/Src/gnu/gdb/values.c Thu Nov 11 13:04:26 1999
--- gdb/values.c Thu Nov 11 13:30:04 1999
***************
*** 931,940 ****
if (VALUE_ADDRESS (argp) == 0)
error ("Address of object is null; object may not have been created.");
! /* pai: FIXME -- 32x64 possible problem? */
! /* First word (4 bytes) in object layout is the vtable pointer */
! coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (argp)); /* pai: (temp) */
! /* + offset + VALUE_EMBEDDED_OFFSET (argp)); */
if (!coreptr)
error ("Virtual table pointer is null for object; object may not have been created.");
--- 931,939 ----
if (VALUE_ADDRESS (argp) == 0)
error ("Address of object is null; object may not have been created.");
! /* First word (sizeof(CORE_ADDR) bytes) in object layout is
! the vtable pointer */
! coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (argp));
if (!coreptr)
error ("Virtual table pointer is null for object; object may not have been created.");
***************
*** 955,964 ****
* the beginning of the vtable; but first we have to adjust
* by HP_ACC_VFUNC_START to account for other entries */
! /* pai: FIXME: 32x64 problem here, a word may be 8 bytes in
! * which case the multiplier should be 8 and values should be long */
! vp = value_at (builtin_type_int,
! coreptr + 4 * (TYPE_FN_FIELD_VOFFSET (f, j) + HP_ACC_VFUNC_START), NULL);
coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
/* coreptr now contains the address of the virtual function */
--- 954,965 ----
* the beginning of the vtable; but first we have to adjust
* by HP_ACC_VFUNC_START to account for other entries */
! vp = value_at (builtin_type_CORE_ADDR,
! coreptr +
! sizeof (CORE_ADDR) *
! (TYPE_FN_FIELD_VOFFSET (f, j) +
! HP_ACC_VFUNC_START),
! NULL);
coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
/* coreptr now contains the address of the virtual function */
***************
*** 974,987 ****
/* Find class segment pointer. These are in the vtable slots after
* some other entries, so adjust by HP_ACC_VFUNC_START for that. */
! /* pai: FIXME 32x64 problem here, if words are 8 bytes long
! * the multiplier below has to be 8 and value should be long. */
! vp = value_at (builtin_type_int,
! coreptr + 4 * (HP_ACC_VFUNC_START + class_index), NULL);
/* Indirect once more, offset by function index */
! /* pai: FIXME 32x64 problem here, again multiplier could be 8 and value long */
! coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp) + 4 * TYPE_FN_FIELD_VOFFSET (f, j));
! vp = value_at (builtin_type_int, coreptr, NULL);
coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
/* coreptr now contains the address of the virtual function */
--- 975,992 ----
/* Find class segment pointer. These are in the vtable slots after
* some other entries, so adjust by HP_ACC_VFUNC_START for that. */
!
! vp = value_at (builtin_type_CORE_ADDR,
! coreptr +
! sizeof (CORE_ADDR) *
! (HP_ACC_VFUNC_START + class_index),
! NULL);
/* Indirect once more, offset by function index */
!
! coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp) +
! sizeof (CORE_ADDR) *
! TYPE_FN_FIELD_VOFFSET (f, j));
! vp = value_at (builtin_type_CORE_ADDR, coreptr, NULL);
coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
/* coreptr now contains the address of the virtual function */
***************
*** 997,1003 ****
VALUE_TYPE (vp) = ftype;
VALUE_ADDRESS (vp) = coreptr;
! /* pai: (temp) do we need the value_ind stuff in value_fn_field? */
return vp;
}
else
--- 1002,1008 ----
VALUE_TYPE (vp) = ftype;
VALUE_ADDRESS (vp) = coreptr;
! /* pai: do we need the value_ind stuff in value_fn_field? */
return vp;
}
else
***************
*** 1009,1015 ****
with a strange type, so cast it to type `pointer to long' (which
should serve just fine as a function type). Then, index into
the table, and convert final value to appropriate function type. */
! value_ptr entry, vfn, vtbl;
value_ptr vi = value_from_longest (builtin_type_int,
(LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
--- 1014,1020 ----
with a strange type, so cast it to type `pointer to long' (which
should serve just fine as a function type). Then, index into
the table, and convert final value to appropriate function type. */
! value_ptr entry, vfn = NULL, vtbl;
value_ptr vi = value_from_longest (builtin_type_int,
(LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
***************
*** 1102,1107 ****
--- 1107,1114 ----
FIXME-tiemann: should work with dossier entries as well. */
+ /* pai: Note -- not for HP aCC */
+
static value_ptr
value_headof (in_arg, btype, dtype)
value_ptr in_arg;
***************
*** 1196,1201 ****
--- 1203,1210 ----
of its baseclasses) to figure out the most derived type that ARG
could actually be a pointer to. */
+ /* pai: Note -- not for HP aCC */
+
value_ptr
value_from_vtable_info (arg, type)
value_ptr arg;
***************
*** 1213,1218 ****
--- 1222,1229 ----
/* Return true if the INDEXth field of TYPE is a virtual baseclass
pointer which is for the base class whose type is BASECLASS. */
+ /* pai: Note -- not for HP aCC */
+
static int
vb_match (type, index, basetype)
struct type *type;
***************
*** 1266,1271 ****
--- 1277,1284 ----
to (the address of)(ARG) + OFFSET.
-1 is returned on error. */
+
+ /* pai: Note -- not for HP aCC */
int
baseclass_offset (type, index, valaddr, address)
next parent reply other threads:[~1999-11-12 10:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <19991110234852.420C61B493@ocean.lucon.org>
1999-11-12 10:58 ` Jim Kingdon [this message]
1999-11-19 13:35 ` Jim Blandy
[not found] <19991108233623.805581B493@ocean.lucon.org>
1999-11-10 13:38 ` Mark Kettenis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199911121858.NAA29893@devserv.devel.redhat.com \
--to=kingdon@redhat.com \
--cc=gdb-patches@sourceware.cygnus.com \
--cc=hjl@lucon.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox