|
From: <sv...@va...> - 2005-09-20 18:10:38
|
Author: sewardj
Date: 2005-09-20 19:10:33 +0100 (Tue, 20 Sep 2005)
New Revision: 4706
Log:
Prettify the printing of huge numbers when showing the segment array.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
Modified: branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 17:42:4=
5 UTC (rev 4705)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 18:10:3=
3 UTC (rev 4706)
@@ -38,8 +38,7 @@
=20
#include "pub_core_debuglog.h" // VG_(debugLog)
=20
-#include "pub_core_libcbase.h" // TODO: rm
- // VG_(strlen), VG_(strcmp)
+#include "pub_core_libcbase.h" // VG_(strlen), VG_(strcmp)
// VG_IS_PAGE_ALIGNED
// VG_PGROUNDDN, VG_PGROUNDUP
=20
@@ -468,12 +467,26 @@
{
HChar* fmt;
ULong a =3D (ULong)aA;
- if (a >=3D 10000000ULL) {
+
+ if (a < 10*1000*1000ULL) {
+ fmt =3D "%7llu";
+ }=20
+ else if (a < 999999ULL * (1ULL<<20)) {
fmt =3D "%6llum";
- a /=3D 1024*1024ULL;
- } else {
- fmt =3D "%7llu";
+ a >>=3D 20;
}
+ else if (a < 999999ULL * (1ULL<<30)) {
+ fmt =3D "%6llug";
+ a >>=3D 30;
+ }
+ else if (a < 999999ULL * (1ULL<<40)) {
+ fmt =3D "%6llut";
+ a >>=3D 40;
+ }
+ else {
+ fmt =3D "%6llue";
+ a >>=3D 50;
+ }
aspacem_sprintf(buf, fmt, a);
}
=20
@@ -511,7 +524,7 @@
case SkFree:
VG_(debugLog)(
logLevel, "aspacem",
- "%3d: %s %08llx-%08llx %s\n",
+ "%3d: %s %010llx-%010llx %s\n",
segNo, show_SegKind(seg->kind),
(ULong)seg->start, (ULong)seg->end, len_buf
);
@@ -520,7 +533,7 @@
case SkAnonC: case SkAnonV:
VG_(debugLog)(
logLevel, "aspacem",
- "%3d: %s %08llx-%08llx %s %c%c%c%c\n",
+ "%3d: %s %010llx-%010llx %s %c%c%c%c\n",
segNo, show_SegKind(seg->kind),
(ULong)seg->start, (ULong)seg->end, len_buf,
seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-',=20
@@ -531,7 +544,7 @@
case SkFileC: case SkFileV:
VG_(debugLog)(
logLevel, "aspacem",
- "%3d: %s %08llx-%08llx %s %c%c%c%c d=3D0x%03llx "
+ "%3d: %s %010llx-%010llx %s %c%c%c%c d=3D0x%03llx "
"i=3D%-7lld o=3D%-7lld (%d)\n",
segNo, show_SegKind(seg->kind),
(ULong)seg->start, (ULong)seg->end, len_buf,
@@ -544,7 +557,7 @@
case SkResvn:
VG_(debugLog)(
logLevel, "aspacem",
- "%3d: %s %08llx-%08llx %s %c%c%c%c %s\n",
+ "%3d: %s %010llx-%010llx %s %c%c%c%c %s\n",
segNo, show_SegKind(seg->kind),
(ULong)seg->start, (ULong)seg->end, len_buf,
seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-',=20
@@ -1343,19 +1356,19 @@
aspacem_assert(VG_IS_PAGE_ALIGNED(suggested_clstack_top + 1));
=20
VG_(debugLog)(2, "aspacem",=20
- " minAddr =3D 0x%08llx (computed)\n",=20
+ " minAddr =3D 0x%010llx (computed)\n",=20
(ULong)aspacem_minAddr);
VG_(debugLog)(2, "aspacem",=20
- " maxAddr =3D 0x%08llx (computed)\n",=20
+ " maxAddr =3D 0x%010llx (computed)\n",=20
(ULong)aspacem_maxAddr);
VG_(debugLog)(2, "aspacem",=20
- " cStart =3D 0x%08llx (computed)\n",=20
+ " cStart =3D 0x%010llx (computed)\n",=20
(ULong)aspacem_cStart);
VG_(debugLog)(2, "aspacem",=20
- " vStart =3D 0x%08llx (computed)\n",=20
+ " vStart =3D 0x%010llx (computed)\n",=20
(ULong)aspacem_vStart);
VG_(debugLog)(2, "aspacem",=20
- "suggested_clstack_top =3D 0x%08llx (computed)\n",=20
+ "suggested_clstack_top =3D 0x%010llx (computed)\n",=20
(ULong)suggested_clstack_top);
=20
if (aspacem_cStart > Addr_MIN) {
|