aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1996-06-12 03:10:51 +0000
committerFred Fish <fnf@specifix.com>1996-06-12 03:10:51 +0000
commit9d111656709c46875095e54548a846906e61cc00 (patch)
treefc869ddb51fd481e52096c2dd76fa739a05b2245 /gdb
parenta5c7acea2fd3fd603e5d7e3f314e2228dc7012a8 (diff)
downloadgdb-9d111656709c46875095e54548a846906e61cc00.zip
gdb-9d111656709c46875095e54548a846906e61cc00.tar.gz
gdb-9d111656709c46875095e54548a846906e61cc00.tar.bz2
From Michael Snyder <Michael_Snyder@next.com>:
* bcache.c (print_bcache_statistics): Avoid divide-by-zero exception if one or more objfile has no symbols, such as when a dynamic library has been stripped.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog15
-rw-r--r--gdb/bcache.c32
2 files changed, 43 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index af4e03a..ec644c7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,18 @@
+Tue Jun 11 19:52:50 1996 Fred Fish <fnf@cygnus.com>
+
+ From Michael Snyder <Michael_Snyder@next.com>:
+ * bcache.c (print_bcache_statistics): Avoid divide-by-zero
+ exception if one or more objfile has no symbols, such as when
+ a dynamic library has been stripped.
+
+Tue Jun 11 12:02:55 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * Makefile.in (INTERNAL_LDFLAGS): Add in flags from configure.
+ * configure configure.in: Only make sol-thread.o for native.
+ Also, switch to dlopened libthread_db.so.1.
+ * sol-thread.c: Switch to using dlopen to get the thread_db
+ library.
+
Mon Jun 10 14:17:19 1996 Fred Fish <fnf@cygnus.com>
* config/sparc/{xm-sun4sol2.h,xm-sun4os4.h} (MMAP_BASE_ADDRESS):
diff --git a/gdb/bcache.c b/gdb/bcache.c
index ae73c11..ede908b 100644
--- a/gdb/bcache.c
+++ b/gdb/bcache.c
@@ -173,16 +173,40 @@ print_bcache_statistics (bcachep, id)
printf_filtered (" Cached '%s' statistics:\n", id);
printf_filtered (" Cache hits: %d\n", bcachep -> cache_hits);
printf_filtered (" Cache misses: %d\n", bcachep -> cache_misses);
- printf_filtered (" Cache hit ratio: %d%%\n", ((bcachep -> cache_hits) * 100) / (bcachep -> cache_hits + bcachep -> cache_misses));
+ printf_filtered (" Cache hit ratio: ");
+ if (bcachep -> cache_hits + bcachep -> cache_misses > 0)
+ {
+ printf_filtered ("%d%%\n", ((bcachep -> cache_hits) * 100) /
+ (bcachep -> cache_hits + bcachep -> cache_misses));
+ }
+ else
+ {
+ printf_filtered ("(not applicable)\n");
+ }
printf_filtered (" Space used for caching: %d\n", bcachep -> cache_bytes);
printf_filtered (" Space saved by cache hits: %d\n", bcachep -> cache_savings);
printf_filtered (" Number of bcache overflows: %d\n", bcachep -> bcache_overflows);
printf_filtered (" Number of index buckets used: %d\n", tcount);
printf_filtered (" Number of hash table buckets used: %d\n", hcount);
printf_filtered (" Number of chained items: %d\n", lcount);
- printf_filtered (" Average hash table population: %d%%\n",
- (hcount * 100) / (tcount * BCACHE_HASHSIZE));
- printf_filtered (" Average chain length %d\n", lcount / hcount);
+ printf_filtered (" Average hash table population: ");
+ if (tcount > 0)
+ {
+ printf_filtered ("%d%%\n", (hcount * 100) / (tcount * BCACHE_HASHSIZE));
+ }
+ else
+ {
+ printf_filtered ("(not applicable)\n");
+ }
+ printf_filtered (" Average chain length ");
+ if (hcount > 0)
+ {
+ printf_filtered ("%d\n", lcount / hcount);
+ }
+ else
+ {
+ printf_filtered ("(not applicable)\n");
+ }
printf_filtered (" Maximum chain length %d at %d:%d\n", lmax, lmaxt, lmaxh);
}