Report "No hardware breakpoint support" correctly

Message ID 1405380516-13496-1-git-send-email-emachado@linux.vnet.ibm.com
State Committed
Headers

Commit Message

Edjunior Barbosa Machado July 14, 2014, 11:28 p.m. UTC
  Thanks Uli and Joel for the feedback. I've just committed the patch below,
following Joel's suggestion:

	https://sourceware.org/ml/gdb-cvs/2014-07/msg00035.html

Thanks and regards,
--
Edjunior

gdb/
2014-07-14  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>

	* ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Report no hardware
	breakpoint support correctly.

---
 gdb/ppc-linux-nat.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index fcfd452..6e8994e 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -1473,6 +1473,11 @@  ppc_linux_can_use_hw_breakpoint (struct target_ops *self,
     }
   else if (type == bp_hardware_breakpoint)
     {
+      if (total_hw_bp == 0)
+	{
+	  /* No hardware breakpoint support. */
+	  return 0;
+	}
       if (cnt > total_hw_bp)
 	return -1;
     }