Revision 986a2998 include/exec/gdbstub.h
b/include/exec/gdbstub.h | ||
---|---|---|
39 | 39 |
#endif |
40 | 40 |
} |
41 | 41 |
|
42 |
/* The GDB remote protocol transfers values in target byte order. This means |
|
43 |
* we can use the raw memory access routines to access the value buffer. |
|
44 |
* Conveniently, these also handle the case where the buffer is mis-aligned. |
|
45 |
*/ |
|
46 |
|
|
47 |
static inline int gdb_get_reg8(uint8_t *mem_buf, uint8_t val) |
|
48 |
{ |
|
49 |
stb_p(mem_buf, val); |
|
50 |
return 1; |
|
51 |
} |
|
52 |
|
|
53 |
static inline int gdb_get_reg16(uint8_t *mem_buf, uint16_t val) |
|
54 |
{ |
|
55 |
stw_p(mem_buf, val); |
|
56 |
return 2; |
|
57 |
} |
|
58 |
|
|
59 |
static inline int gdb_get_reg32(uint8_t *mem_buf, uint32_t val) |
|
60 |
{ |
|
61 |
stl_p(mem_buf, val); |
|
62 |
return 4; |
|
63 |
} |
|
64 |
|
|
65 |
static inline int gdb_get_reg64(uint8_t *mem_buf, uint64_t val) |
|
66 |
{ |
|
67 |
stq_p(mem_buf, val); |
|
68 |
return 8; |
|
69 |
} |
|
70 |
|
|
71 |
#if TARGET_LONG_BITS == 64 |
|
72 |
#define gdb_get_regl(buf, val) gdb_get_reg64(buf, val) |
|
73 |
#define ldtul_p(addr) ldq_p(addr) |
|
74 |
#else |
|
75 |
#define gdb_get_regl(buf, val) gdb_get_reg32(buf, val) |
|
76 |
#define ldtul_p(addr) ldl_p(addr) |
|
77 |
#endif |
|
78 |
|
|
42 | 79 |
#endif |
43 | 80 |
|
44 | 81 |
#ifdef CONFIG_USER_ONLY |
Also available in: Unified diff