summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorStefan Hajnoczi2008-06-12 17:56:20 +0200
committerMichael Brown2008-06-30 20:19:48 +0200
commit19386ec2c8c9f266425453673ba051cdb550d0c3 (patch)
tree3b159c2ad6bcb40241b82279c98742c9dca6ff65 /src/tests
parent[GDB] Remote debugging over UDP (diff)
downloadipxe-19386ec2c8c9f266425453673ba051cdb550d0c3.tar.gz
ipxe-19386ec2c8c9f266425453673ba051cdb550d0c3.tar.xz
ipxe-19386ec2c8c9f266425453673ba051cdb550d0c3.zip
[GDB] Add watch and rwatch hardware watchpoints
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/gdbstub_test.S21
-rwxr-xr-xsrc/tests/gdbstub_test.gdb30
2 files changed, 51 insertions, 0 deletions
diff --git a/src/tests/gdbstub_test.S b/src/tests/gdbstub_test.S
index 64783089..bd293836 100644
--- a/src/tests/gdbstub_test.S
+++ b/src/tests/gdbstub_test.S
@@ -1,4 +1,9 @@
.arch i386
+
+ .section ".data"
+watch_me:
+ .long 0xfeedbeef
+
.section ".text"
.code32
gdbstub_test:
@@ -29,5 +34,21 @@ gdbstub_test:
int $3
nop
+ /* 6. Access watch test */
+ movl $0x600d0000, %ecx
+ movl watch_me, %eax
+ movl $0xbad00000, %ecx
+ int $3
+ movl $0x600d0001, %ecx
+ movl %eax, watch_me
+ movl $0xbad00001, %ecx
+ int $3
+
+ /* 7. Write watch test */
+ movl $0x600d0002, %ecx
+ movl %eax, watch_me
+ movl $0xbad00002, %ecx
+ int $3
+
1:
jmp 1b
diff --git a/src/tests/gdbstub_test.gdb b/src/tests/gdbstub_test.gdb
index c86d4f2a..191799af 100755
--- a/src/tests/gdbstub_test.gdb
+++ b/src/tests/gdbstub_test.gdb
@@ -77,6 +77,34 @@ define gpxe_test_step
gpxe_assert ({char}($eip-1)) (char)0x90 "gpxe_test_step" # nop = 0x90
end
+define gpxe_test_awatch
+ awatch watch_me
+
+ c
+ gpxe_assert $ecx 0x600d0000 "gpxe_test_awatch"
+ if $ecx == 0x600d0000
+ c
+ end
+
+ c
+ gpxe_assert $ecx 0x600d0001 "gpxe_test_awatch"
+ if $ecx == 0x600d0001
+ c
+ end
+
+ delete
+end
+
+define gpxe_test_watch
+ watch watch_me
+ c
+ gpxe_assert $ecx 0x600d0002 "gpxe_test_watch"
+ if $ecx == 0x600d0002
+ c
+ end
+ delete
+end
+
gpxe_load_symbols
gpxe_start_tests
gpxe_test_regs_read
@@ -84,3 +112,5 @@ gpxe_test_regs_write
gpxe_test_mem_read
gpxe_test_mem_write
gpxe_test_step
+gpxe_test_awatch
+gpxe_test_watch