PERFORCE change 49831 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sun Mar 28 00:50:43 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=49831
Change 49831 by marcel at marcel_nfs on 2004/03/28 00:50:36
Add support for machine dependent queries. Use this on ia64
to handle the Part:dirty:read:: query added to the remote
protocol to support the TARGET_OBJECT_DIRTY partial xfer.
In short: can can read the dirty stacked registers.
Affected files ...
.. //depot/projects/gdb/sys/gdb/gdb_main.c#11 edit
.. //depot/projects/gdb/sys/i386/include/gdb_machdep.h#5 edit
.. //depot/projects/gdb/sys/ia64/ia64/gdb_machdep.c#6 edit
.. //depot/projects/gdb/sys/ia64/include/gdb_machdep.h#5 edit
Differences ...
==== //depot/projects/gdb/sys/gdb/gdb_main.c#11 (text+ko) ====
@@ -183,7 +183,7 @@
gdb_tx_begin('l');
gdb_tx_end();
}
- } else
+ } else if (!gdb_cpu_query())
gdb_tx_empty();
break;
case 's': { /* single step */
==== //depot/projects/gdb/sys/i386/include/gdb_machdep.h#5 (text+ko) ====
@@ -39,6 +39,12 @@
return (sizeof(int));
}
+static __inline int
+gdb_cpu_query(void)
+{
+ return (0);
+}
+
void *gdb_cpu_getreg(int, size_t *);
void gdb_cpu_setreg(int, register_t);
int gdb_cpu_signal(int, int);
==== //depot/projects/gdb/sys/ia64/ia64/gdb_machdep.c#6 (text+ko) ====
@@ -39,6 +39,7 @@
#include <machine/reg.h>
#include <gdb/gdb.h>
+#include <gdb/gdb_int.h>
void *
gdb_cpu_getreg(int regnum, size_t *regsz)
@@ -122,3 +123,26 @@
case GDB_REG_PC: break;
}
}
+
+int
+gdb_cpu_query(void)
+{
+ if (gdb_rx_equal("Part:dirty:read::")) {
+ uint64_t *kstack;
+ uintmax_t slot;
+ if (gdb_rx_varhex(&slot) < 0) {
+ gdb_tx_err(EINVAL);
+ return (-1);
+ }
+ if (slot >= 0 && slot < (kdb_frame->tf_special.ndirty >> 3)) {
+ kstack = (uint64_t*)(kdb_thread->td_kstack +
+ (kdb_frame->tf_special.bspstore & 0x1ffUL));
+ gdb_tx_begin('\0');
+ gdb_tx_mem((void*)(kstack + slot), 8);
+ gdb_tx_end();
+ }
+ return (1);
+ }
+
+ return (0);
+}
==== //depot/projects/gdb/sys/ia64/include/gdb_machdep.h#5 (text+ko) ====
@@ -48,5 +48,6 @@
void *gdb_cpu_getreg(int, size_t *);
void gdb_cpu_setreg(int, register_t);
+int gdb_cpu_query(void);
#endif /* !_MACHINE_GDB_MACHDEP_H_ */
More information about the p4-projects
mailing list