This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Move hpux specific hacks to hpux files
- From: Randolph Chung <randolph at tausq dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 12 Nov 2004 10:38:41 -0800
- Subject: [commit] Move hpux specific hacks to hpux files
- Reply-to: Randolph Chung <randolph at tausq dot org>
SKIP_PERMANENT_BREAKPOINT is used to work with the ... um... innovative
hpux shared library event mechanism. This moves it into the
hpux-specific files. Compile tested on hppa-linux and
hppa2.0w-hp-hpux11.11. Committed as obvious.
I would like to get rid of this eventually, but that's for another day.
:)
2004-11-12 Randolph Chung <tausq@debian.org>
* hppa-tdep.c (hppa_skip_permanent_breakpoint): Move definition ...
* hppa-hpux-tdep.c (hppa_skip_permanent_breakpoint): ... to here.
* config/pa/tm-hppa.h (SKIP_PERMANENT_BREAKPOINT): Move definition ...
* config/pa/tm-hppah.h (SKIP_PERMANENT_BREAKPOINT): ... to here.
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.179
diff -u -p -r1.179 hppa-tdep.c
--- hppa-tdep.c 12 Nov 2004 00:51:23 -0000 1.179
+++ hppa-tdep.c 12 Nov 2004 18:07:48 -0000
@@ -2264,30 +2264,6 @@ unwind_command (char *exp, int from_tty)
pin (Total_frame_size);
}
-void
-hppa_skip_permanent_breakpoint (void)
-{
- /* To step over a breakpoint instruction on the PA takes some
- fiddling with the instruction address queue.
-
- When we stop at a breakpoint, the IA queue front (the instruction
- we're executing now) points at the breakpoint instruction, and
- the IA queue back (the next instruction to execute) points to
- whatever instruction we would execute after the breakpoint, if it
- were an ordinary instruction. This is the case even if the
- breakpoint is in the delay slot of a branch instruction.
-
- Clearly, to step past the breakpoint, we need to set the queue
- front to the back. But what do we put in the back? What
- instruction comes after that one? Because of the branch delay
- slot, the next insn is always at the back + 4. */
- write_register (HPPA_PCOQ_HEAD_REGNUM, read_register (HPPA_PCOQ_TAIL_REGNUM));
- write_register (HPPA_PCSQ_HEAD_REGNUM, read_register (HPPA_PCSQ_TAIL_REGNUM));
-
- write_register (HPPA_PCOQ_TAIL_REGNUM, read_register (HPPA_PCOQ_TAIL_REGNUM) + 4);
- /* We can leave the tail's space the same, since there's no jump. */
-}
-
int
hppa_pc_requires_run_before_use (CORE_ADDR pc)
{
Index: hppa-hpux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v
retrieving revision 1.24
diff -u -p -r1.24 hppa-hpux-tdep.c
--- hppa-hpux-tdep.c 31 Oct 2004 21:09:28 -0000 1.24
+++ hppa-hpux-tdep.c 12 Nov 2004 18:09:35 -0000
@@ -505,6 +505,29 @@ hppa_hpux_skip_trampoline_code (CORE_ADD
}
}
+void
+hppa_skip_permanent_breakpoint (void)
+{
+ /* To step over a breakpoint instruction on the PA takes some
+ fiddling with the instruction address queue.
+
+ When we stop at a breakpoint, the IA queue front (the instruction
+ we're executing now) points at the breakpoint instruction, and
+ the IA queue back (the next instruction to execute) points to
+ whatever instruction we would execute after the breakpoint, if it
+ were an ordinary instruction. This is the case even if the
+ breakpoint is in the delay slot of a branch instruction.
+
+ Clearly, to step past the breakpoint, we need to set the queue
+ front to the back. But what do we put in the back? What
+ instruction comes after that one? Because of the branch delay
+ slot, the next insn is always at the back + 4. */
+ write_register (HPPA_PCOQ_HEAD_REGNUM, read_register (HPPA_PCOQ_TAIL_REGNUM));
+ write_register (HPPA_PCSQ_HEAD_REGNUM, read_register (HPPA_PCSQ_TAIL_REGNUM));
+
+ write_register (HPPA_PCOQ_TAIL_REGNUM, read_register (HPPA_PCOQ_TAIL_REGNUM) + 4);
+ /* We can leave the tail's space the same, since there's no jump. */
+}
/* Exception handling support for the HP-UX ANSI C++ compiler.
The compiler (aCC) provides a callback for exception events;
Index: config/pa/tm-hppa.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppa.h,v
retrieving revision 1.75
diff -u -p -r1.75 tm-hppa.h
--- config/pa/tm-hppa.h 2 Sep 2004 14:17:41 -0000 1.75
+++ config/pa/tm-hppa.h 12 Nov 2004 18:07:49 -0000
@@ -34,7 +34,3 @@ extern int hppa_pc_requires_run_before_u
extern int hppa_instruction_nullified (void);
#define INSTRUCTION_NULLIFIED hppa_instruction_nullified ()
#endif
-
-/* Here's how to step off a permanent breakpoint. */
-#define SKIP_PERMANENT_BREAKPOINT (hppa_skip_permanent_breakpoint)
-extern void hppa_skip_permanent_breakpoint (void);
Index: config/pa/tm-hppah.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppah.h,v
retrieving revision 1.13
diff -u -p -r1.13 tm-hppah.h
--- config/pa/tm-hppah.h 3 Apr 2004 17:27:54 -0000 1.13
+++ config/pa/tm-hppah.h 12 Nov 2004 18:07:49 -0000
@@ -41,5 +41,9 @@ struct frame_info;
#define CHILD_ENABLE_EXCEPTION_CALLBACK
#define CHILD_GET_CURRENT_EXCEPTION_EVENT
+/* Here's how to step off a permanent breakpoint. */
+#define SKIP_PERMANENT_BREAKPOINT (hppa_skip_permanent_breakpoint)
+extern void hppa_skip_permanent_breakpoint (void);
+
/* Mostly it's common to all HPPA's. */
#include "pa/tm-hppa.h"
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/