24907534 Xserver mdb module fails to load with symbol not found errors s12_111
authorAlan Coopersmith <Alan.Coopersmith@Oracle.COM>
Mon, 17 Oct 2016 23:19:45 -0700
changeset 1673 16162eea97d8
parent 1672 1b50d0ebe41a
child 1674 e2503e139dc0
24907534 Xserver mdb module fails to load with symbol not found errors
open-src/xserver/xorg/sun-src/os/solaris/mdb/modules/Xserver_clients.c
open-src/xserver/xorg/sun-src/os/solaris/mdb/modules/Xserver_device_grabs.c
--- a/open-src/xserver/xorg/sun-src/os/solaris/mdb/modules/Xserver_clients.c	Wed Oct 12 13:30:24 2016 -0700
+++ b/open-src/xserver/xorg/sun-src/os/solaris/mdb/modules/Xserver_clients.c	Mon Oct 17 23:19:45 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -48,6 +48,18 @@
     return NULL; /* compiler whines about not returning a value after abort() */
 }
 
+/* Just here to satisfy linkage from inlines in dixstruct.h
+   Should never ever be called from the module. */
+_X_HIDDEN void
+LogMessage(MessageType type, const char *format, ...)
+{
+    va_list ap;
+
+    va_start(ap, format);
+    mdb_vprintf(format, ap);
+    va_end(ap);
+}
+
 
 /*
  * Initialize the client walker by either using the given starting address,
@@ -266,9 +278,9 @@
 	    static GElf_Sym iaprivkey_sym;
 
 	    if ((iaprivkey_sym.st_value == 0) &&
-		(mdb_lookup_by_obj("libia.so", "IAPrivKeyRec", &iaprivkey_sym)
+		(mdb_lookup_by_name("IAPrivKeyRec", &iaprivkey_sym)
 		 == -1)) {
-		mdb_warn("failed to lookup 'libia.so`IAPrivKeyRec'");
+		mdb_warn("failed to lookup 'IAPrivKeyRec'");
 	    }
 
 	    if (iaprivkey_sym.st_value != 0) {
--- a/open-src/xserver/xorg/sun-src/os/solaris/mdb/modules/Xserver_device_grabs.c	Wed Oct 12 13:30:24 2016 -0700
+++ b/open-src/xserver/xorg/sun-src/os/solaris/mdb/modules/Xserver_device_grabs.c	Mon Oct 17 23:19:45 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -112,6 +112,37 @@
 	);
 }
 
+/*
+ * Functions required by resource.h to implement CLIENT_BITS macro below.
+ */
+
+static unsigned int
+ilog2(int val)
+{
+    int bits;
+
+    if (val <= 0)
+        return 0;
+    for (bits = 0; val != 0; bits++)
+        val >>= 1;
+    return bits - 1;
+}
+
+
+_X_HIDDEN unsigned int
+ResourceClientBits(void)
+{
+    int LimitClients;
+
+    if (mdb_readsym(&LimitClients, sizeof (LimitClients), "LimitClients") == -1)
+    {
+	mdb_warn("failed to read LimitClients");
+	LimitClients = LIMITCLIENTS;
+    }
+
+    return (ilog2(LimitClients));
+}
+
 _X_HIDDEN int
 inputdev_grabs(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
 {