#include "defs.h"
#include "gdbcore.h"
#include "gdbcmd.h"
-#include <string.h>
-#include "gdb_assert.h"
#include "arch-utils.h"
#include "observer.h"
#include "inferior.h"
spu_region_ok_for_hw_watchpoint (struct target_ops *self,
CORE_ADDR addr, int len)
{
- struct target_ops *ops_beneath = find_target_beneath (&spu_ops);
- while (ops_beneath && !ops_beneath->to_region_ok_for_hw_watchpoint)
- ops_beneath = find_target_beneath (ops_beneath);
+ struct target_ops *ops_beneath = find_target_beneath (self);
/* We cannot watch SPU local store. */
if (SPUADDR_SPU (addr) != -1)
return 0;
- if (ops_beneath)
- return ops_beneath->to_region_ok_for_hw_watchpoint (ops_beneath,
- addr, len);
-
- return 0;
+ return ops_beneath->to_region_ok_for_hw_watchpoint (ops_beneath, addr, len);
}
/* Override the to_fetch_registers routine. */
/* This version applies only if we're currently in spu_run. */
if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu)
{
- while (ops_beneath && !ops_beneath->to_fetch_registers)
- ops_beneath = find_target_beneath (ops_beneath);
-
- gdb_assert (ops_beneath);
ops_beneath->to_fetch_registers (ops_beneath, regcache, regno);
return;
}
/* This version applies only if we're currently in spu_run. */
if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu)
{
- while (ops_beneath && !ops_beneath->to_fetch_registers)
- ops_beneath = find_target_beneath (ops_beneath);
-
- gdb_assert (ops_beneath);
ops_beneath->to_store_registers (ops_beneath, regcache, regno);
return;
}
ULONGEST *xfered_len)
{
struct target_ops *ops_beneath = find_target_beneath (ops);
- while (ops_beneath && !ops_beneath->to_xfer_partial)
- ops_beneath = find_target_beneath (ops_beneath);
- gdb_assert (ops_beneath);
/* Use the "mem" spufs file to access SPU local store. */
if (object == TARGET_OBJECT_MEMORY)
CORE_ADDR *found_addrp)
{
struct target_ops *ops_beneath = find_target_beneath (ops);
- while (ops_beneath && !ops_beneath->to_search_memory)
- ops_beneath = find_target_beneath (ops_beneath);
- /* For SPU local store, always fall back to the simple method. Likewise
- if we do not have any target-specific special implementation. */
- if (!ops_beneath || SPUADDR_SPU (start_addr) >= 0)
+ /* For SPU local store, always fall back to the simple method. */
+ if (SPUADDR_SPU (start_addr) >= 0)
return simple_search_memory (ops,
start_addr, search_space_len,
pattern, pattern_len, found_addrp);
spu_mourn_inferior (struct target_ops *ops)
{
struct target_ops *ops_beneath = find_target_beneath (ops);
- while (ops_beneath && !ops_beneath->to_mourn_inferior)
- ops_beneath = find_target_beneath (ops_beneath);
- gdb_assert (ops_beneath);
ops_beneath->to_mourn_inferior (ops_beneath);
spu_multiarch_deactivate ();
}