]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-bz541866-rwatch-before-run.patch
- typo
[packages/gdb.git] / gdb-bz541866-rwatch-before-run.patch
CommitLineData
a7de96f0 1Index: gdb-7.4.50.20120602/gdb/config/i386/linux64.mh
51a5ef0f 2===================================================================
a7de96f0
PS
3--- gdb-7.4.50.20120602.orig/gdb/config/i386/linux64.mh 2012-03-13 16:00:34.000000000 +0100
4+++ gdb-7.4.50.20120602/gdb/config/i386/linux64.mh 2012-06-02 19:56:03.196172503 +0200
f412e1b4
PS
5@@ -4,7 +4,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
6 linux-nat.o linux-osdata.o \
7 proc-service.o linux-thread-db.o linux-fork.o \
a7de96f0 8 linux-procfs.o linux-ptrace.o
51a5ef0f
PS
9-NAT_FILE= config/nm-linux.h
10+NAT_FILE= nm-linux64.h
11 NAT_CDEPS = $(srcdir)/proc-service.list
12
13 # The dynamically loaded libthread_db needs access to symbols in the
a7de96f0 14Index: gdb-7.4.50.20120602/gdb/config/i386/linux.mh
f412e1b4 15===================================================================
a7de96f0
PS
16--- gdb-7.4.50.20120602.orig/gdb/config/i386/linux.mh 2012-03-13 16:00:33.000000000 +0100
17+++ gdb-7.4.50.20120602/gdb/config/i386/linux.mh 2012-06-02 19:55:42.418178412 +0200
e5178960
PS
18@@ -1,6 +1,6 @@
19 # Host: Intel 386 running GNU/Linux.
20
21-NAT_FILE= config/nm-linux.h
22+NAT_FILE= nm-linux.h
23 NATDEPFILES= inf-ptrace.o fork-child.o \
24 i386-nat.o i386-linux-nat.o \
25 proc-service.o linux-thread-db.o \
a7de96f0 26Index: gdb-7.4.50.20120602/gdb/config/i386/nm-linux.h
f412e1b4 27===================================================================
e5178960 28--- /dev/null 1970-01-01 00:00:00.000000000 +0000
a7de96f0 29+++ gdb-7.4.50.20120602/gdb/config/i386/nm-linux.h 2012-06-02 19:55:42.433178408 +0200
e5178960
PS
30@@ -0,0 +1,28 @@
31+/* Native support for GNU/Linux i386.
32+
33+ Copyright 2010 Free Software Foundation, Inc.
34+
35+ This file is part of GDB.
36+
37+ This program is free software; you can redistribute it and/or modify
38+ it under the terms of the GNU General Public License as published by
39+ the Free Software Foundation; either version 3 of the License, or
40+ (at your option) any later version.
41+
42+ This program is distributed in the hope that it will be useful,
43+ but WITHOUT ANY WARRANTY; without even the implied warranty of
44+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45+ GNU General Public License for more details.
46+
47+ You should have received a copy of the GNU General Public License
48+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
49+
50+#ifndef NM_LINUX_H
51+#define NM_LINUX_H
52+
53+#include "config/nm-linux.h"
54+
55+/* Red Hat backward compatibility with gdb-6.8. */
56+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
57+
58+#endif /* NM_LINUX64_H */
a7de96f0 59Index: gdb-7.4.50.20120602/gdb/config/i386/nm-linux64.h
51a5ef0f
PS
60===================================================================
61--- /dev/null 1970-01-01 00:00:00.000000000 +0000
a7de96f0 62+++ gdb-7.4.50.20120602/gdb/config/i386/nm-linux64.h 2012-06-02 19:55:42.434178407 +0200
51a5ef0f
PS
63@@ -0,0 +1,28 @@
64+/* Native support for GNU/Linux amd64.
65+
66+ Copyright 2010 Free Software Foundation, Inc.
67+
68+ This file is part of GDB.
69+
70+ This program is free software; you can redistribute it and/or modify
71+ it under the terms of the GNU General Public License as published by
72+ the Free Software Foundation; either version 3 of the License, or
73+ (at your option) any later version.
74+
75+ This program is distributed in the hope that it will be useful,
76+ but WITHOUT ANY WARRANTY; without even the implied warranty of
77+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
78+ GNU General Public License for more details.
79+
80+ You should have received a copy of the GNU General Public License
81+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
82+
83+#ifndef NM_LINUX64_H
84+#define NM_LINUX64_H
85+
86+#include "config/nm-linux.h"
87+
88+/* Red Hat backward compatibility with gdb-6.8. */
89+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
90+
91+#endif /* NM_LINUX64_H */
a7de96f0 92Index: gdb-7.4.50.20120602/gdb/target.h
51a5ef0f 93===================================================================
a7de96f0
PS
94--- gdb-7.4.50.20120602.orig/gdb/target.h 2012-06-01 18:37:59.000000000 +0200
95+++ gdb-7.4.50.20120602/gdb/target.h 2012-06-02 19:55:42.436178407 +0200
96@@ -1470,8 +1470,10 @@ extern char *target_thread_name (struct
51a5ef0f
PS
97 bp_hardware_breakpoint. CNT is the number of such watchpoints used so far
98 (including this one?). OTHERTYPE is who knows what... */
99
100+#ifndef target_can_use_hardware_watchpoint
101 #define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \
102 (*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE);
103+#endif
104
6ed6bacf
AM
105 /* Returns the number of debug registers needed to watch the given
106 memory region, or zero if not supported. */
a7de96f0 107Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
51a5ef0f
PS
108===================================================================
109--- /dev/null 1970-01-01 00:00:00.000000000 +0000
a7de96f0 110+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2012-06-02 19:55:42.442178406 +0200
51a5ef0f
PS
111@@ -0,0 +1,40 @@
112+# Copyright 2009, 2010 Free Software Foundation, Inc.
113+
114+# This program is free software; you can redistribute it and/or modify
115+# it under the terms of the GNU General Public License as published by
116+# the Free Software Foundation; either version 3 of the License, or
117+# (at your option) any later version.
118+#
119+# This program is distributed in the hope that it will be useful,
120+# but WITHOUT ANY WARRANTY; without even the implied warranty of
121+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
122+# GNU General Public License for more details.
123+#
124+# You should have received a copy of the GNU General Public License
125+# along with this program. If not, see <http://www.gnu.org/licenses/>.
126+
127+# Arch not supporting hw watchpoints does not imply no_hardware_watchpoints set.
128+if {(![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]
129+ && ![istarget "ia64-*-*"])
130+ || [target_info exists gdb,no_hardware_watchpoints]} then {
131+ verbose "Skipping watchpoint-hw-before-run test."
132+ return
133+}
134+
135+set test watchpoint-hw-before-run
136+set srcfile watchpoint-hw-hit-once.c
137+if { [prepare_for_testing ${test}.exp ${test} ${srcfile}] } {
138+ return -1
139+}
140+
141+gdb_test "rwatch watchee" "ardware read watchpoint 1: watchee"
142+
143+# `runto_main' or `runto main' would delete the watchpoint created above.
144+
145+if { [gdb_start_cmd] < 0 } {
146+ untested start
147+ return -1
148+}
149+gdb_test "" "main .* at .*" "start"
150+
151+gdb_test "continue" "Continuing.\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"
This page took 0.076364 seconds and 4 git commands to generate.