579 static bool find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
580 size_t syms_len);
581
582 // Find agent entry point
583 static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib,
584 const char *syms[], size_t syms_len);
585
586 // Print out system information; they are called by fatal error handler.
587 // Output format may be different on different platforms.
588 static void print_os_info(outputStream* st);
589 static void print_os_info_brief(outputStream* st);
590 static void print_cpu_info(outputStream* st);
591 static void pd_print_cpu_info(outputStream* st);
592 static void print_memory_info(outputStream* st);
593 static void print_dll_info(outputStream* st);
594 static void print_environment_variables(outputStream* st, const char** env_list);
595 static void print_context(outputStream* st, void* context);
596 static void print_register_info(outputStream* st, void* context);
597 static void print_siginfo(outputStream* st, void* siginfo);
598 static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
599 static void print_date_and_time(outputStream* st);
600
601 static void print_location(outputStream* st, intptr_t x, bool verbose = false);
602 static size_t lasterror(char *buf, size_t len);
603 static int get_last_error();
604
605 // Determines whether the calling process is being debugged by a user-mode debugger.
606 static bool is_debugger_attached();
607
608 // wait for a key press if PauseAtExit is set
609 static void wait_for_keypress_at_exit(void);
610
611 // The following two functions are used by fatal error handler to trace
612 // native (C) frames. They are not part of frame.hpp/frame.cpp because
613 // frame.hpp/cpp assume thread is JavaThread, and also because different
614 // OS/compiler may have different convention or provide different API to
615 // walk C frames.
616 //
617 // We don't attempt to become a debugger, so we only follow frames if that
618 // does not require a lookup in the unwind table, which is part of the binary
619 // file but may be unsafe to read after a fatal error. So on x86, we can
|
579 static bool find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
580 size_t syms_len);
581
582 // Find agent entry point
583 static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib,
584 const char *syms[], size_t syms_len);
585
586 // Print out system information; they are called by fatal error handler.
587 // Output format may be different on different platforms.
588 static void print_os_info(outputStream* st);
589 static void print_os_info_brief(outputStream* st);
590 static void print_cpu_info(outputStream* st);
591 static void pd_print_cpu_info(outputStream* st);
592 static void print_memory_info(outputStream* st);
593 static void print_dll_info(outputStream* st);
594 static void print_environment_variables(outputStream* st, const char** env_list);
595 static void print_context(outputStream* st, void* context);
596 static void print_register_info(outputStream* st, void* context);
597 static void print_siginfo(outputStream* st, void* siginfo);
598 static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
599 static void print_date_and_time(outputStream* st, char* buf, size_t buflen);
600
601 static void print_location(outputStream* st, intptr_t x, bool verbose = false);
602 static size_t lasterror(char *buf, size_t len);
603 static int get_last_error();
604
605 // Determines whether the calling process is being debugged by a user-mode debugger.
606 static bool is_debugger_attached();
607
608 // wait for a key press if PauseAtExit is set
609 static void wait_for_keypress_at_exit(void);
610
611 // The following two functions are used by fatal error handler to trace
612 // native (C) frames. They are not part of frame.hpp/frame.cpp because
613 // frame.hpp/cpp assume thread is JavaThread, and also because different
614 // OS/compiler may have different convention or provide different API to
615 // walk C frames.
616 //
617 // We don't attempt to become a debugger, so we only follow frames if that
618 // does not require a lookup in the unwind table, which is part of the binary
619 // file but may be unsafe to read after a fatal error. So on x86, we can
|