diff -P -x Makefile -x init.c -x version.c -x [txn]m.h -x config.* -x .gdbinit -x *.orig -x *.[ao] -x *~ -u tmp/gdb-4.18-orig/gdb/Makefile.in gdb-4.18/gdb/Makefile.in
--- tmp/gdb-4.18-orig/gdb/Makefile.in	Sat Jun  3 18:32:35 2000
+++ gdb-4.18/gdb/Makefile.in	Sat Jun  3 18:58:46 2000
@@ -368,6 +368,7 @@
 	scm-valprint.c source.c stabsread.c stack.c symfile.c \
 	symmisc.c symtab.c target.c thread.c top.c tracepoint.c \
 	typeprint.c utils.c valarith.c valops.c valprint.c values.c \
+        osptr.c \
 	serial.c ser-unix.c mdebugread.c os9kread.c \
 	tui/tui.c tui/tui.h tui/tuiCommand.c tui/tuiCommand.h \
 	tui/tuiData.c tui/tuiData.h tui/tuiDataWin.c tui/tuiDataWin.h \
@@ -481,6 +482,7 @@
 
 COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
 	source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \
+        osptr.o \
 	symtab.o symfile.o symmisc.o infcmd.o infrun.o command.o \
 	expprint.o environ.o gdbarch.o gdbtypes.o copying.o $(DEPFILES) \
 	mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \
@@ -1561,6 +1563,9 @@
 	gdb_string.h
 
 valops.o: valops.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \
+	gdb_string.h
+
+osptr.o: osptr.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \
 	gdb_string.h
 
 valprint.o: valprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
diff -P -x Makefile -x init.c -x version.c -x [txn]m.h -x config.* -x .gdbinit -x *.orig -x *.[ao] -x *~ -u tmp/gdb-4.18-orig/gdb/eval.c gdb-4.18/gdb/eval.c
--- tmp/gdb-4.18-orig/gdb/eval.c	Sat Jun  3 18:32:42 2000
+++ gdb-4.18/gdb/eval.c	Sat Jun  3 20:50:21 2000
@@ -1602,7 +1602,10 @@
         error ("Attempt to dereference pointer to member without an object");
       if (noside == EVAL_SKIP)
 	goto nosideret;
-      if (unop_user_defined_p (op, arg1))
+      arg2 = dereference_osptr(arg1);
+      if(arg2) 
+        return arg2;
+      else if (unop_user_defined_p (op, arg1))
 	return value_x_unop (arg1, op, noside);
       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
 	{
diff -P -x Makefile -x init.c -x version.c -x [txn]m.h -x config.* -x .gdbinit -x *.orig -x *.[ao] -x *~ -u tmp/gdb-4.18-orig/gdb/osptr.c gdb-4.18/gdb/osptr.c
--- tmp/gdb-4.18-orig/gdb/osptr.c	Thu Jan  1 01:00:00 1970
+++ gdb-4.18/gdb/osptr.c	Sat Jun  3 21:02:54 2000
@@ -0,0 +1,204 @@
+/*  Special handling for tess
+    
+   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.  */
+
+#include "defs.h"
+#include "symtab.h"
+#include "gdbtypes.h"
+#include "value.h"
+#include "frame.h"
+#include "inferior.h"
+#include "gdbcore.h"
+#include "target.h"
+#include "demangle.h"
+#include "language.h"
+#include "gdbcmd.h"
+
+#include <errno.h>
+#include "gdb_string.h"
+
+static value_ptr upcast_ptr PARAMS ((value_ptr, char*));
+static value_ptr simple_search_struct_field PARAMS ((char *, value_ptr, int,
+                                                     struct type *));
+static value_ptr dereference_osptr_v2 PARAMS ((struct type*, value_ptr, struct type*));
+
+void _initialize_osptr PARAMS ((void));
+
+
+/* I do not know why I have to put it in read/write segments, but
+   everybody does it. */
+static char tess_mode_off[] = "off";
+static char tess_mode_v1[] = "v1";
+static char tess_mode_v2[] = "v2";
+
+static char* valid_tess_modes[] =
+{
+  tess_mode_off, tess_mode_v1, tess_mode_v2,
+  0
+};
+
+static char* tess_mode = tess_mode_v2;
+
+static void
+set_tess_mode(args, from_tty, c)
+     char *args;
+     int from_tty;
+     struct cmd_list_element *c;
+{
+}
+
+static value_ptr
+upcast_ptr(v, upcast_name)
+     value_ptr v;
+     char* upcast_name;
+{
+  struct type* upcast_type = lookup_struct(upcast_name, NULL);
+  return value_at_lazy(upcast_type, value_as_pointer(v), NULL);
+}
+
+/* strongly simplyfied search_struct_field (which is unfortunatly
+   defined static in valops.c --I was not sure if there was something
+   holy about it being static, so I reimplemented it here) */
+static value_ptr
+simple_search_struct_field (name, arg1, offset, type)
+     char *name;
+     register value_ptr arg1;
+     int offset;
+     register struct type *type;
+{
+  int i;
+  int nbases = TYPE_N_BASECLASSES (type);
+
+  CHECK_TYPEDEF (type);
+
+  for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--)
+    {
+      char *t_field_name = TYPE_FIELD_NAME (type, i);
+      
+      if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
+        {
+          value_ptr v = value_primitive_field (arg1, offset, i, type);
+          if (v == 0)
+            error ("there is no field named %s", name);
+          return v;
+        }
+    }
+  
+  for (i = 0; i < nbases; i++)
+    {
+      value_ptr v;
+      struct type *basetype = check_typedef (TYPE_BASECLASS (type, i));
+      v = simple_search_struct_field (name, arg1,
+			       offset + TYPE_BASECLASS_BITPOS (type, i) / 8,
+                               basetype);
+      if (v)
+	return v;
+    }
+
+  return NULL;
+}
+
+
+static value_ptr
+dereference_osptr_v2(upcast_type, v, t)
+     struct type* upcast_type;
+     value_ptr v;
+     struct type* t;
+{
+  /* look if we have a entry_ here... */
+  v = simple_search_struct_field("entry_", v, 0, t);
+  if(!v) return NULL;
+  t = check_typedef(VALUE_TYPE(v));
+  if(TYPE_CODE(t) != TYPE_CODE_PTR) return NULL;
+  /* now we must check if it is a nil pointer. If so then we must return a value
+     that is equivalent to that.
+  */
+  if(!value_as_pointer(v)) 
+    return value_at_lazy(upcast_type, 0, NULL);
+  /* dereference to come to the OEntry object itself */
+  v = value_ind (v);
+  t = check_typedef (VALUE_TYPE (v));
+  if(TYPE_CODE(t) != TYPE_CODE_STRUCT ||
+     /* not sure if t->name can be null in this case.. but I have seen
+        null in name already once (other places) */
+     !t->name ||
+     strcmp_iw(t->name, "OEntry"))
+    return NULL;
+  /* look up the nember ptr_ */
+  v = simple_search_struct_field("ptr_", v, 0, t);
+  /* this is the moment to bark: we know we are looking at a OEntry object */
+  if(!v) 
+    error("can't find member ptr_ in OEntry object");
+  t = check_typedef(VALUE_TYPE(v));
+  /* we expect a pointer to OEntry */
+  if(TYPE_CODE(t) != TYPE_CODE_PTR)
+    error("ptr_ in OEntry object is no pointer");
+  /* non we should upcast the object */
+  return value_at_lazy(upcast_type, value_as_pointer(v), NULL);
+}
+
+/* return 0 iff v is not a OSPtr
+   return dereference of OSPtr if it is.
+*/
+value_ptr
+dereference_osptr(v)
+     value_ptr v;
+{
+  struct type* t;
+  size_t typelen;
+  struct type* upcast_type;
+
+  if(tess_mode == tess_mode_off) return 0; /* do not even try if we ain't enabled */
+  
+  t = check_typedef(VALUE_TYPE(v));
+  /* check if it is a OSPtr */
+  if(TYPE_CODE(t) != TYPE_CODE_STRUCT || !t->name) return NULL;
+  typelen = strlen(t->name);
+  if(typelen <= 8 || t->name[typelen-1] != '>' ||
+     (strncmp(t->name, "OSPtr<", 6) &&
+      strncmp(t->name, "OViewIterator<", 14) &&
+      strncmp(t->name, "OViewConstIterator<", 19)))
+    return NULL;
+
+  {
+    char upcast_name[typelen];
+    char* first = strchr(t->name, '<') + 1;
+    char* last = t->name + typelen - 1;
+    if(first >= last) return NULL; // empty typename
+    memcpy(upcast_name, first, last - first);
+    upcast_name[last - first] = '\0';
+    upcast_type = lookup_struct(upcast_name, NULL);
+  }
+
+  if(tess_mode != tess_mode_v2)
+    error("sorry, only tess_mode=off or v2 is implemented");
+
+  return dereference_osptr_v2(upcast_type, v, t);
+}
+
+void
+_initialize_osptr ()
+{
+  struct cmd_list_element *c;
+  /* see command.c for doc */
+  c = add_set_enum_cmd ("tess", class_support, valid_tess_modes,
+		   (char *) &tess_mode,
+		   "Set tess extension mode, the valid values are \"off\", \"v1\" and \"v2\", \
+and the default value is \"v2\".",
+		   &setlist);
+  c->function.sfunc = set_tess_mode;
+  add_show_from_set(c, &showlist);
+}
diff -P -x Makefile -x init.c -x version.c -x [txn]m.h -x config.* -x .gdbinit -x *.orig -x *.[ao] -x *~ -u tmp/gdb-4.18-orig/gdb/valops.c gdb-4.18/gdb/valops.c
--- tmp/gdb-4.18-orig/gdb/valops.c	Sat Jun  3 18:32:51 2000
+++ gdb-4.18/gdb/valops.c	Sat Jun  3 20:50:11 2000
@@ -2356,6 +2356,12 @@
 	error ("Cannot take address of a method");
       else if (v == 0)
 	{
+          v = dereference_osptr(*argp);
+          if(!v) return NULL;
+          t = check_typedef(VALUE_TYPE(v));
+          v = search_struct_field(name, v, 0, t, 0);
+          if(v) return v;
+          
 	  if (TYPE_NFN_FIELDS (t))
 	    error ("There is no member or method named %s.", name);
 	  else
diff -P -x Makefile -x init.c -x version.c -x [txn]m.h -x config.* -x .gdbinit -x *.orig -x *.[ao] -x *~ -u tmp/gdb-4.18-orig/gdb/value.h gdb-4.18/gdb/value.h
--- tmp/gdb-4.18-orig/gdb/value.h	Sat Jun  3 18:32:51 2000
+++ gdb-4.18/gdb/value.h	Sat Jun  3 19:00:48 2000
@@ -565,4 +565,10 @@
 
 extern value_ptr value_allocate_space_in_inferior PARAMS ((int));
 
+/* from osptr.c */
+
+value_ptr
+dereference_osptr PARAMS ((value_ptr v));
+
+
 #endif	/* !defined (VALUE_H) */
