This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Set bp_tgt->reqstd_address and bp_tgt->placed_size in record_full_insert_breakpoint


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1ccd06e498586b39f06447cbf3f2fad50120fde6

commit 1ccd06e498586b39f06447cbf3f2fad50120fde6
Author: Yao Qi <yao.qi@linaro.org>
Date:   Thu Apr 7 16:47:26 2016 +0100

    Set bp_tgt->reqstd_address and bp_tgt->placed_size in record_full_insert_breakpoint
    
    I notice that bp_tgt won't be fully initialized if to_insert_breakpoint
    isn't called in record_full_insert_breakpoint, and bp_tgt->reqstd_address
    is zero, so an entry is added to record_full_breakpoints, but its address
    is zero, which is wrong.  This patch is to call gdbarch_breakpoint_from_pc
    in the else branch to set bp_tgt->reqstd_address and bp_tgt->placed_size.
    
    gdb:
    
    2016-04-07  Yao Qi  <yao.qi@linaro.org>
    
    	* record-full.c (record_full_insert_breakpoint): Set
    	bp_tgt->reqstd_address and bp_tgt->placed_size.

Diff:
---
 gdb/ChangeLog     |  5 +++++
 gdb/record-full.c | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6b9d342..39f77f8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-07  Yao Qi  <yao.qi@linaro.org>
+
+	* record-full.c (record_full_insert_breakpoint): Set
+	bp_tgt->reqstd_address and bp_tgt->placed_size.
+
 2016-04-06  Don Breazeal  <donb@codesourcery.com>
 
 	* value.c (value_actual_type): Don't try to get rtti type
diff --git a/gdb/record-full.c b/gdb/record-full.c
index f6023bf..066a8e7 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -1670,6 +1670,16 @@ record_full_insert_breakpoint (struct target_ops *ops,
 
       in_target_beneath = 1;
     }
+  else
+    {
+      CORE_ADDR addr = bp_tgt->reqstd_address;
+      int bplen;
+
+      gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
+
+      bp_tgt->placed_address = addr;
+      bp_tgt->placed_size = bplen;
+    }
 
   bp = XNEW (struct record_full_breakpoint);
   bp->addr = bp_tgt->placed_address;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]