This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Fix cast to 'gdb_breakpoint *'
- From: Yao Qi <qiyao at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 21 Jul 2016 13:36:20 -0000
- Subject: [binutils-gdb] Fix cast to 'gdb_breakpoint *'
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2583da7cd64e680e43cf92c8022eadee84357b3b
commit 2583da7cd64e680e43cf92c8022eadee84357b3b
Author: Yao Qi <yao.qi@linaro.org>
Date: Thu Jul 21 14:34:07 2016 +0100
Fix cast to 'gdb_breakpoint *'
c-mode buildbot catches a build problem,
gcc -g -O2 -I. -I../../../binutils-gdb/gdb/gdbserver -I../../../binutils-gdb/gdb/gdbserver/../common -I../../../binutils-gdb/gdb/gdbserver/../regformats -I../../../binutils-gdb/gdb/gdbserver/.. -I../../../binutils-gdb/gdb/gdbserver/../../include -I../../../binutils-gdb/gdb/gdbserver/../gnulib/import -Ibuild-gnulib-gdbserver/import -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wpointer-sign -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral -Wno-missing-prototypes -Werror -DGDBSERVER -c -o hostio.o -MT hostio.o -MMD -MP -MF .deps/hostio.Tpo ../../../binutils-gdb/gdb/gdbserver/hostio.c
../../../binutils-gdb/gdb/gdbserver/mem-break.c: In function find_gdb_breakpoint:
../../../binutils-gdb/gdb/gdbserver/mem-break.c:996:15: error: gdb_breakpoint undeclared (first use in this function)
return (gdb_breakpoint *) bp;
we should use 'struct gdb_breakpoint' rather than 'gdb_breakpoint'.
Patch below fixes this.
gdb/gdbserver:
2016-07-21 Yao Qi <yao.qi@linaro.org>
* mem-break.c (find_gdb_breakpoint): Cast bp to
'struct gdb_breakpoint *' rather than 'gdb_breakpoint *'.
Diff:
---
gdb/gdbserver/ChangeLog | 5 +++++
gdb/gdbserver/mem-break.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 1592a11..4156790 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,10 @@
2016-07-21 Yao Qi <yao.qi@linaro.org>
+ * mem-break.c (find_gdb_breakpoint): Cast bp to
+ 'struct gdb_breakpoint *' rather than 'gdb_breakpoint *'.
+
+2016-07-21 Yao Qi <yao.qi@linaro.org>
+
* server.c (handle_v_requests): Support s and S actions
if target_supports_software_single_step return true.
diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c
index 65ca3f9..7cd037f 100644
--- a/gdb/gdbserver/mem-break.c
+++ b/gdb/gdbserver/mem-break.c
@@ -996,7 +996,7 @@ find_gdb_breakpoint (char z_type, CORE_ADDR addr, int kind)
for (bp = proc->breakpoints; bp != NULL; bp = bp->next)
if (bp->type == type && bp->raw->pc == addr
&& (kind == -1 || bp->raw->kind == kind))
- return (gdb_breakpoint *) bp;
+ return (struct gdb_breakpoint *) bp;
return NULL;
}