agent/src/os/bsd/libproc.h
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot-8003348 Cdiff agent/src/os/bsd/libproc.h

agent/src/os/bsd/libproc.h

Print this page
8003348: SA can not read core file on OS X

*** 1,7 **** /* ! * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 25,37 **** #ifndef _LIBPROC_H_ #define _LIBPROC_H_ #include <unistd.h> #include <stdint.h> #include <machine/reg.h> #include <proc_service.h> - #if defined(sparc) || defined(sparcv9) /* If _LP64 is defined ptrace.h should be taken from /usr/include/asm-sparc64 otherwise it should be from /usr/include/asm-sparc These two files define pt_regs structure differently --- 25,66 ---- #ifndef _LIBPROC_H_ #define _LIBPROC_H_ #include <unistd.h> #include <stdint.h> + #include <stdarg.h> + #include <stdio.h> + #include <stdlib.h> + #include <string.h> + #include <fcntl.h> + + #ifdef __APPLE__ + typedef enum ps_err_e { + PS_OK, PS_ERR, PS_BADPID, PS_BADLID, + PS_BADADDR, PS_NOSYM, PS_NOFREGS + } ps_err_e; + + #ifndef psaddr_t + #define psaddr_t uintptr_t + #endif + + #ifndef bool + typedef int bool; + #define true 1 + #define false 0 + #endif // bool + + #ifndef lwpid_t + #define lwpid_t uintptr_t + #endif + + #include <mach/thread_status.h> + #else // __APPLE__ + #include <elf.h> + #include <link.h> #include <machine/reg.h> #include <proc_service.h> #if defined(sparc) || defined(sparcv9) /* If _LP64 is defined ptrace.h should be taken from /usr/include/asm-sparc64 otherwise it should be from /usr/include/asm-sparc These two files define pt_regs structure differently
*** 42,51 **** --- 71,88 ---- #include "asm-sparc/ptrace.h" #endif #endif //sparc or sparcv9 + // This C bool type must be int for compatibility with BSD calls and + // it would be a mistake to equivalence it to C++ bool on many platforms + typedef int bool; + #define true 1 + #define false 0 + + #endif // __APPLE__ + /************************************************************************************ 0. This is very minimal subset of Solaris libproc just enough for current application. Please note that the bulk of the functionality is from proc_service interface. This adds Pgrab__ and some missing stuff. We hide the difference b/w live process and core
*** 70,86 **** 5. for core file, we parse ELF files and read data from them. For processes we use combination of ptrace and /proc calls. *************************************************************************************/ ! // This C bool type must be int for compatibility with BSD calls and ! // it would be a mistake to equivalence it to C++ bool on many platforms ! ! typedef int bool; ! #define true 1 ! #define false 0 ! struct ps_prochandle; // attach to a process struct ps_prochandle* Pgrab(pid_t pid); --- 107,117 ---- 5. for core file, we parse ELF files and read data from them. For processes we use combination of ptrace and /proc calls. *************************************************************************************/ ! struct reg; struct ps_prochandle; // attach to a process struct ps_prochandle* Pgrab(pid_t pid);
agent/src/os/bsd/libproc.h
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File