/* Native debugging support for Intel x86 running DJGPP.
- Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2001, 2005, 2006, 2007
+ Free Software Foundation, Inc.
Written by Robert Hoehne.
This file is part of GDB.
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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
#include <fcntl.h>
#include "value.h"
#include "regcache.h"
#include "gdb_string.h"
+#include "top.h"
#include <stdio.h> /* might be required for __DJGPP_MINOR__ */
#include <stdlib.h>
enum target_signal siggnal);
static ptid_t go32_wait (ptid_t ptid,
struct target_waitstatus *status);
-static void go32_fetch_registers (int regno);
-static void store_register (int regno);
-static void go32_store_registers (int regno);
-static void go32_prepare_to_store (void);
+static void go32_fetch_registers (struct regcache *, int regno);
+static void store_register (const struct regcache *, int regno);
+static void go32_store_registers (struct regcache *, int regno);
+static void go32_prepare_to_store (struct regcache *);
static int go32_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
int write,
struct mem_attrib *attrib,
}
static void
-fetch_register (int regno)
+fetch_register (struct regcache *regcache, int regno)
{
if (regno < FP0_REGNUM)
- regcache_raw_supply (current_regcache, regno,
+ regcache_raw_supply (regcache, regno,
(char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
- i387_supply_fsave (current_regcache, regno, &npx);
+ i387_supply_fsave (regcache, regno, &npx);
else
internal_error (__FILE__, __LINE__,
_("Invalid register no. %d in fetch_register."), regno);
}
static void
-go32_fetch_registers (int regno)
+go32_fetch_registers (struct regcache *regcache, int regno)
{
if (regno >= 0)
- fetch_register (regno);
+ fetch_register (regcache, regno);
else
{
for (regno = 0; regno < FP0_REGNUM; regno++)
- fetch_register (regno);
- i387_supply_fsave (current_regcache, -1, &npx);
+ fetch_register (regcache, regno);
+ i387_supply_fsave (regcache, -1, &npx);
}
}
static void
-store_register (int regno)
+store_register (const struct regcache *regcache, int regno)
{
if (regno < FP0_REGNUM)
- regcache_raw_collect (current_regcache, regno,
+ regcache_raw_collect (regcache, regno,
(char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
- i387_fill_fsave ((char *) &npx, regno);
+ i387_collect_fsave (regcache, regno, &npx);
else
internal_error (__FILE__, __LINE__,
_("Invalid register no. %d in store_register."), regno);
}
static void
-go32_store_registers (int regno)
+go32_store_registers (struct regcache *regcache, int regno)
{
unsigned r;
if (regno >= 0)
- store_register (regno);
+ store_register (regcache, regno);
else
{
for (r = 0; r < FP0_REGNUM; r++)
- store_register (r);
- i387_fill_fsave ((char *) &npx, -1);
+ store_register (regcache, r);
+ i387_collect_fsave (regcache, -1, &npx);
}
}
static void
-go32_prepare_to_store (void)
+go32_prepare_to_store (struct regcache *regcache)
{
}
push_target (&go32_ops);
clear_proceed_status ();
insert_breakpoints ();
- proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
prog_has_started = 1;
}
/* We are always processing GCC-compiled programs. */
processing_gcc_compilation = 2;
+
+ /* Override the default name of the GDB init file. */
+ strcpy (gdbinit, "gdb.ini");
}
unsigned short windows_major, windows_minor;
init_go32_ops ();
add_target (&go32_ops);
- add_prefix_cmd ("dos", class_info, go32_info_dos_command,
- "Print information specific to DJGPP (aka MS-DOS) debugging.",
+ add_prefix_cmd ("dos", class_info, go32_info_dos_command, _("\
+Print information specific to DJGPP (aka MS-DOS) debugging."),
&info_dos_cmdlist, "info dos ", 0, &infolist);
add_cmd ("sysinfo", class_info, go32_sysinfo, _("\