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