475
476 // Unload library
477 static void dll_unload(void *lib);
478
479 // Print out system information; they are called by fatal error handler.
480 // Output format may be different on different platforms.
481 static void print_os_info(outputStream* st);
482 static void print_cpu_info(outputStream* st);
483 static void print_memory_info(outputStream* st);
484 static void print_dll_info(outputStream* st);
485 static void print_environment_variables(outputStream* st, const char** env_list, char* buffer, int len);
486 static void print_context(outputStream* st, void* context);
487 static void print_register_info(outputStream* st, void* context);
488 static void print_siginfo(outputStream* st, void* siginfo);
489 static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
490 static void print_date_and_time(outputStream* st);
491
492 static void print_location(outputStream* st, intptr_t x, bool verbose = false);
493 static size_t lasterror(char *buf, size_t len);
494
495 // The following two functions are used by fatal error handler to trace
496 // native (C) frames. They are not part of frame.hpp/frame.cpp because
497 // frame.hpp/cpp assume thread is JavaThread, and also because different
498 // OS/compiler may have different convention or provide different API to
499 // walk C frames.
500 //
501 // We don't attempt to become a debugger, so we only follow frames if that
502 // does not require a lookup in the unwind table, which is part of the binary
503 // file but may be unsafe to read after a fatal error. So on x86, we can
504 // only walk stack if %ebp is used as frame pointer; on ia64, it's not
505 // possible to walk C stack without having the unwind table.
506 static bool is_first_C_frame(frame *fr);
507 static frame get_sender_for_C_frame(frame *fr);
508
509 // return current frame. pc() and sp() are set to NULL on failure.
510 static frame current_frame();
511
512 static void print_hex_dump(outputStream* st, address start, address end, int unitsize);
513
514 // returns a string to describe the exception/signal;
|
475
476 // Unload library
477 static void dll_unload(void *lib);
478
479 // Print out system information; they are called by fatal error handler.
480 // Output format may be different on different platforms.
481 static void print_os_info(outputStream* st);
482 static void print_cpu_info(outputStream* st);
483 static void print_memory_info(outputStream* st);
484 static void print_dll_info(outputStream* st);
485 static void print_environment_variables(outputStream* st, const char** env_list, char* buffer, int len);
486 static void print_context(outputStream* st, void* context);
487 static void print_register_info(outputStream* st, void* context);
488 static void print_siginfo(outputStream* st, void* siginfo);
489 static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
490 static void print_date_and_time(outputStream* st);
491
492 static void print_location(outputStream* st, intptr_t x, bool verbose = false);
493 static size_t lasterror(char *buf, size_t len);
494
495 // Determines whether the calling process is being debugged by a user-mode debugger.
496 static bool is_debugger_attached();
497
498 // The following two functions are used by fatal error handler to trace
499 // native (C) frames. They are not part of frame.hpp/frame.cpp because
500 // frame.hpp/cpp assume thread is JavaThread, and also because different
501 // OS/compiler may have different convention or provide different API to
502 // walk C frames.
503 //
504 // We don't attempt to become a debugger, so we only follow frames if that
505 // does not require a lookup in the unwind table, which is part of the binary
506 // file but may be unsafe to read after a fatal error. So on x86, we can
507 // only walk stack if %ebp is used as frame pointer; on ia64, it's not
508 // possible to walk C stack without having the unwind table.
509 static bool is_first_C_frame(frame *fr);
510 static frame get_sender_for_C_frame(frame *fr);
511
512 // return current frame. pc() and sp() are set to NULL on failure.
513 static frame current_frame();
514
515 static void print_hex_dump(outputStream* st, address start, address end, int unitsize);
516
517 // returns a string to describe the exception/signal;
|