/* Shared library support for IRIX.
- Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004
- Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004,
+ 2007 Free Software Foundation, Inc.
This file was created using portions of irix5-nat.c originally
contributed to GDB by Ian Lance Taylor.
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
+ 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,
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. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
typedef struct
{
- char b[4];
+ gdb_byte b[4];
}
gdb_int32_bytes;
typedef struct
{
- char b[8];
+ gdb_byte b[8];
}
gdb_int64_bytes;
being at the end of a page or the like.) */
read_memory (addr, (char *) &buf, sizeof (buf.ol32));
- if (extract_unsigned_integer (&buf.magic, sizeof (buf.magic)) != 0xffffffff)
+ if (extract_unsigned_integer (buf.magic.b, sizeof (buf.magic)) != 0xffffffff)
{
/* Use buf.ol32... */
char obj_buf[432];
- extract_mips_address (&obj_buf[248], 4);
}
- else if (extract_unsigned_integer (&buf.oi32.oi_size,
+ else if (extract_unsigned_integer (buf.oi32.oi_size.b,
sizeof (buf.oi32.oi_size))
== sizeof (buf.oi32))
{
sizeof (buf.oi32.oi_orig_ehdr));
li.pathname_addr = extract_mips_address (&buf.oi32.oi_pathname,
sizeof (buf.oi32.oi_pathname));
- li.pathname_len = extract_unsigned_integer (&buf.oi32.oi_pathname_len,
+ li.pathname_len = extract_unsigned_integer (buf.oi32.oi_pathname_len.b,
sizeof (buf.oi32.
oi_pathname_len));
}
- else if (extract_unsigned_integer (&buf.oi64.oi_size,
+ else if (extract_unsigned_integer (buf.oi64.oi_size.b,
sizeof (buf.oi64.oi_size))
== sizeof (buf.oi64))
{
sizeof (buf.oi64.oi_orig_ehdr));
li.pathname_addr = extract_mips_address (&buf.oi64.oi_pathname,
sizeof (buf.oi64.oi_pathname));
- li.pathname_len = extract_unsigned_integer (&buf.oi64.oi_pathname_len,
+ li.pathname_len = extract_unsigned_integer (buf.oi64.oi_pathname_len.b,
sizeof (buf.oi64.
oi_pathname_len));
}
/* The symbol which starts off the list of shared libraries. */
#define DEBUG_BASE "__rld_obj_head"
-char shadow_contents[BREAKPOINT_MAX]; /* Stash old bkpt addr contents */
+static void *base_breakpoint;
static CORE_ADDR debug_base; /* Base of dynamic linker structures */
-static CORE_ADDR breakpoint_addr; /* Address where end bkpt is set */
/*
/* Note that breakpoint address and original contents are in our address
space, so we just need to write the original contents back. */
- if (memory_remove_breakpoint (breakpoint_addr, shadow_contents) != 0)
+ if (deprecated_remove_raw_breakpoint (base_breakpoint) != 0)
{
status = 0;
}
+ base_breakpoint = NULL;
+
/* Note that it is possible that we have stopped at a location that
is different from the location where we inserted our breakpoint.
On mips-irix, we can actually land in __dbx_init(), so we should
static int
enable_break (void)
{
- if (symfile_objfile != NULL
- && target_insert_breakpoint (entry_point_address (),
- shadow_contents) == 0)
+ if (symfile_objfile != NULL)
{
- breakpoint_addr = entry_point_address ();
- return 1;
+ base_breakpoint
+ = deprecated_insert_raw_breakpoint (entry_point_address ());
+
+ if (base_breakpoint != NULL)
+ return 1;
}
return 0;
return 0;
}
- read_memory (debug_base, addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
- lma = extract_mips_address (addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+ read_memory (debug_base,
+ addr_buf,
+ gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT);
+ lma = extract_mips_address (addr_buf,
+ gdbarch_addr_bit (current_gdbarch)
+ / TARGET_CHAR_BIT);
while (lma)
{
return 0; /* failed somehow... */
/* First link map member should be the executable. */
- read_memory (debug_base, addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
- lma = extract_mips_address (addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+ read_memory (debug_base,
+ addr_buf,
+ gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT);
+ lma = extract_mips_address (addr_buf,
+ gdbarch_addr_bit (current_gdbarch)
+ / TARGET_CHAR_BIT);
if (lma == 0)
return 0; /* failed somehow... */