Commit fde3fd6184fcf8740424218634daaeb3028b3042
1 parent
60897d36
Remove x86-64 specific reg fillers.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4392 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
1 additions
and
134 deletions
gdbstub.c
... | ... | @@ -238,141 +238,8 @@ static int put_packet(GDBState *s, char *buf) |
238 | 238 | } |
239 | 239 | return 0; |
240 | 240 | } |
241 | -#if defined(TARGET_X86_64) | |
242 | 241 | |
243 | -static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf) | |
244 | -{ | |
245 | - uint8_t *p = mem_buf; | |
246 | - int i, fpus; | |
247 | - | |
248 | -#define PUTREG(x) do { \ | |
249 | - target_ulong reg = tswapl(x); \ | |
250 | - memcpy(p, ®, sizeof reg); \ | |
251 | - p += sizeof reg; \ | |
252 | - } while (0) | |
253 | -#define PUTREG32(x) do { \ | |
254 | - uint32_t reg = tswap32(x); \ | |
255 | - memcpy(p, ®, sizeof reg); \ | |
256 | - p += sizeof reg; \ | |
257 | - } while (0) | |
258 | -#define PUTREGF(x) do { \ | |
259 | - memcpy(p, &(x), 10); \ | |
260 | - p += sizeof (x); \ | |
261 | - } while (0) | |
262 | - | |
263 | - PUTREG(env->regs[R_EAX]); | |
264 | - PUTREG(env->regs[R_EBX]); | |
265 | - PUTREG(env->regs[R_ECX]); | |
266 | - PUTREG(env->regs[R_EDX]); | |
267 | - PUTREG(env->regs[R_ESI]); | |
268 | - PUTREG(env->regs[R_EDI]); | |
269 | - PUTREG(env->regs[R_EBP]); | |
270 | - PUTREG(env->regs[R_ESP]); | |
271 | - PUTREG(env->regs[8]); | |
272 | - PUTREG(env->regs[9]); | |
273 | - PUTREG(env->regs[10]); | |
274 | - PUTREG(env->regs[11]); | |
275 | - PUTREG(env->regs[12]); | |
276 | - PUTREG(env->regs[13]); | |
277 | - PUTREG(env->regs[14]); | |
278 | - PUTREG(env->regs[15]); | |
279 | - | |
280 | - PUTREG(env->eip); | |
281 | - PUTREG32(env->eflags); | |
282 | - PUTREG32(env->segs[R_CS].selector); | |
283 | - PUTREG32(env->segs[R_SS].selector); | |
284 | - PUTREG32(env->segs[R_DS].selector); | |
285 | - PUTREG32(env->segs[R_ES].selector); | |
286 | - PUTREG32(env->segs[R_FS].selector); | |
287 | - PUTREG32(env->segs[R_GS].selector); | |
288 | - /* XXX: convert floats */ | |
289 | - for(i = 0; i < 8; i++) { | |
290 | - PUTREGF(env->fpregs[i]); | |
291 | - } | |
292 | - PUTREG32(env->fpuc); | |
293 | - fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11; | |
294 | - PUTREG32(fpus); | |
295 | - PUTREG32(0); /* XXX: convert tags */ | |
296 | - PUTREG32(0); /* fiseg */ | |
297 | - PUTREG32(0); /* fioff */ | |
298 | - PUTREG32(0); /* foseg */ | |
299 | - PUTREG32(0); /* fooff */ | |
300 | - PUTREG32(0); /* fop */ | |
301 | - | |
302 | -#undef PUTREG | |
303 | -#undef PUTREG32 | |
304 | -#undef PUTREGF | |
305 | - | |
306 | - return p - mem_buf; | |
307 | -} | |
308 | - | |
309 | -static void cpu_gdb_write_registers(CPUState *env, uint8_t *mem_buf, int size) | |
310 | -{ | |
311 | - uint8_t *p = mem_buf; | |
312 | - uint32_t junk; | |
313 | - int i, fpus; | |
314 | - | |
315 | -#define GETREG(x) do { \ | |
316 | - target_ulong reg; \ | |
317 | - memcpy(®, p, sizeof reg); \ | |
318 | - x = tswapl(reg); \ | |
319 | - p += sizeof reg; \ | |
320 | - } while (0) | |
321 | -#define GETREG32(x) do { \ | |
322 | - uint32_t reg; \ | |
323 | - memcpy(®, p, sizeof reg); \ | |
324 | - x = tswap32(reg); \ | |
325 | - p += sizeof reg; \ | |
326 | - } while (0) | |
327 | -#define GETREGF(x) do { \ | |
328 | - memcpy(&(x), p, 10); \ | |
329 | - p += 10; \ | |
330 | - } while (0) | |
331 | - | |
332 | - GETREG(env->regs[R_EAX]); | |
333 | - GETREG(env->regs[R_EBX]); | |
334 | - GETREG(env->regs[R_ECX]); | |
335 | - GETREG(env->regs[R_EDX]); | |
336 | - GETREG(env->regs[R_ESI]); | |
337 | - GETREG(env->regs[R_EDI]); | |
338 | - GETREG(env->regs[R_EBP]); | |
339 | - GETREG(env->regs[R_ESP]); | |
340 | - GETREG(env->regs[8]); | |
341 | - GETREG(env->regs[9]); | |
342 | - GETREG(env->regs[10]); | |
343 | - GETREG(env->regs[11]); | |
344 | - GETREG(env->regs[12]); | |
345 | - GETREG(env->regs[13]); | |
346 | - GETREG(env->regs[14]); | |
347 | - GETREG(env->regs[15]); | |
348 | - | |
349 | - GETREG(env->eip); | |
350 | - GETREG32(env->eflags); | |
351 | - GETREG32(env->segs[R_CS].selector); | |
352 | - GETREG32(env->segs[R_SS].selector); | |
353 | - GETREG32(env->segs[R_DS].selector); | |
354 | - GETREG32(env->segs[R_ES].selector); | |
355 | - GETREG32(env->segs[R_FS].selector); | |
356 | - GETREG32(env->segs[R_GS].selector); | |
357 | - /* XXX: convert floats */ | |
358 | - for(i = 0; i < 8; i++) { | |
359 | - GETREGF(env->fpregs[i]); | |
360 | - } | |
361 | - GETREG32(env->fpuc); | |
362 | - GETREG32(fpus); /* XXX: convert fpus */ | |
363 | - GETREG32(junk); /* XXX: convert tags */ | |
364 | - GETREG32(junk); /* fiseg */ | |
365 | - GETREG32(junk); /* fioff */ | |
366 | - GETREG32(junk); /* foseg */ | |
367 | - GETREG32(junk); /* fooff */ | |
368 | - GETREG32(junk); /* fop */ | |
369 | - | |
370 | -#undef GETREG | |
371 | -#undef GETREG32 | |
372 | -#undef GETREGF | |
373 | -} | |
374 | - | |
375 | -#elif defined(TARGET_I386) | |
242 | +#if defined(TARGET_I386) | |
376 | 243 | static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf) |
377 | 244 | { |
378 | 245 | int i, fpus; | ... | ... |