gdb/i386gnu-tdep.c - gdb

Global variables defined

Functions defined

Source code

  1. /* Target-dependent code for the GNU Hurd.
  2.    Copyright (C) 2002-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. #include "defs.h"
  15. #include "osabi.h"
  16. #include "solib-svr4.h"

  17. #include "i386-tdep.h"

  18. /* From <sys/ucontext.h>.  */
  19. static int i386gnu_gregset_reg_offset[] =
  20. {
  21.   11 * 4,                /* %eax */
  22.   10 * 4,                /* %ecx */
  23.   9 * 4,                /* %edx */
  24.   8 * 4,                /* %ebx */
  25.   17 * 4,                /* %uesp */
  26.   6 * 4,                /* %ebp */
  27.   5 * 4,                /* %esi */
  28.   4 * 4,                /* %edi */
  29.   14 * 4,                /* %eip */
  30.   16 * 4,                /* %efl */
  31.   15 * 4,                /* %cs */
  32.   18 * 4,                /* %ss */
  33.   3 * 4,                /* %ds */
  34.   2 * 4,                /* %es */
  35.   1 * 4,                /* %fs */
  36.   0 * 4,                /* %gs */
  37. };

  38. static void
  39. i386gnu_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
  40. {
  41.   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);

  42.   /* GNU uses ELF.  */
  43.   i386_elf_init_abi (info, gdbarch);

  44.   set_solib_svr4_fetch_link_map_offsets
  45.     (gdbarch, svr4_ilp32_fetch_link_map_offsets);

  46.   tdep->gregset_reg_offset = i386gnu_gregset_reg_offset;
  47.   tdep->gregset_num_regs = ARRAY_SIZE (i386gnu_gregset_reg_offset);
  48.   tdep->sizeof_gregset = 19 * 4;

  49.   tdep->jb_pc_offset = 20;        /* From <bits/setjmp.h>.  */
  50. }

  51. /* Provide a prototype to silence -Wmissing-prototypes.  */
  52. extern void _initialize_i386gnu_tdep (void);

  53. void
  54. _initialize_i386gnu_tdep (void)
  55. {
  56.   gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_HURD, i386gnu_init_abi);
  57. }