print more of the stack map when DebugFrameMaps is enabled

This commit is contained in:
Joel Dice 2012-12-12 16:04:26 -07:00
parent 663d8da975
commit 7b07b5b9a3

View File

@ -6595,11 +6595,11 @@ translateLineNumberTable(MyThread* t, Context* context, intptr_t start)
} }
void void
printSet(uintptr_t m, unsigned limit) printSet(uintptr_t* m, unsigned limit)
{ {
if (limit) { if (limit) {
for (unsigned i = 0; i < 16; ++i) { for (unsigned i = 0; i < 32; ++i) {
if ((m >> i) & 1) { if ((*m >> i) & 1) {
fprintf(stderr, "1"); fprintf(stderr, "1");
} else { } else {
fprintf(stderr, "_"); fprintf(stderr, "_");
@ -6643,7 +6643,7 @@ calculateTryCatchRoots(Context* context, SubroutinePath* subroutinePath,
if (traceRoots) { if (traceRoots) {
if (DebugFrameMaps) { if (DebugFrameMaps) {
fprintf(stderr, " use roots at ip %3d: ", te->ip); fprintf(stderr, " use roots at ip %3d: ", te->ip);
printSet(*traceRoots, mapSize); printSet(traceRoots, mapSize);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }
@ -6660,7 +6660,7 @@ calculateTryCatchRoots(Context* context, SubroutinePath* subroutinePath,
if (DebugFrameMaps) { if (DebugFrameMaps) {
fprintf(stderr, "result roots : "); fprintf(stderr, "result roots : ");
printSet(*roots, mapSize); printSet(roots, mapSize);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }
} }
@ -6714,7 +6714,7 @@ calculateFrameMaps(MyThread* t, Context* context, uintptr_t* originalRoots,
if (DebugFrameMaps) { if (DebugFrameMaps) {
fprintf(stderr, " roots at ip %3d: ", ip); fprintf(stderr, " roots at ip %3d: ", ip);
printSet(*RUNTIME_ARRAY_BODY(roots), mapSize); printSet(RUNTIME_ARRAY_BODY(roots), mapSize);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }
@ -6743,7 +6743,7 @@ calculateFrameMaps(MyThread* t, Context* context, uintptr_t* originalRoots,
if (DebugFrameMaps) { if (DebugFrameMaps) {
fprintf(stderr, " table roots at ip %3d: ", ip); fprintf(stderr, " table roots at ip %3d: ", ip);
printSet(*tableRoots, mapSize); printSet(tableRoots, mapSize);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }
} else { } else {
@ -6797,7 +6797,7 @@ calculateFrameMaps(MyThread* t, Context* context, uintptr_t* originalRoots,
TraceElement* te; context->eventLog.get(eventIndex, &te, BytesPerWord); TraceElement* te; context->eventLog.get(eventIndex, &te, BytesPerWord);
if (DebugFrameMaps) { if (DebugFrameMaps) {
fprintf(stderr, " trace roots at ip %3d: ", ip); fprintf(stderr, " trace roots at ip %3d: ", ip);
printSet(*RUNTIME_ARRAY_BODY(roots), mapSize); printSet(RUNTIME_ARRAY_BODY(roots), mapSize);
if (subroutinePath) { if (subroutinePath) {
fprintf(stderr, " "); fprintf(stderr, " ");
print(subroutinePath); print(subroutinePath);
@ -6896,7 +6896,7 @@ calculateFrameMaps(MyThread* t, Context* context, uintptr_t* originalRoots,
if (resultRoots and ip != -1) { if (resultRoots and ip != -1) {
if (DebugFrameMaps) { if (DebugFrameMaps) {
fprintf(stderr, "result roots at ip %3d: ", ip); fprintf(stderr, "result roots at ip %3d: ", ip);
printSet(*RUNTIME_ARRAY_BODY(roots), mapSize); printSet(RUNTIME_ARRAY_BODY(roots), mapSize);
if (subroutinePath) { if (subroutinePath) {
fprintf(stderr, " "); fprintf(stderr, " ");
print(subroutinePath); print(subroutinePath);
@ -6965,7 +6965,7 @@ copyFrameMap(int32_t* dst, uintptr_t* src, unsigned mapSizeInBits,
{ {
if (DebugFrameMaps) { if (DebugFrameMaps) {
fprintf(stderr, " orig roots at ip %3d: ", p->ip); fprintf(stderr, " orig roots at ip %3d: ", p->ip);
printSet(src[0], ceiling(mapSizeInBits, BitsPerWord)); printSet(src, ceiling(mapSizeInBits, BitsPerWord));
print(subroutinePath); print(subroutinePath);
fprintf(stderr, "\n"); fprintf(stderr, "\n");