604 static bool find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
605 size_t syms_len);
606
607 // Find agent entry point
608 static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib,
609 const char *syms[], size_t syms_len);
610
611 // Print out system information; they are called by fatal error handler.
612 // Output format may be different on different platforms.
613 static void print_os_info(outputStream* st);
614 static void print_os_info_brief(outputStream* st);
615 static void print_cpu_info(outputStream* st);
616 static void pd_print_cpu_info(outputStream* st);
617 static void print_memory_info(outputStream* st);
618 static void print_dll_info(outputStream* st);
619 static void print_environment_variables(outputStream* st, const char** env_list, char* buffer, int len);
620 static void print_context(outputStream* st, void* context);
621 static void print_register_info(outputStream* st, void* context);
622 static void print_siginfo(outputStream* st, void* siginfo);
623 static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
624 static void print_date_and_time(outputStream* st);
625
626 static void print_location(outputStream* st, intptr_t x, bool verbose = false);
627 static size_t lasterror(char *buf, size_t len);
628 static int get_last_error();
629
630 // Determines whether the calling process is being debugged by a user-mode debugger.
631 static bool is_debugger_attached();
632
633 // wait for a key press if PauseAtExit is set
634 static void wait_for_keypress_at_exit(void);
635
636 // The following two functions are used by fatal error handler to trace
637 // native (C) frames. They are not part of frame.hpp/frame.cpp because
638 // frame.hpp/cpp assume thread is JavaThread, and also because different
639 // OS/compiler may have different convention or provide different API to
640 // walk C frames.
641 //
642 // We don't attempt to become a debugger, so we only follow frames if that
643 // does not require a lookup in the unwind table, which is part of the binary
644 // file but may be unsafe to read after a fatal error. So on x86, we can
|
604 static bool find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
605 size_t syms_len);
606
607 // Find agent entry point
608 static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib,
609 const char *syms[], size_t syms_len);
610
611 // Print out system information; they are called by fatal error handler.
612 // Output format may be different on different platforms.
613 static void print_os_info(outputStream* st);
614 static void print_os_info_brief(outputStream* st);
615 static void print_cpu_info(outputStream* st);
616 static void pd_print_cpu_info(outputStream* st);
617 static void print_memory_info(outputStream* st);
618 static void print_dll_info(outputStream* st);
619 static void print_environment_variables(outputStream* st, const char** env_list, char* buffer, int len);
620 static void print_context(outputStream* st, void* context);
621 static void print_register_info(outputStream* st, void* context);
622 static void print_siginfo(outputStream* st, void* siginfo);
623 static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
624 static void print_date_and_time(outputStream* st, char* buf, size_t buflen);
625
626 static void print_location(outputStream* st, intptr_t x, bool verbose = false);
627 static size_t lasterror(char *buf, size_t len);
628 static int get_last_error();
629
630 // Determines whether the calling process is being debugged by a user-mode debugger.
631 static bool is_debugger_attached();
632
633 // wait for a key press if PauseAtExit is set
634 static void wait_for_keypress_at_exit(void);
635
636 // The following two functions are used by fatal error handler to trace
637 // native (C) frames. They are not part of frame.hpp/frame.cpp because
638 // frame.hpp/cpp assume thread is JavaThread, and also because different
639 // OS/compiler may have different convention or provide different API to
640 // walk C frames.
641 //
642 // We don't attempt to become a debugger, so we only follow frames if that
643 // does not require a lookup in the unwind table, which is part of the binary
644 // file but may be unsafe to read after a fatal error. So on x86, we can
|