Kaynağa Gözat

[GDB] Zero-extend 16-bit segment registers

When the 16-bit segment registers are accessed using 32-bit instructions
the high order bytes are undefined on older CPUs.  We now explicitly
zero the high order bytes when snapshotting the CPU state.  This ensures
that the GDB stub reports consistent values for the segment registers.
tags/v0.9.4
Stefan Hajnoczi 16 yıl önce
ebeveyn
işleme
3715c8c721
2 değiştirilmiş dosya ile 14 ekleme ve 8 silme
  1. 12
    6
      src/arch/i386/core/gdbidt.S
  2. 2
    2
      src/tests/gdbstub_test.gdb

+ 12
- 6
src/arch/i386/core/gdbidt.S Dosyayı Görüntüle

163
 #define IH_OFFSET_FLUX_END ( IH_OFFSET_END - 20 )
163
 #define IH_OFFSET_FLUX_END ( IH_OFFSET_END - 20 )
164
 do_interrupt:
164
 do_interrupt:
165
 	/* Store CPU state in GDB register snapshot */
165
 	/* Store CPU state in GDB register snapshot */
166
-	pushl	%gs
167
-	pushl	%fs
168
-	pushl	%es
169
-	pushl	%ds
170
-	pushl	%ss
171
-	pushl	IH_OFFSET_FLUX_OLD_CS(%esp)
166
+	pushw	$0
167
+	pushw	%gs
168
+	pushw	$0
169
+	pushw	%fs
170
+	pushw	$0
171
+	pushw	%es
172
+	pushw	$0
173
+	pushw	%ds
174
+	pushw	$0
175
+	pushw	%ss
176
+	pushw	$0
177
+	pushw	IH_OFFSET_FLUX_OLD_CS + 2(%esp)
172
 	pushl	IH_OFFSET_FLUX_OLD_EFLAGS(%esp)
178
 	pushl	IH_OFFSET_FLUX_OLD_EFLAGS(%esp)
173
 	pushl	IH_OFFSET_FLUX_OLD_EIP(%esp)
179
 	pushl	IH_OFFSET_FLUX_OLD_EIP(%esp)
174
 	pushl	%edi
180
 	pushl	%edi

+ 2
- 2
src/tests/gdbstub_test.gdb Dosyayı Görüntüle

81
 	awatch watch_me
81
 	awatch watch_me
82
 
82
 
83
 	c
83
 	c
84
-	gpxe_assert $ecx 0x600d0000 "gpxe_test_awatch"
84
+	gpxe_assert $ecx 0x600d0000 "gpxe_test_awatch read"
85
 	if $ecx == 0x600d0000
85
 	if $ecx == 0x600d0000
86
 		c
86
 		c
87
 	end
87
 	end
88
 
88
 
89
 	c
89
 	c
90
-	gpxe_assert $ecx 0x600d0001 "gpxe_test_awatch"
90
+	gpxe_assert $ecx 0x600d0001 "gpxe_test_awatch write"
91
 	if $ecx == 0x600d0001
91
 	if $ecx == 0x600d0001
92
 		c
92
 		c
93
 	end
93
 	end

Loading…
İptal
Kaydet