aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJie Zhang <jie.zhang@analog.com>2008-05-07 11:54:41 +0000
committerJie Zhang <jie.zhang@analog.com>2008-05-07 11:54:41 +0000
commit4fff24118ad4d559d429d5975cfb80ec3d8c1bf1 (patch)
tree115b9e44fcc57ef6362ffb1807fe1ed5bb7b07da /gdb
parentf3e9c5c5170afd576cb1c31464472587aba05f52 (diff)
downloadgdb-4fff24118ad4d559d429d5975cfb80ec3d8c1bf1.zip
gdb-4fff24118ad4d559d429d5975cfb80ec3d8c1bf1.tar.gz
gdb-4fff24118ad4d559d429d5975cfb80ec3d8c1bf1.tar.bz2
* remote.c (remote_insert_breakpoint): Call get_remote_state
after gdbarch_breakpoint_from_pc is called. (remote_insert_hw_breakpoint): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/remote.c22
2 files changed, 20 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6623d3c..4aac2ee 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-07 Jie Zhang <jie.zhang@analog.com>
+
+ * remote.c (remote_insert_breakpoint): Call get_remote_state
+ after gdbarch_breakpoint_from_pc is called.
+ (remote_insert_hw_breakpoint): Likewise.
+
2008-05-06 Joel Brobecker <brobecker@adacore.com>
* valprint.c (val_print): Add new language parameter and use it
diff --git a/gdb/remote.c b/gdb/remote.c
index 43ca90f..616fa13 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -5496,9 +5496,6 @@ extended_remote_async_create_inferior (char *exec_file, char *args,
static int
remote_insert_breakpoint (struct bp_target_info *bp_tgt)
{
- CORE_ADDR addr = bp_tgt->placed_address;
- struct remote_state *rs = get_remote_state ();
-
/* Try the "Z" s/w breakpoint packet if it is not already disabled.
If it succeeds, then set the support to PACKET_ENABLE. If it
fails, and the user has explicitly requested the Z support then
@@ -5506,13 +5503,19 @@ remote_insert_breakpoint (struct bp_target_info *bp_tgt)
if (remote_protocol_packets[PACKET_Z0].support != PACKET_DISABLE)
{
- char *p = rs->buf;
+ CORE_ADDR addr;
+ struct remote_state *rs;
+ char *p;
+
+ gdbarch_breakpoint_from_pc
+ (current_gdbarch, &bp_tgt->placed_address, &bp_tgt->placed_size);
+
+ rs = get_remote_state ();
+ p = rs->buf;
*(p++) = 'Z';
*(p++) = '0';
*(p++) = ',';
- gdbarch_breakpoint_from_pc
- (current_gdbarch, &bp_tgt->placed_address, &bp_tgt->placed_size);
addr = (ULONGEST) remote_address_masked (bp_tgt->placed_address);
p += hexnumstr (p, addr);
sprintf (p, ",%d", bp_tgt->placed_size);
@@ -5698,8 +5701,8 @@ static int
remote_insert_hw_breakpoint (struct bp_target_info *bp_tgt)
{
CORE_ADDR addr;
- struct remote_state *rs = get_remote_state ();
- char *p = rs->buf;
+ struct remote_state *rs;
+ char *p;
/* The length field should be set to the size of a breakpoint
instruction, even though we aren't inserting one ourselves. */
@@ -5710,6 +5713,9 @@ remote_insert_hw_breakpoint (struct bp_target_info *bp_tgt)
if (remote_protocol_packets[PACKET_Z1].support == PACKET_DISABLE)
return -1;
+ rs = get_remote_state ();
+ p = rs->buf;
+
*(p++) = 'Z';
*(p++) = '1';
*(p++) = ',';