equal
deleted
inserted
replaced
357 * |
357 * |
358 * So it's not possible to print the native stack using the |
358 * So it's not possible to print the native stack using the |
359 * while (...) {... fr = os::get_sender_for_C_frame(&fr); } |
359 * while (...) {... fr = os::get_sender_for_C_frame(&fr); } |
360 * loop in vmError.cpp. We need to roll our own loop. |
360 * loop in vmError.cpp. We need to roll our own loop. |
361 */ |
361 */ |
362 bool os::platform_print_native_stack(outputStream* st, void* context, |
362 bool os::platform_print_native_stack(outputStream* st, const void* context, |
363 char *buf, int buf_size) |
363 char *buf, int buf_size) |
364 { |
364 { |
365 CONTEXT ctx; |
365 CONTEXT ctx; |
366 if (context != NULL) { |
366 if (context != NULL) { |
367 memcpy(&ctx, context, sizeof(ctx)); |
367 memcpy(&ctx, context, sizeof(ctx)); |
433 |
433 |
434 return true; |
434 return true; |
435 } |
435 } |
436 #endif // AMD64 |
436 #endif // AMD64 |
437 |
437 |
438 ExtendedPC os::fetch_frame_from_context(void* ucVoid, |
438 ExtendedPC os::fetch_frame_from_context(const void* ucVoid, |
439 intptr_t** ret_sp, intptr_t** ret_fp) { |
439 intptr_t** ret_sp, intptr_t** ret_fp) { |
440 |
440 |
441 ExtendedPC epc; |
441 ExtendedPC epc; |
442 CONTEXT* uc = (CONTEXT*)ucVoid; |
442 CONTEXT* uc = (CONTEXT*)ucVoid; |
443 |
443 |
453 } |
453 } |
454 |
454 |
455 return epc; |
455 return epc; |
456 } |
456 } |
457 |
457 |
458 frame os::fetch_frame_from_context(void* ucVoid) { |
458 frame os::fetch_frame_from_context(const void* ucVoid) { |
459 intptr_t* sp; |
459 intptr_t* sp; |
460 intptr_t* fp; |
460 intptr_t* fp; |
461 ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, &fp); |
461 ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, &fp); |
462 return frame(sp, fp, epc.pc()); |
462 return frame(sp, fp, epc.pc()); |
463 } |
463 } |
525 } else { |
525 } else { |
526 return os::get_sender_for_C_frame(&myframe); |
526 return os::get_sender_for_C_frame(&myframe); |
527 } |
527 } |
528 } |
528 } |
529 |
529 |
530 void os::print_context(outputStream *st, void *context) { |
530 void os::print_context(outputStream *st, const void *context) { |
531 if (context == NULL) return; |
531 if (context == NULL) return; |
532 |
532 |
533 CONTEXT* uc = (CONTEXT*)context; |
533 const CONTEXT* uc = (const CONTEXT*)context; |
534 |
534 |
535 st->print_cr("Registers:"); |
535 st->print_cr("Registers:"); |
536 #ifdef AMD64 |
536 #ifdef AMD64 |
537 st->print( "RAX=" INTPTR_FORMAT, uc->Rax); |
537 st->print( "RAX=" INTPTR_FORMAT, uc->Rax); |
538 st->print(", RBX=" INTPTR_FORMAT, uc->Rbx); |
538 st->print(", RBX=" INTPTR_FORMAT, uc->Rbx); |
586 print_hex_dump(st, pc - 32, pc + 32, sizeof(char)); |
586 print_hex_dump(st, pc - 32, pc + 32, sizeof(char)); |
587 st->cr(); |
587 st->cr(); |
588 } |
588 } |
589 |
589 |
590 |
590 |
591 void os::print_register_info(outputStream *st, void *context) { |
591 void os::print_register_info(outputStream *st, const void *context) { |
592 if (context == NULL) return; |
592 if (context == NULL) return; |
593 |
593 |
594 CONTEXT* uc = (CONTEXT*)context; |
594 const CONTEXT* uc = (const CONTEXT*)context; |
595 |
595 |
596 st->print_cr("Register to memory mapping:"); |
596 st->print_cr("Register to memory mapping:"); |
597 st->cr(); |
597 st->cr(); |
598 |
598 |
599 // this is only for the "general purpose" registers |
599 // this is only for the "general purpose" registers |