gdb/gdbserver/gdb_proc_service.h - gdb

Data types defined

Macros defined

Source code

  1. /* <proc_service.h> replacement for systems that don't have it.
  2.    Copyright (C) 2000-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #ifndef GDB_PROC_SERVICE_H
  15. #define GDB_PROC_SERVICE_H

  16. #include <sys/types.h>

  17. #ifdef HAVE_PROC_SERVICE_H
  18. #include <proc_service.h>
  19. #else

  20. #ifdef HAVE_SYS_PROCFS_H
  21. #include <sys/procfs.h>
  22. #endif

  23. /* Not all platforms bring in <linux/elf.h> via <sys/procfs.h>.  If
  24.    <sys/procfs.h> wasn't enough to find elf_fpregset_t, try the kernel
  25.    headers also (but don't if we don't need to).  */
  26. #ifndef HAVE_ELF_FPREGSET_T
  27. # ifdef HAVE_LINUX_ELF_H
  28. #  include <linux/elf.h>
  29. # endif
  30. #endif

  31. typedef enum
  32. {
  33.   PS_OK,                        /* Success.  */
  34.   PS_ERR,                        /* Generic error.  */
  35.   PS_BADPID,                        /* Bad process handle.  */
  36.   PS_BADLID,                        /* Bad LWP id.  */
  37.   PS_BADADDR,                        /* Bad address.  */
  38.   PS_NOSYM,                        /* Symbol not found.  */
  39.   PS_NOFREGS                        /* FPU register set not available.  */
  40. } ps_err_e;

  41. #ifndef HAVE_LWPID_T
  42. typedef unsigned int lwpid_t;
  43. #endif

  44. #ifndef HAVE_PSADDR_T
  45. typedef void *psaddr_t;
  46. #endif

  47. #ifndef HAVE_PRGREGSET_T
  48. typedef elf_gregset_t prgregset_t;
  49. #endif

  50. #endif /* HAVE_PROC_SERVICE_H */

  51. /* Structure that identifies the target process.  */
  52. struct ps_prochandle
  53. {
  54.   /* We don't need to track anything.  All context is served from the
  55.      current inferior.  */
  56. };

  57. #endif /* gdb_proc_service.h */