This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Darwin/x86 port (v2 - part 3: i386-darwin files)
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gingold at adacore dot com
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 12 Nov 2008 13:42:16 +0100 (CET)
- Subject: Re: [RFA] Darwin/x86 port (v2 - part 3: i386-darwin files)
- References: <20081112101250.GA18396@ulanbator.act-europe.fr>
> Date: Wed, 12 Nov 2008 11:12:50 +0100
> From: Tristan Gingold <gingold@adacore.com>
>
> i386-darwin-tdep.h:
>
> /* Target-dependent code for Darwin x86.
>
> Copyright (C) 2008 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 3 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, see <http://www.gnu.org/licenses/>. */
> #ifndef __I386_DARWIN_TDEP_H__
> #define __I386_DARWIN_TDEP_H__
>
> #include <mach/thread_status.h>
>
> #define IS_GP_REGNUM(regno) ((regno >= FIRST_GP_REGNUM) && (regno <= LAST_GP_REGNUM))
> #define IS_FP_REGNUM(regno) ((regno >= FIRST_FP_REGNUM) && (regno <= LAST_FP_REGNUM))
> #define IS_VP_REGNUM(regno) ((regno >= FIRST_VP_REGNUM) && (regno <= LAST_VP_REGNUM))
>
> #define FIRST_GP_REGNUM 0
> #define LAST_GP_REGNUM 15
> #define NUM_GP_REGS ((LAST_GP_REGNUM + 1) - FIRST_GP_REGNUM)
>
> #define FIRST_FP_REGNUM 16
> #define LAST_FP_REGNUM 31
> #define NUM_FP_REGS ((LAST_FP_REGNUM + 1) - FIRST_FP_REGNUM)
>
> #define FIRST_VP_REGNUM 32
> #define LAST_VP_REGNUM 40
> #define NUM_VP_REGS ((LAST_VP_REGNUM + 1) - FIRST_VP_REGNUM)
>
> #define IS_GP_REGNUM_64(regno) ((regno >= FIRST_GP_REGNUM_64) && (regno <= LAST_GP_REGNUM_64))
> #define IS_FP_REGNUM_64(regno) ((regno >= FIRST_FP_REGNUM_64) && (regno <= LAST_FP_REGNUM_64))
> #define IS_VP_REGNUM_64(regno) ((regno >= FIRST_VP_REGNUM_64) && (regno <= LAST_VP_REGNUM_64))
>
> #define FIRST_GP_REGNUM_64 0
> #define LAST_GP_REGNUM_64 23
> #define NUM_GP_REGS_64 ((LAST_GP_REGNUM_64 + 1) - FIRST_GP_REGNUM_64)
>
> #define FIRST_FP_REGNUM_64 24
> #define LAST_FP_REGNUM_64 39
> #define NUM_FP_REGS_64 ((LAST_FP_REGNUM_64 + 1) - FIRST_FP_REGNUM_64)
>
> #define FIRST_VP_REGNUM_64 40
> #define LAST_VP_REGNUM_64 55
> #define NUM_VP_REGS_64 ((LAST_VP_REGNUM_64 + 1) - FIRST_VP_REGNUM_64)
>
> void i386_darwin_fetch_gp_registers (struct regcache *regcache, i386_thread_state_t *sp_regs);
> void i386_darwin_store_gp_registers (struct regcache *regcache, i386_thread_state_t *sp_regs);
> void x86_64_darwin_fetch_gp_registers (struct regcache *regcache, x86_thread_state64_t *sp_regs);
> void x86_64_darwin_store_gp_registers (struct regcache *regcache, x86_thread_state64_t *sp_regs);
> void i386_darwin_fetch_fp_registers (struct regcache *regcache, i386_float_state_t *fp_regs);
> int i386_darwin_store_fp_registers (struct regcache *regcache, i386_float_state_t *fp_regs);
> void x86_64_darwin_fetch_fp_registers (struct regcache *regcache, x86_float_state64_t *fp_regs);
> int x86_64_darwin_store_fp_registers (struct regcache *regcache, x86_float_state64_t *fp_regs);
Can you do a s/x86_64/amd64/ on the function/variable names in your
new code? That's more consistent with other code in GDB.
> #define INVALID_ADDRESS ((CORE_ADDR) (-1))
As far as I can tell, this define isn't used. Can you remove it?