comparison src/os_cpu/windows_x86/vm/os_windows_x86.cpp @ 1907:1e9a9d2e6509

6970683: improvements to hs_err output Reviewed-by: kvn, jrose, dholmes, coleenp
author never
date Thu, 21 Oct 2010 11:55:10 -0700
parents 3e8fbc61cee8
children f95d63e2154a
comparison
equal deleted inserted replaced
1906:f8aaf8522a6b 1907:1e9a9d2e6509
385 st->print( "RSP=" INTPTR_FORMAT, uc->Rsp); 385 st->print( "RSP=" INTPTR_FORMAT, uc->Rsp);
386 st->print(", RBP=" INTPTR_FORMAT, uc->Rbp); 386 st->print(", RBP=" INTPTR_FORMAT, uc->Rbp);
387 st->print(", RSI=" INTPTR_FORMAT, uc->Rsi); 387 st->print(", RSI=" INTPTR_FORMAT, uc->Rsi);
388 st->print(", RDI=" INTPTR_FORMAT, uc->Rdi); 388 st->print(", RDI=" INTPTR_FORMAT, uc->Rdi);
389 st->cr(); 389 st->cr();
390 st->print( "R8=" INTPTR_FORMAT, uc->R8); 390 st->print( "R8 =" INTPTR_FORMAT, uc->R8);
391 st->print(", R9=" INTPTR_FORMAT, uc->R9); 391 st->print(", R9 =" INTPTR_FORMAT, uc->R9);
392 st->print(", R10=" INTPTR_FORMAT, uc->R10); 392 st->print(", R10=" INTPTR_FORMAT, uc->R10);
393 st->print(", R11=" INTPTR_FORMAT, uc->R11); 393 st->print(", R11=" INTPTR_FORMAT, uc->R11);
394 st->cr(); 394 st->cr();
395 st->print( "R12=" INTPTR_FORMAT, uc->R12); 395 st->print( "R12=" INTPTR_FORMAT, uc->R12);
396 st->print(", R13=" INTPTR_FORMAT, uc->R13); 396 st->print(", R13=" INTPTR_FORMAT, uc->R13);
397 st->print(", R14=" INTPTR_FORMAT, uc->R14); 397 st->print(", R14=" INTPTR_FORMAT, uc->R14);
398 st->print(", R15=" INTPTR_FORMAT, uc->R15); 398 st->print(", R15=" INTPTR_FORMAT, uc->R15);
399 st->cr(); 399 st->cr();
400 st->print( "RIP=" INTPTR_FORMAT, uc->Rip); 400 st->print( "RIP=" INTPTR_FORMAT, uc->Rip);
401 st->print(", EFLAGS=" INTPTR_FORMAT, uc->EFlags); 401 st->print(", EFLAGS=" INTPTR_FORMAT, uc->EFlags);
402
403 st->cr();
404 st->cr();
405
406 st->print_cr("Register to memory mapping:");
407 st->cr();
408
409 // this is only for the "general purpose" registers
410
411 st->print_cr("RAX=" INTPTR_FORMAT, uc->Rax);
412 print_location(st, uc->Rax);
413 st->cr();
414 st->print_cr("RBX=" INTPTR_FORMAT, uc->Rbx);
415 print_location(st, uc->Rbx);
416 st->cr();
417 st->print_cr("RCX=" INTPTR_FORMAT, uc->Rcx);
418 print_location(st, uc->Rcx);
419 st->cr();
420 st->print_cr("RDX=" INTPTR_FORMAT, uc->Rdx);
421 print_location(st, uc->Rdx);
422 st->cr();
423 st->print_cr("RSP=" INTPTR_FORMAT, uc->Rsp);
424 print_location(st, uc->Rsp);
425 st->cr();
426 st->print_cr("RBP=" INTPTR_FORMAT, uc->Rbp);
427 print_location(st, uc->Rbp);
428 st->cr();
429 st->print_cr("RSI=" INTPTR_FORMAT, uc->Rsi);
430 print_location(st, uc->Rsi);
431 st->cr();
432 st->print_cr("RDI=" INTPTR_FORMAT, uc->Rdi);
433 print_location(st, uc->Rdi);
434 st->cr();
435 st->print_cr("R8 =" INTPTR_FORMAT, uc->R8);
436 print_location(st, uc->R8);
437 st->cr();
438 st->print_cr("R9 =" INTPTR_FORMAT, uc->R9);
439 print_location(st, uc->R9);
440 st->cr();
441 st->print_cr("R10=" INTPTR_FORMAT, uc->R10);
442 print_location(st, uc->R10);
443 st->cr();
444 st->print_cr("R11=" INTPTR_FORMAT, uc->R11);
445 print_location(st, uc->R11);
446 st->cr();
447 st->print_cr("R12=" INTPTR_FORMAT, uc->R12);
448 print_location(st, uc->R12);
449 st->cr();
450 st->print_cr("R13=" INTPTR_FORMAT, uc->R13);
451 print_location(st, uc->R13);
452 st->cr();
453 st->print_cr("R14=" INTPTR_FORMAT, uc->R14);
454 print_location(st, uc->R14);
455 st->cr();
456 st->print_cr("R15=" INTPTR_FORMAT, uc->R15);
457 print_location(st, uc->R15);
458 #else 402 #else
459 st->print( "EAX=" INTPTR_FORMAT, uc->Eax); 403 st->print( "EAX=" INTPTR_FORMAT, uc->Eax);
460 st->print(", EBX=" INTPTR_FORMAT, uc->Ebx); 404 st->print(", EBX=" INTPTR_FORMAT, uc->Ebx);
461 st->print(", ECX=" INTPTR_FORMAT, uc->Ecx); 405 st->print(", ECX=" INTPTR_FORMAT, uc->Ecx);
462 st->print(", EDX=" INTPTR_FORMAT, uc->Edx); 406 st->print(", EDX=" INTPTR_FORMAT, uc->Edx);
466 st->print(", ESI=" INTPTR_FORMAT, uc->Esi); 410 st->print(", ESI=" INTPTR_FORMAT, uc->Esi);
467 st->print(", EDI=" INTPTR_FORMAT, uc->Edi); 411 st->print(", EDI=" INTPTR_FORMAT, uc->Edi);
468 st->cr(); 412 st->cr();
469 st->print( "EIP=" INTPTR_FORMAT, uc->Eip); 413 st->print( "EIP=" INTPTR_FORMAT, uc->Eip);
470 st->print(", EFLAGS=" INTPTR_FORMAT, uc->EFlags); 414 st->print(", EFLAGS=" INTPTR_FORMAT, uc->EFlags);
471
472 st->cr();
473 st->cr();
474
475 st->print_cr("Register to memory mapping:");
476 st->cr();
477
478 // this is only for the "general purpose" registers
479
480 st->print_cr("EAX=" INTPTR_FORMAT, uc->Eax);
481 print_location(st, uc->Eax);
482 st->cr();
483 st->print_cr("EBX=" INTPTR_FORMAT, uc->Ebx);
484 print_location(st, uc->Ebx);
485 st->cr();
486 st->print_cr("ECX=" INTPTR_FORMAT, uc->Ecx);
487 print_location(st, uc->Ecx);
488 st->cr();
489 st->print_cr("EDX=" INTPTR_FORMAT, uc->Edx);
490 print_location(st, uc->Edx);
491 st->cr();
492 st->print_cr("ESP=" INTPTR_FORMAT, uc->Esp);
493 print_location(st, uc->Esp);
494 st->cr();
495 st->print_cr("EBP=" INTPTR_FORMAT, uc->Ebp);
496 print_location(st, uc->Ebp);
497 st->cr();
498 st->print_cr("ESI=" INTPTR_FORMAT, uc->Esi);
499 print_location(st, uc->Esi);
500 st->cr();
501 st->print_cr("EDI=" INTPTR_FORMAT, uc->Edi);
502 print_location(st, uc->Edi);
503 #endif // AMD64 415 #endif // AMD64
504 st->cr(); 416 st->cr();
505 st->cr(); 417 st->cr();
506 418
507 intptr_t *sp = (intptr_t *)uc->REG_SP; 419 intptr_t *sp = (intptr_t *)uc->REG_SP;
512 // Note: it may be unsafe to inspect memory near pc. For example, pc may 424 // Note: it may be unsafe to inspect memory near pc. For example, pc may
513 // point to garbage if entry point in an nmethod is corrupted. Leave 425 // point to garbage if entry point in an nmethod is corrupted. Leave
514 // this at the end, and hope for the best. 426 // this at the end, and hope for the best.
515 address pc = (address)uc->REG_PC; 427 address pc = (address)uc->REG_PC;
516 st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc); 428 st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
517 print_hex_dump(st, pc - 16, pc + 16, sizeof(char)); 429 print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
430 st->cr();
431 }
432
433
434 void os::print_register_info(outputStream *st, void *context) {
435 if (context == NULL) return;
436
437 CONTEXT* uc = (CONTEXT*)context;
438
439 st->print_cr("Register to memory mapping:");
440 st->cr();
441
442 // this is only for the "general purpose" registers
443
444 #ifdef AMD64
445 st->print("RAX="); print_location(st, uc->Rax);
446 st->print("RBX="); print_location(st, uc->Rbx);
447 st->print("RCX="); print_location(st, uc->Rcx);
448 st->print("RDX="); print_location(st, uc->Rdx);
449 st->print("RSP="); print_location(st, uc->Rsp);
450 st->print("RBP="); print_location(st, uc->Rbp);
451 st->print("RSI="); print_location(st, uc->Rsi);
452 st->print("RDI="); print_location(st, uc->Rdi);
453 st->print("R8 ="); print_location(st, uc->R8);
454 st->print("R9 ="); print_location(st, uc->R9);
455 st->print("R10="); print_location(st, uc->R10);
456 st->print("R11="); print_location(st, uc->R11);
457 st->print("R12="); print_location(st, uc->R12);
458 st->print("R13="); print_location(st, uc->R13);
459 st->print("R14="); print_location(st, uc->R14);
460 st->print("R15="); print_location(st, uc->R15);
461 #else
462 st->print("EAX="); print_location(st, uc->Eax);
463 st->print("EBX="); print_location(st, uc->Ebx);
464 st->print("ECX="); print_location(st, uc->Ecx);
465 st->print("EDX="); print_location(st, uc->Edx);
466 st->print("ESP="); print_location(st, uc->Esp);
467 st->print("EBP="); print_location(st, uc->Ebp);
468 st->print("ESI="); print_location(st, uc->Esi);
469 st->print("EDI="); print_location(st, uc->Edi);
470 #endif
471
518 st->cr(); 472 st->cr();
519 } 473 }
520 474
521 extern "C" int SafeFetch32 (int * adr, int Err) { 475 extern "C" int SafeFetch32 (int * adr, int Err) {
522 int rv = Err ; 476 int rv = Err ;