Blame nptl_db/proc_service.h

Packit 6c4009
/* Callback interface for libthread_db, functions users must define.
Packit 6c4009
   Copyright (C) 1999-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _PROC_SERVICE_H
Packit 6c4009
#define _PROC_SERVICE_H 1
Packit 6c4009
Packit 6c4009
/* The definitions in this file must correspond to those in the debugger.  */
Packit 6c4009
#include <sys/procfs.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* Functions in this interface return one of these status codes.  */
Packit 6c4009
typedef enum
Packit 6c4009
{
Packit 6c4009
  PS_OK,		/* Generic "call succeeded".  */
Packit 6c4009
  PS_ERR,		/* Generic error. */
Packit 6c4009
  PS_BADPID,		/* Bad process handle.  */
Packit 6c4009
  PS_BADLID,		/* Bad LWP identifier.  */
Packit 6c4009
  PS_BADADDR,		/* Bad address.  */
Packit 6c4009
  PS_NOSYM,		/* Could not find given symbol.  */
Packit 6c4009
  PS_NOFREGS		/* FPU register set not available for given LWP.  */
Packit 6c4009
} ps_err_e;
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* This type is opaque in this interface.
Packit 6c4009
   It's defined by the user of libthread_db.  */
Packit 6c4009
struct ps_prochandle;
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Read or write process memory at the given address.  */
Packit 6c4009
extern ps_err_e ps_pdread (struct ps_prochandle *,
Packit 6c4009
			   psaddr_t, void *, size_t);
Packit 6c4009
extern ps_err_e ps_pdwrite (struct ps_prochandle *,
Packit 6c4009
			    psaddr_t, const void *, size_t);
Packit 6c4009
extern ps_err_e ps_ptread (struct ps_prochandle *,
Packit 6c4009
			   psaddr_t, void *, size_t);
Packit 6c4009
extern ps_err_e ps_ptwrite (struct ps_prochandle *,
Packit 6c4009
			    psaddr_t, const void *, size_t);
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Get and set the given LWP's general or FPU register set.  */
Packit 6c4009
extern ps_err_e ps_lgetregs (struct ps_prochandle *,
Packit 6c4009
			     lwpid_t, prgregset_t);
Packit 6c4009
extern ps_err_e ps_lsetregs (struct ps_prochandle *,
Packit 6c4009
			     lwpid_t, const prgregset_t);
Packit 6c4009
extern ps_err_e ps_lgetfpregs (struct ps_prochandle *,
Packit 6c4009
			       lwpid_t, prfpregset_t *);
Packit 6c4009
extern ps_err_e ps_lsetfpregs (struct ps_prochandle *,
Packit 6c4009
			       lwpid_t, const prfpregset_t *);
Packit 6c4009
Packit 6c4009
/* Return the PID of the process.  */
Packit 6c4009
extern pid_t ps_getpid (struct ps_prochandle *);
Packit 6c4009
Packit 6c4009
/* Fetch the special per-thread address associated with the given LWP.
Packit 6c4009
   This call is only used on a few platforms (most use a normal register).
Packit 6c4009
   The meaning of the `int' parameter is machine-dependent.  */
Packit 6c4009
extern ps_err_e ps_get_thread_area (struct ps_prochandle *,
Packit 6c4009
				    lwpid_t, int, psaddr_t *);
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Look up the named symbol in the named DSO in the symbol tables
Packit 6c4009
   associated with the process being debugged, filling in *SYM_ADDR
Packit 6c4009
   with the corresponding run-time address.  */
Packit 6c4009
extern ps_err_e ps_pglobal_lookup (struct ps_prochandle *,
Packit 6c4009
				   const char *object_name,
Packit 6c4009
				   const char *sym_name,
Packit 6c4009
				   psaddr_t *sym_addr);
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Stop or continue the entire process.  */
Packit 6c4009
extern ps_err_e ps_pstop (struct ps_prochandle *);
Packit 6c4009
extern ps_err_e ps_pcontinue (struct ps_prochandle *);
Packit 6c4009
Packit 6c4009
/* Stop or continue the given LWP alone.  */
Packit 6c4009
extern ps_err_e ps_lstop (struct ps_prochandle *, lwpid_t);
Packit 6c4009
extern ps_err_e ps_lcontinue (struct ps_prochandle *, lwpid_t);
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* proc_service.h */