1 /*
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
510 static bool is_interrupted(Thread* thread, bool clear_interrupted);
511
512 static int pd_self_suspend_thread(Thread* thread);
513
514 static ExtendedPC fetch_frame_from_context(void* ucVoid, intptr_t** sp, intptr_t** fp);
515 static frame fetch_frame_from_context(void* ucVoid);
516
517 static ExtendedPC get_thread_pc(Thread *thread);
518 static void breakpoint();
519
520 static address current_stack_pointer();
521 static address current_stack_base();
522 static size_t current_stack_size();
523
524 static void verify_stack_alignment() PRODUCT_RETURN;
525
526 static int message_box(const char* title, const char* message);
527 static char* do_you_want_to_debug(const char* message);
528
529 // run cmd in a separate process and return its exit code; or -1 on failures
530 static int fork_and_exec(char *cmd);
531
532 // os::exit() is merged with vm_exit()
533 // static void exit(int num);
534
535 // Terminate the VM, but don't exit the process
536 static void shutdown();
537
538 // Terminate with an error. Default is to generate a core file on platforms
539 // that support such things. This calls shutdown() and then aborts.
540 static void abort(bool dump_core = true);
541
542 // Die immediately, no exit hook, no abort hook, no cleanup.
543 static void die();
544
545 // File i/o operations
546 static const int default_file_open_flags();
547 static int open(const char *path, int oflag, int mode);
548 static FILE* open(int fd, const char* mode);
549 static int close(int fd);
550 static jlong lseek(int fd, jlong offset, int whence);
|
1 /*
2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
510 static bool is_interrupted(Thread* thread, bool clear_interrupted);
511
512 static int pd_self_suspend_thread(Thread* thread);
513
514 static ExtendedPC fetch_frame_from_context(void* ucVoid, intptr_t** sp, intptr_t** fp);
515 static frame fetch_frame_from_context(void* ucVoid);
516
517 static ExtendedPC get_thread_pc(Thread *thread);
518 static void breakpoint();
519
520 static address current_stack_pointer();
521 static address current_stack_base();
522 static size_t current_stack_size();
523
524 static void verify_stack_alignment() PRODUCT_RETURN;
525
526 static int message_box(const char* title, const char* message);
527 static char* do_you_want_to_debug(const char* message);
528
529 // run cmd in a separate process and return its exit code; or -1 on failures
530 static int fork_and_exec(char *cmd, bool use_vfork_if_available = false);
531
532 // os::exit() is merged with vm_exit()
533 // static void exit(int num);
534
535 // Terminate the VM, but don't exit the process
536 static void shutdown();
537
538 // Terminate with an error. Default is to generate a core file on platforms
539 // that support such things. This calls shutdown() and then aborts.
540 static void abort(bool dump_core = true);
541
542 // Die immediately, no exit hook, no abort hook, no cleanup.
543 static void die();
544
545 // File i/o operations
546 static const int default_file_open_flags();
547 static int open(const char *path, int oflag, int mode);
548 static FILE* open(int fd, const char* mode);
549 static int close(int fd);
550 static jlong lseek(int fd, jlong offset, int whence);
|