diff --git a/baselibs.conf b/baselibs.conf index d9ca30a..99bee94 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1,6 +1,11 @@ gdb - +/usr/bin/gdbserver -> /usr/bin/gdbserver +/usr/bin/gdb -> /usr/bin/gdb # kill package for i586 32bit targetarch x86_64 block! prereq -glibc-x86 +gdbserver + +/usr/bin/gdbserver -> /usr/bin/gdbserver + provides "gdb-:/usr/bin/gdbserver" + # kill package for i586 32bit + targetarch x86_64 block! + prereq -glibc-x86 diff --git a/gdb.changes b/gdb.changes index dce6a0b..76e5f85 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri May 9 14:05:00 CEST 2008 - schwab@suse.de + +- Split off gdbserver. +- Fix watchpoints. + ------------------------------------------------------------------- Thu Apr 10 12:54:45 CEST 2008 - ro@suse.de diff --git a/gdb.spec b/gdb.spec index 0f82e7d..aca0855 100644 --- a/gdb.spec +++ b/gdb.spec @@ -30,7 +30,7 @@ AutoReqProv: on PreReq: %{install_info_prereq} Summary: The GNU Debugger Version: 6.8 -Release: 4 +Release: 14 %define sss %{nil} Source: gdb-%{version}%{sss}.tar.bz2 Patch1: find-pc-sect-line.diff @@ -42,6 +42,7 @@ Patch6: sect-index-text.diff Patch7: pie-relocate.diff Patch8: infcall.diff Patch9: examine-prologue.diff +Patch10: watchpoints.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -50,6 +51,39 @@ GNU Fortran 77 support is also partially included. +Authors: +-------- + Doug Evans + Fred Fish + Ian Lance Taylor + J.T. Conklin + Jason Molenda + Jeffrey A. Law + Jim Kingdon + Kung Hsu + Michael Meissner + Per Bothner + Peter Schauer + Rob Savoye + Stan Shebs + Steve Chamberlain + Stu Grossman + +%package -n gdbserver +License: GPL v2 or later; GPL v3 or later +Summary: Remote Server for the GNU Debugger +Group: Development/Tools/Debuggers +AutoReqProv: on +Provides: gdb:/usr/bin/gdbserver +Version: 6.8 +Release: 1 + +%description -n gdbserver +GDBSERVER is a program that allows you to run GDB on a different +machine than the one which is running the program being debugged. + + + Authors: -------- Doug Evans @@ -79,6 +113,7 @@ Authors: %patch7 %patch8 -p1 %patch9 +%patch10 %build CFLAGS="$RPM_OPT_FLAGS" \ @@ -131,11 +166,18 @@ rm -rf $RPM_BUILD_ROOT %{_infodir}/gdb.info*.gz %{_infodir}/gdbint.info*.gz %ifnarch alpha sparc sparc64 + +%files -n gdbserver +%defattr(-,root,root) +%doc gdb/gdbserver/README %{_bindir}/gdbserver %{_mandir}/man1/gdbserver.1.gz %endif %changelog +* Fri May 09 2008 schwab@suse.de +- Split off gdbserver. +- Fix watchpoints. * Thu Apr 10 2008 ro@suse.de - added baselibs.conf file to build xxbit packages for multilib support diff --git a/watchpoints.diff b/watchpoints.diff new file mode 100644 index 0000000..1a8ac6a --- /dev/null +++ b/watchpoints.diff @@ -0,0 +1,225 @@ +2008-04-23 Andreas Schwab + + * target.h (struct target_ops): Add + to_watchpoint_addr_within_range. + (target_watchpoint_addr_within_range): New function. + * target.c (update_current_target): Inherit + to_watchpoint_addr_within_range, defaulting to + default_watchpoint_addr_within_range. + (default_watchpoint_addr_within_range): New function. + (debug_to_watchpoint_addr_within_range): New function. + (setup_target_debug): Set to_watchpoint_addr_within_range. + * ppc-linux-nat.c (ppc_linux_watchpoint_addr_within_range): + New function. + (_initialize_ppc_linux_nat): Set to_watchpoint_addr_within_range. + * breakpoint.c (watchpoints_triggered): Use + target_watchpoint_addr_within_range. + +doc/: + * gdbint.texinfo (Algorithms): Describe + target_watchpoint_addr_within_range. + +Index: gdb/breakpoint.c +=================================================================== +RCS file: /cvs/src/src/gdb/breakpoint.c,v +retrieving revision 1.310 +diff -u -a -p -a -u -p -r1.310 gdb/breakpoint.c +--- gdb/breakpoint.c 18 Apr 2008 00:41:28 -0000 1.310 ++++ gdb/breakpoint.c 23 Apr 2008 11:00:51 -0000 +@@ -2552,8 +2552,9 @@ watchpoints_triggered (struct target_wai + for (loc = b->loc; loc; loc = loc->next) + /* Exact match not required. Within range is + sufficient. */ +- if (addr >= loc->address +- && addr < loc->address + loc->length) ++ if (target_watchpoint_addr_within_range (¤t_target, ++ addr, loc->address, ++ loc->length)) + { + b->watchpoint_triggered = watch_triggered_yes; + break; +Index: gdb/ppc-linux-nat.c +=================================================================== +RCS file: /cvs/src/src/gdb/ppc-linux-nat.c,v +retrieving revision 1.78 +diff -u -a -p -a -u -p -r1.78 gdb/ppc-linux-nat.c +--- gdb/ppc-linux-nat.c 16 Jan 2008 04:48:55 -0000 1.78 ++++ gdb/ppc-linux-nat.c 23 Apr 2008 11:00:52 -0000 +@@ -889,6 +889,16 @@ ppc_linux_stopped_by_watchpoint (void) + return ppc_linux_stopped_data_address (¤t_target, &addr); + } + ++static int ++ppc_linux_watchpoint_addr_within_range (struct target_ops *target, ++ CORE_ADDR addr, ++ CORE_ADDR start, int length) ++{ ++ addr &= ~7; ++ /* Check whether [start, start+length-1] intersects [addr, addr+7]. */ ++ return start <= addr + 7 && start + length - 1 >= addr; ++} ++ + static void + ppc_linux_store_inferior_registers (struct regcache *regcache, int regno) + { +@@ -997,6 +1007,7 @@ _initialize_ppc_linux_nat (void) + t->to_remove_watchpoint = ppc_linux_remove_watchpoint; + t->to_stopped_by_watchpoint = ppc_linux_stopped_by_watchpoint; + t->to_stopped_data_address = ppc_linux_stopped_data_address; ++ t->to_watchpoint_addr_within_range = ppc_linux_watchpoint_addr_within_range; + + t->to_read_description = ppc_linux_read_description; + +Index: gdb/target.c +=================================================================== +RCS file: /cvs/src/src/gdb/target.c,v +retrieving revision 1.159 +diff -u -a -p -a -u -p -r1.159 gdb/target.c +--- gdb/target.c 28 Mar 2008 16:37:08 -0000 1.159 ++++ gdb/target.c 23 Apr 2008 11:00:52 -0000 +@@ -49,6 +49,9 @@ static void kill_or_be_killed (int); + + static void default_terminal_info (char *, int); + ++static int default_watchpoint_addr_within_range (struct target_ops *, ++ CORE_ADDR, CORE_ADDR, int); ++ + static int default_region_ok_for_hw_watchpoint (CORE_ADDR, int); + + static int nosymbol (char *, CORE_ADDR *); +@@ -131,6 +134,9 @@ static int debug_to_stopped_by_watchpoin + + static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); + ++static int debug_to_watchpoint_addr_within_range (struct target_ops *, ++ CORE_ADDR, CORE_ADDR, int); ++ + static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, int); + + static void debug_to_terminal_init (void); +@@ -416,9 +422,10 @@ update_current_target (void) + INHERIT (to_insert_watchpoint, t); + INHERIT (to_remove_watchpoint, t); + INHERIT (to_stopped_data_address, t); +- INHERIT (to_stopped_by_watchpoint, t); + INHERIT (to_have_steppable_watchpoint, t); + INHERIT (to_have_continuable_watchpoint, t); ++ INHERIT (to_stopped_by_watchpoint, t); ++ INHERIT (to_watchpoint_addr_within_range, t); + INHERIT (to_region_ok_for_hw_watchpoint, t); + INHERIT (to_terminal_init, t); + INHERIT (to_terminal_inferior, t); +@@ -544,6 +551,8 @@ update_current_target (void) + de_fault (to_stopped_data_address, + (int (*) (struct target_ops *, CORE_ADDR *)) + return_zero); ++ de_fault (to_watchpoint_addr_within_range, ++ default_watchpoint_addr_within_range); + de_fault (to_region_ok_for_hw_watchpoint, + default_region_ok_for_hw_watchpoint); + de_fault (to_terminal_init, +@@ -1873,6 +1882,14 @@ default_region_ok_for_hw_watchpoint (COR + } + + static int ++default_watchpoint_addr_within_range (struct target_ops *target, ++ CORE_ADDR addr, ++ CORE_ADDR start, int length) ++{ ++ return addr >= start && addr < start + length; ++} ++ ++static int + return_zero (void) + { + return 0; +@@ -2440,6 +2457,23 @@ debug_to_stopped_data_address (struct ta + } + + static int ++debug_to_watchpoint_addr_within_range (struct target_ops *target, ++ CORE_ADDR addr, ++ CORE_ADDR start, int length) ++{ ++ int retval; ++ ++ retval = debug_target.to_watchpoint_addr_within_range (target, addr, ++ start, length); ++ ++ fprintf_filtered (gdb_stdlog, ++ "target_watchpoint_addr_within_range (0x%lx, 0x%lx, %d) = %d\n", ++ (unsigned long) addr, (unsigned long) start, length, ++ retval); ++ return retval; ++} ++ ++static int + debug_to_insert_hw_breakpoint (struct bp_target_info *bp_tgt) + { + int retval; +@@ -2782,6 +2816,7 @@ setup_target_debug (void) + current_target.to_remove_watchpoint = debug_to_remove_watchpoint; + current_target.to_stopped_by_watchpoint = debug_to_stopped_by_watchpoint; + current_target.to_stopped_data_address = debug_to_stopped_data_address; ++ current_target.to_watchpoint_addr_within_range = debug_to_watchpoint_addr_within_range; + current_target.to_region_ok_for_hw_watchpoint = debug_to_region_ok_for_hw_watchpoint; + current_target.to_terminal_init = debug_to_terminal_init; + current_target.to_terminal_inferior = debug_to_terminal_inferior; +Index: gdb/target.h +=================================================================== +RCS file: /cvs/src/src/gdb/target.h,v +retrieving revision 1.116 +diff -u -a -p -a -u -p -r1.116 gdb/target.h +--- gdb/target.h 8 Apr 2008 17:02:23 -0000 1.116 ++++ gdb/target.h 23 Apr 2008 11:00:52 -0000 +@@ -367,6 +367,8 @@ struct target_ops + int to_have_steppable_watchpoint; + int to_have_continuable_watchpoint; + int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *); ++ int (*to_watchpoint_addr_within_range) (struct target_ops *, ++ CORE_ADDR, CORE_ADDR, int); + int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, int); + void (*to_terminal_init) (void); + void (*to_terminal_inferior) (void); +@@ -1093,6 +1095,9 @@ extern int target_stopped_data_address_p + #define target_stopped_data_address_p(CURRENT_TARGET) (1) + #endif + ++#define target_watchpoint_addr_within_range(target, addr, start, length) \ ++ (*target.to_watchpoint_addr_within_range) (target, addr, start, length) ++ + extern const struct target_desc *target_read_description (struct target_ops *); + + /* Command logging facility. */ +--- gdb/doc/gdbint.texinfo.~1.281.~ 2008-04-22 11:46:53.000000000 +0200 ++++ gdb/doc/gdbint.texinfo 2008-04-23 12:01:04.000000000 +0200 +@@ -9,7 +9,7 @@ + @ifinfo + This file documents the internals of the GNU debugger @value{GDBN}. + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001, +- 2002, 2003, 2004, 2005, 2006 ++ 2002, 2003, 2004, 2005, 2006, 2008 + Free Software Foundation, Inc. + Contributed by Cygnus Solutions. Written by John Gilmore. + Second Edition by Stan Shebs. +@@ -743,10 +743,19 @@ target's watchpoint indication is sticky + resuming, this method should clear it. For instance, the x86 debug + control register has sticky triggered flags. + ++@findex target_watchpoint_addr_within_range ++@item target_watchpoint_addr_within_range (@var{addr}, @var{start}, @var{length}) ++Check whether @var{addr} (as returned by @code{target_stopped_data_address}x) ++lies within the hardware-defined watchpoint region described by ++@var{start} and @var{length}. This only needs to be provided if the ++granularity of a watchpoint is greater than one byte, i.e., if the ++watchpoint can also trigger on nearby addresses outside of the watched ++region. ++ + @findex HAVE_STEPPABLE_WATCHPOINT + @item HAVE_STEPPABLE_WATCHPOINT + If defined to a non-zero value, it is not necessary to disable a +-watchpoint to step over it. Like @code{gdbarch_have_nonsteppable_watchpoint}, ++watchpoint to step over it. Like @code{gdbarch_have_nonsteppable_watchpoint}, + this is usually set when watchpoints trigger at the instruction + which will perform an interesting read or write. It should be + set if there is a temporary disable bit which allows the processor