return 1;
}
+/* Unpush TARGET and assert that it worked. */
+
+static void
+unpush_target_and_assert (struct target_ops *target)
+{
+ if (!unpush_target (target))
+ {
+ fprintf_unfiltered (gdb_stderr,
+ "pop_all_targets couldn't find target %s\n",
+ target->to_shortname);
+ internal_error (__FILE__, __LINE__,
+ _("failed internal consistency check"));
+ }
+}
+
void
pop_all_targets_above (enum strata above_stratum)
{
while ((int) (current_target.to_stratum) > (int) above_stratum)
- {
- if (!unpush_target (target_stack))
- {
- fprintf_unfiltered (gdb_stderr,
- "pop_all_targets couldn't find target %s\n",
- target_stack->to_shortname);
- internal_error (__FILE__, __LINE__,
- _("failed internal consistency check"));
- break;
- }
- }
+ unpush_target_and_assert (target_stack);
+}
+
+/* See target.h. */
+
+void
+pop_all_targets_at_and_above (enum strata stratum)
+{
+ while ((int) (current_target.to_stratum) >= (int) stratum)
+ unpush_target_and_assert (target_stack);
}
void
/* Read LEN bytes of target memory at address MEMADDR, placing the
results in GDB's memory at MYADDR. Returns either 0 for success or
- TARGET_XFER_E_IO if any error occurs.
+ -1 if any error occurs.
If an error occurs, no guarantee is made about the contents of the data at
MYADDR. In particular, the caller should not depend upon partial reads
myaddr, memaddr, len) == len)
return 0;
else
- return TARGET_XFER_E_IO;
+ return -1;
}
/* See target/target.h. */
myaddr, memaddr, len) == len)
return 0;
else
- return TARGET_XFER_E_IO;
+ return -1;
}
/* Like target_read_memory, but specify explicitly that this is a read from
myaddr, memaddr, len) == len)
return 0;
else
- return TARGET_XFER_E_IO;
+ return -1;
}
/* Like target_read_memory, but specify explicitly that this is a read from
myaddr, memaddr, len) == len)
return 0;
else
- return TARGET_XFER_E_IO;
+ return -1;
}
/* Write LEN bytes from MYADDR to target memory at address MEMADDR.
- Returns either 0 for success or TARGET_XFER_E_IO if any
- error occurs. If an error occurs, no guarantee is made about how
- much data got written. Callers that can deal with partial writes
- should call target_write. */
+ Returns either 0 for success or -1 if any error occurs. If an
+ error occurs, no guarantee is made about how much data got written.
+ Callers that can deal with partial writes should call
+ target_write. */
int
target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
myaddr, memaddr, len) == len)
return 0;
else
- return TARGET_XFER_E_IO;
+ return -1;
}
/* Write LEN bytes from MYADDR to target raw memory at address
- MEMADDR. Returns either 0 for success or TARGET_XFER_E_IO
- if any error occurs. If an error occurs, no guarantee is made
- about how much data got written. Callers that can deal with
- partial writes should call target_write. */
+ MEMADDR. Returns either 0 for success or -1 if any error occurs.
+ If an error occurs, no guarantee is made about how much data got
+ written. Callers that can deal with partial writes should call
+ target_write. */
int
target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
myaddr, memaddr, len) == len)
return 0;
else
- return TARGET_XFER_E_IO;
+ return -1;
}
/* Fetch the target's memory map. */
target.h. */
int
-target_insert_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask, int rw)
+target_insert_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask,
+ enum target_hw_bp_type rw)
{
return current_target.to_insert_mask_watchpoint (¤t_target,
addr, mask, rw);
target.h. */
int
-target_remove_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask, int rw)
+target_remove_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask,
+ enum target_hw_bp_type rw)
{
return current_target.to_remove_mask_watchpoint (¤t_target,
addr, mask, rw);