Code Search for Developers
 
 
  

amd64nbsd-nat.c from Gdb at Krugle


Show amd64nbsd-nat.c syntax highlighted

/* Native-dependent code for NetBSD/amd64.

   Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.

   This file is part of GDB.

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

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

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.  */

#include "defs.h"
#include "target.h"

#include "gdb_assert.h"

#include "amd64-tdep.h"
#include "amd64-nat.h"

/* Mapping between the general-purpose registers in NetBSD/amd64
   `struct reg' format and GDB's register cache layout for
   NetBSD/i386.

   Note that most (if not all) NetBSD/amd64 registers are 64-bit,
   while the NetBSD/i386 registers are all 32-bit, but since we're
   little-endian we get away with that.  */

/* From <machine/reg.h>.  */
static int amd64nbsd32_r_reg_offset[] =
{
  14 * 8,			/* %eax */
  3 * 8,			/* %ecx */
  2 * 8,			/* %edx */
  13 * 8,			/* %ebx */
  24 * 8,			/* %esp */
  12 * 8,			/* %ebp */
  1 * 8,			/* %esi */
  0 * 8,			/* %edi */
  21 * 8,			/* %eip */
  23 * 8,			/* %eflags */
  22 * 8,			/* %cs */
  25 * 8,			/* %ss */
  18 * 8,			/* %ds */
  17 * 8,			/* %es */
  16 * 8,			/* %fs */
  15 * 8			/* %gs */
};


/* Provide a prototype to silence -Wmissing-prototypes.  */
void _initialize_amd64nbsd_nat (void);

void
_initialize_amd64nbsd_nat (void)
{
  amd64_native_gregset32_reg_offset = amd64nbsd32_r_reg_offset;
  amd64_native_gregset32_num_regs = ARRAY_SIZE (amd64nbsd32_r_reg_offset);
  amd64_native_gregset64_reg_offset = amd64nbsd_r_reg_offset;

  /* We've got nothing to add to the common *BSD/amd64 target.  */
  add_target (amd64bsd_target ());
}




See more files for this project here

Gdb

GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it executes -- or what another program was doing at the moment it crashed.

Project homepage: http://sources.redhat.com/gdb/
Programming language(s): Assembly,C,C++,Expect
License: other

  cli/
  config/
  doc/
  features/
  gdbserver/
  gdbtk/
  mi/
  osf-share/
  po/
  regformats/
  signals/
  testsuite/
  tui/
  CONTRIBUTE
  COPYING
  ChangeLog
  ChangeLog-1990
  ChangeLog-1991
  ChangeLog-1992
  ChangeLog-1993
  ChangeLog-1994
  ChangeLog-1995
  ChangeLog-1996
  ChangeLog-1997
  ChangeLog-1998
  ChangeLog-1999
  ChangeLog-2000
  ChangeLog-2001
  ChangeLog-2002
  ChangeLog-2003
  ChangeLog-2004
  ChangeLog-2005
  ChangeLog-2006
  ChangeLog-3.x
  MAINTAINERS
  Makefile.in
  NEWS
  PROBLEMS
  README
  abug-rom.c
  acinclude.m4
  aclocal.m4
  ada-exp.y
  ada-lang.c
  ada-lang.h
  ada-lex.l
  ada-typeprint.c
  ada-valprint.c
  aix-thread.c
  alpha-linux-nat.c
  alpha-linux-tdep.c
  alpha-mdebug-tdep.c
  alpha-nat.c
  alpha-osf1-tdep.c
  alpha-tdep.c
  alpha-tdep.h
  alphabsd-nat.c
  alphabsd-tdep.c
  alphabsd-tdep.h
  alphafbsd-tdep.c
  alphanbsd-tdep.c
  alphaobsd-tdep.c
  amd64-linux-nat.c
  amd64-linux-tdep.c
  amd64-linux-tdep.h
  amd64-nat.c
  amd64-nat.h
  amd64-sol2-tdep.c
  amd64-tdep.c
  amd64-tdep.h
  amd64bsd-nat.c
  amd64fbsd-nat.c
  amd64fbsd-tdep.c
  amd64nbsd-nat.c
  amd64nbsd-tdep.c
  amd64obsd-nat.c
  amd64obsd-tdep.c
  annotate.c
  annotate.h
  arch-utils.c
  arch-utils.h
  arm-linux-nat.c
  arm-linux-tdep.c
  arm-linux-tdep.h
  arm-tdep.c
  arm-tdep.h
  armbsd-tdep.c
  armnbsd-nat.c
  armnbsd-tdep.c
  armobsd-tdep.c
  auxv.c
  auxv.h
  avr-tdep.c
  ax-gdb.c
  ax-gdb.h
  ax-general.c
  ax.h
  bcache.c
  bcache.h
  bfd-target.c
  bfd-target.h
  block.c
  block.h
  blockframe.c
  breakpoint.c
  breakpoint.h
  bsd-kvm.c
  bsd-kvm.h
  bsd-uthread.c
  bsd-uthread.h
  buildsym.c
  buildsym.h
  c-exp.y
  c-lang.c
  c-lang.h
  c-typeprint.c
  c-valprint.c
  call-cmds.h
  charset.c
  charset.h
  cli-out.c
  cli-out.h
  coff-pe-read.c
  coff-pe-read.h
  coff-solib.c
  coff-solib.h