]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdbarch_breakpoint_from_pc doesn't return NULL
authorYao Qi <yao.qi@linaro.org>
Thu, 3 Nov 2016 14:35:13 +0000 (14:35 +0000)
committerYao Qi <yao.qi@linaro.org>
Thu, 3 Nov 2016 14:35:13 +0000 (14:35 +0000)
gdbarch_breakpoint_from_pc doesn't return NULL except for
ia64_breakpoint_from_pc, and we checked its return value in three
places. In microblaze_linux_memory_remove_breakpoint and
ppc_linux_memory_remove_breakpoint, gdbarch_breakpoint_from_pc never
returns NULL, so we can remove the NULL checking.  In
default_memory_insert_breakpoint, gdbarch_breakpoint_from_pc can't
returns NULL too because ia64 defines its own memory_insert_breakpoint.

gdb:

2016-11-03  Yao Qi  <yao.qi@linaro.org>

* mem-break.c (default_memory_insert_breakpoint): Don't check
'bp' against NULL.
* microblaze-linux-tdep.c (microblaze_linux_memory_remove_breakpoint):
Likewise.
* ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Likewise.

gdb/ChangeLog
gdb/mem-break.c
gdb/microblaze-linux-tdep.c
gdb/ppc-linux-tdep.c

index 8ce613213cf1a9a3896cc4e371eecb735b2a90b7..92fdd697ee74e9d7382841bf05743d6cad46a216 100644 (file)
@@ -1,3 +1,11 @@
+2016-11-03  Yao Qi  <yao.qi@linaro.org>
+
+       * mem-break.c (default_memory_insert_breakpoint): Don't check
+       'bp' against NULL.
+       * microblaze-linux-tdep.c (microblaze_linux_memory_remove_breakpoint):
+       Likewise.
+       * ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Likewise.
+
 2016-11-02  Tom Tromey  <tom@tromey.com>
 
        * dwarf2loc.c (dwarf_evaluate_loc_desc::get_base_type): Rename
index 803f62b704b3700f0d1381994a3840b94c64eaa4..cc8145c4c38bcbeabecaf07b0194065a3aff7cb0 100644 (file)
@@ -45,8 +45,6 @@ default_memory_insert_breakpoint (struct gdbarch *gdbarch,
 
   /* Determine appropriate breakpoint contents and size for this address.  */
   bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
-  if (bp == NULL)
-    error (_("Software breakpoints not implemented for this target."));
 
   bp_tgt->placed_address = addr;
   bp_tgt->placed_size = bplen;
index 18ddfea0577e63ab510e79e059ec1fe58bab230d..22e59593abe0824d9ee6a382e53511db0d754f97 100644 (file)
@@ -49,8 +49,6 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
 
   /* Determine appropriate breakpoint contents and size for this address.  */
   bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
-  if (bp == NULL)
-    error (_("Software breakpoints not implemented for this target."));
 
   val = target_read_memory (addr, old_contents, bplen);
 
index ee158e3dac61e7d6109ae2ba97ff8d4b51794adb..9c0b8fc3d912dba6243f3fd42a5d7aa7d7e1b3e5 100644 (file)
@@ -222,8 +222,6 @@ ppc_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
 
   /* Determine appropriate breakpoint contents and size for this address.  */
   bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
-  if (bp == NULL)
-    error (_("Software breakpoints not implemented for this target."));
 
   /* Make sure we see the memory breakpoints.  */
   cleanup = make_show_memory_breakpoints_cleanup (1);