< prev index next >

agent/src/os/solaris/proc/libproc.h

Print this page


   1 /*
   2  * Copyright (c) 2002, 2011, 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  *


 403  * all previous symbol table and address space mapping information.
 404  * It is always safe to call, but if it is called other than after an
 405  * exec() by the victim process it just causes unnecessary overhead.
 406  *
 407  * The rtld_db agent handle obtained from a previous call to Prd_agent() is
 408  * made invalid by Preset_maps() and Prd_agent() must be called again to get
 409  * the new handle.
 410  */
 411 extern void Preset_maps(struct ps_prochandle *);
 412 
 413 /*
 414  * Given an address, Ppltdest() determines if this is part of a PLT, and if
 415  * so returns the target address of this PLT entry and a flag indicating
 416  * whether or not this PLT entry has been bound by the run-time linker.
 417  */
 418 extern uintptr_t Ppltdest(struct ps_prochandle *, uintptr_t, int *);
 419 
 420 /*
 421  * Stack frame iteration interface.
 422  */
 423 #ifdef SOLARIS_11_B159_OR_LATER
 424 /* building on Nevada-B159 or later so define the new callback */
 425 typedef int proc_stack_f(
 426     void *,             /* the cookie given to Pstack_iter() */
 427     const prgregset_t,  /* the frame's registers */
 428     uint_t,             /* argc for the frame's function */
 429     const long *,       /* argv for the frame's function */
 430     int,                /* bitwise flags describing the frame (see below) */
 431     int);               /* a signal number */
 432 
 433 #define PR_SIGNAL_FRAME    1    /* called by a signal handler */
 434 #define PR_FOUND_SIGNAL    2    /* we found the corresponding signal number */
 435 #else
 436 /* building on Nevada-B158 or earlier so define the old callback */
 437 typedef int proc_stack_f(void *, const prgregset_t, uint_t, const long *);
 438 #endif
 439 
 440 extern int Pstack_iter(struct ps_prochandle *,
 441     const prgregset_t, proc_stack_f *, void *);
 442 
 443 /*
 444  * Compute the full pathname of a named directory without using chdir().
 445  * This is useful for dealing with /proc/<pid>/cwd.
 446  */
 447 extern char *proc_dirname(const char *, char *, size_t);
 448 
 449 /*
 450  * Remove unprintable characters from psinfo.pr_psargs and replace with
 451  * whitespace characters so it is safe for printing.
 452  */
 453 extern void proc_unctrl_psinfo(psinfo_t *);
 454 
 455 /*
 456  * Utility functions for processing arguments which should be /proc files,
 457  * pids, and/or core files.  The returned error code can be passed to
 458  * Pgrab_error() in order to convert it to an error string.


   1 /*
   2  * Copyright (c) 2002, 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  *


 403  * all previous symbol table and address space mapping information.
 404  * It is always safe to call, but if it is called other than after an
 405  * exec() by the victim process it just causes unnecessary overhead.
 406  *
 407  * The rtld_db agent handle obtained from a previous call to Prd_agent() is
 408  * made invalid by Preset_maps() and Prd_agent() must be called again to get
 409  * the new handle.
 410  */
 411 extern void Preset_maps(struct ps_prochandle *);
 412 
 413 /*
 414  * Given an address, Ppltdest() determines if this is part of a PLT, and if
 415  * so returns the target address of this PLT entry and a flag indicating
 416  * whether or not this PLT entry has been bound by the run-time linker.
 417  */
 418 extern uintptr_t Ppltdest(struct ps_prochandle *, uintptr_t, int *);
 419 
 420 /*
 421  * Stack frame iteration interface.
 422  */


 423 typedef int proc_stack_f(
 424     void *,             /* the cookie given to Pstack_iter() */
 425     const prgregset_t,  /* the frame's registers */
 426     uint_t,             /* argc for the frame's function */
 427     const long *,       /* argv for the frame's function */
 428     int,                /* bitwise flags describing the frame (see below) */
 429     int);               /* a signal number */
 430 
 431 #define PR_SIGNAL_FRAME    1    /* called by a signal handler */
 432 #define PR_FOUND_SIGNAL    2    /* we found the corresponding signal number */




 433 
 434 extern int Pstack_iter(struct ps_prochandle *,
 435     const prgregset_t, proc_stack_f *, void *);
 436 
 437 /*
 438  * Compute the full pathname of a named directory without using chdir().
 439  * This is useful for dealing with /proc/<pid>/cwd.
 440  */
 441 extern char *proc_dirname(const char *, char *, size_t);
 442 
 443 /*
 444  * Remove unprintable characters from psinfo.pr_psargs and replace with
 445  * whitespace characters so it is safe for printing.
 446  */
 447 extern void proc_unctrl_psinfo(psinfo_t *);
 448 
 449 /*
 450  * Utility functions for processing arguments which should be /proc files,
 451  * pids, and/or core files.  The returned error code can be passed to
 452  * Pgrab_error() in order to convert it to an error string.


< prev index next >