From: Yao Qi <qiyaoltc@gmail.com>
To: Pedro Alves <palves@redhat.com>
Cc: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH 02/25] Adjust the order of 32bit-linux.xml and 32bit-sse.xml in i386/i386-linux.xml
Date: Tue, 20 Jun 2017 09:20:00 -0000 [thread overview]
Message-ID: <86efuf582m.fsf@gmail.com> (raw)
In-Reply-To: <7872d3fa-7131-d84c-483d-05eca415ca63@redhat.com> (Pedro Alves's message of "Mon, 19 Jun 2017 22:56:44 +0100")
Pedro Alves <palves@redhat.com> writes:
This patch doesn't change the registers layout in gdbserver, because
gdb/regformats/i386/i386-linux.dat isn't affected by this patch. It
determines the register layout for i386-linux, in which "orig_eax" is
already put the end of list, thanks to sort-regs.xsl.
This patch only changes the order of iterating features and registers in
GDB, however, the order doesn't matter.
> It may be easy to check against gdbserver. You'd need to hack it to
> disable the x86 xml tdesc support, which is a relatively
> recent addition. [It took a while for the x86 port to support xml
> tdescs]. The xmlRegisters= qSupported feature had to invented to
> keep backward compatibility back then.
>
> E.g., hack gdb's remote.c:register_remote_support_xml, or
> gdbserver's linux-x86-low.c:x86_linux_process_qsupported.
> If, with x86 XML support disabled, before vs after patch the
> layout of GDB's g/G packet buffer changes, then you have
> a back compatibility break.
I hacked remote.c:register_remote_support_xml like this,
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -4711,6 +4711,7 @@ void
register_remote_support_xml (const char *xml)
{
#if defined(HAVE_LIBEXPAT)
+#if 0
if (remote_support_xml == NULL)
remote_support_xml = concat ("xmlRegisters=", xml, (char *) NULL);
else
@@ -4735,6 +4736,7 @@ register_remote_support_xml (const char *xml)
(char *) NULL);
}
#endif
+#endif
}
static char *
---
so GDB doesn't send qSupported:xmlRegisters=i386, and as a result,
GDBserver doesn't reply GDB about the target description registers,
Sending packet: $qXfer:features:read:target.xml:0,fff#7d...Packet received: l<target><architecture>i386</architecture><osabi>GNU/Linux</osabi></target>
The GDB's understanding to g/G packet layout is not changed, verified by
"maintenance print remote-registers",
(gdb) maintenance print remote-registers
Name Nr Rel Offset Size Type Rmt Nr g/G Offset
eax 0 0 0 4 int32_t 0 0
ecx 1 1 4 4 int32_t 1 4
edx 2 2 8 4 int32_t 2 8
ebx 3 3 12 4 int32_t 3 12
esp 4 4 16 4 *1 4 16
ebp 5 5 20 4 *1 5 20
esi 6 6 24 4 int32_t 6 24
edi 7 7 28 4 int32_t 7 28
eip 8 8 32 4 *1 8 32
eflags 9 9 36 4 i386_eflags 9 36
cs 10 10 40 4 int32_t 10 40
ss 11 11 44 4 int32_t 11 44
ds 12 12 48 4 int32_t 12 48
es 13 13 52 4 int32_t 13 52
fs 14 14 56 4 int32_t 14 56
gs 15 15 60 4 int32_t 15 60
st0 16 16 64 10 _i387_ext 16 64
st1 17 17 74 10 _i387_ext 17 74
st2 18 18 84 10 _i387_ext 18 84
st3 19 19 94 10 _i387_ext 19 94
st4 20 20 104 10 _i387_ext 20 104
st5 21 21 114 10 _i387_ext 21 114
st6 22 22 124 10 _i387_ext 22 124
st7 23 23 134 10 _i387_ext 23 134
fctrl 24 24 144 4 long 24 144
fstat 25 25 148 4 long 25 148
ftag 26 26 152 4 long 26 152
fiseg 27 27 156 4 long 27 156
fioff 28 28 160 4 long 28 160
foseg 29 29 164 4 long 29 164
fooff 30 30 168 4 long 30 168
fop 31 31 172 4 long 31 172
xmm0 32 32 176 16 vec128 32 176
xmm1 33 33 192 16 vec128 33 192
xmm2 34 34 208 16 vec128 34 208
xmm3 35 35 224 16 vec128 35 224
xmm4 36 36 240 16 vec128 36 240
xmm5 37 37 256 16 vec128 37 256
xmm6 38 38 272 16 vec128 38 272
xmm7 39 39 288 16 vec128 39 288
mxcsr 40 40 304 4 i386_mxcsr 40 304
'' 41 41 308 0 int0_t
'' 42 42 308 0 int0_t
'' 43 43 308 0 int0_t
'' 44 44 308 0 int0_t
'' 45 45 308 0 int0_t
'' 46 46 308 0 int0_t
'' 47 47 308 0 int0_t
'' 48 48 308 0 int0_t
'' 49 49 308 0 int0_t
'' 50 50 308 0 int0_t
'' 51 51 308 0 int0_t
'' 52 52 308 0 int0_t
'' 53 53 308 0 int0_t
'' 54 54 308 0 int0_t
'' 55 55 308 0 int0_t
'' 56 56 308 0 int0_t
'' 57 57 308 0 int0_t
'' 58 58 308 0 int0_t
'' 59 59 308 0 int0_t
'' 60 60 308 0 int0_t
'' 61 61 308 0 int0_t
'' 62 62 308 0 int0_t
'' 63 63 308 0 int0_t
'' 64 64 308 0 int0_t
'' 65 65 308 0 int0_t
'' 66 66 308 0 int0_t
'' 67 67 308 0 int0_t
'' 68 68 308 0 int0_t
'' 69 69 308 0 int0_t
'' 70 70 308 0 int0_t
'' 71 71 308 0 int0_t
orig_eax 72 72 308 4 long 41 308
al 73 0 312 1 int8_t
cl 74 1 313 1 int8_t
dl 75 2 314 1 int8_t
bl 76 3 315 1 int8_t
ah 77 4 316 1 int8_t
ch 78 5 317 1 int8_t
dh 79 6 318 1 int8_t
bh 80 7 319 1 int8_t
ax 81 8 320 2 int16_t
cx 82 9 322 2 int16_t
dx 83 10 324 2 int16_t
bx 84 11 326 2 int16_t
'' 85 12 328 2 int16_t
bp 86 13 330 2 int16_t
si 87 14 332 2 int16_t
di 88 15 334 2 int16_t
mm0 89 16 336 8 _vec64i
mm1 90 17 344 8 _vec64i
mm2 91 18 352 8 _vec64i
mm3 92 19 360 8 _vec64i
mm4 93 20 368 8 _vec64i
mm5 94 21 376 8 _vec64i
mm6 95 22 384 8 _vec64i
mm7 96 23 392 8 _vec64i
however, I can't verify that GDBserver's understanding to g/G packet
layout is not changed, unless we write a unit test, but as I analyzed
above, the layout in GDBserver side doesn't change.
--
Yao (齐尧)
next prev parent reply other threads:[~2017-06-20 9:20 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-12 8:42 [PATCH 00/25 V2] Make GDB builtin target descriptions more flexible Yao Qi
2017-06-12 8:42 ` [PATCH 24/25] [GDBserver] Use pre-generated amd64-linux tdesc as test Yao Qi
2017-06-12 8:42 ` [PATCH 05/25] Use visitor pattern for "maint print c-tdesc" Yao Qi
2017-06-20 23:37 ` Simon Marchi
2017-06-12 8:42 ` [PATCH 25/25] Remove features/i386/amd64-*linux.c and features/i386/x32-*linux.c Yao Qi
2017-06-12 8:42 ` [PATCH 08/25] Add "maint check xml-descriptions" to test builtin xml target descriptions Yao Qi
2017-06-28 16:13 ` Pedro Alves
2017-06-12 8:42 ` [PATCH 12/25] [GDBserver] Centralize tdesc for i386-linux Yao Qi
2017-06-12 8:42 ` [PATCH 02/25] Adjust the order of 32bit-linux.xml and 32bit-sse.xml in i386/i386-linux.xml Yao Qi
2017-06-19 20:22 ` Simon Marchi
2017-06-19 21:24 ` Pedro Alves
2017-06-19 21:48 ` Simon Marchi
2017-06-19 21:56 ` Pedro Alves
2017-06-20 9:20 ` Yao Qi [this message]
2017-06-20 10:12 ` Pedro Alves
2017-06-20 11:09 ` Yao Qi
2017-06-12 8:42 ` [PATCH 21/25] Lazily and dynamically create amd64-linux target descriptions Yao Qi
2017-06-12 8:42 ` [PATCH 04/25] Centralize i386 linux " Yao Qi
2017-06-19 21:27 ` Simon Marchi
2017-06-12 8:42 ` [PATCH 01/25] Move initialize_tdesc_mips* calls from mips-linux-nat.c to mips-linux-tdep.c Yao Qi
2017-06-12 15:25 ` Maciej W. Rozycki
2017-06-13 8:07 ` Yao Qi
2017-06-12 8:42 ` [PATCH 09/25] Use target_desc fields expedite_regs and xmltarget ifndef IN_PROCESS_AGENT Yao Qi
2017-06-28 16:16 ` Pedro Alves
2017-06-28 17:42 ` Pedro Alves
2017-06-28 17:45 ` Pedro Alves
2017-06-29 11:45 ` Yao Qi
2017-06-12 8:42 ` [PATCH 15/25] [RFC] GDBserver unit test to i386_tdesc Yao Qi
2017-06-28 17:22 ` Pedro Alves
2017-06-29 9:27 ` Yao Qi
2017-06-12 8:42 ` [PATCH 14/25] [RFC] GDBserver self test Yao Qi
2017-06-28 17:09 ` Pedro Alves
2017-06-29 9:08 ` Yao Qi
2017-06-12 8:42 ` [PATCH 16/25] Dynamically composite xml in reply to GDB Yao Qi
2017-06-12 8:42 ` [PATCH 22/25] Regenerate two regformats/i386/.dat files Yao Qi
2017-06-22 12:43 ` Yao Qi
2017-06-12 8:42 ` [PATCH 20/25] Centralize amd64-linux target descriptions Yao Qi
2017-06-12 8:42 ` [PATCH 07/25] Lazily and dynamically create i386-linux " Yao Qi
2017-06-20 11:01 ` Pedro Alves
2017-06-20 14:07 ` Yao Qi
2017-06-28 15:30 ` Pedro Alves
2017-06-12 8:42 ` [PATCH 10/25] Adjust code generated by regformats/regdat.sh Yao Qi
[not found] ` <92ca03ca-e06d-09fc-7243-e52dd29edcef@redhat.com>
2017-06-21 14:28 ` Yao Qi
2017-06-12 8:42 ` [PATCH 06/25] Generate c for feature instead of tdesc Yao Qi
2017-06-12 14:48 ` Eli Zaretskii
2017-06-13 12:07 ` Yao Qi
2017-06-13 14:49 ` Eli Zaretskii
2017-06-13 15:31 ` Yao Qi
2017-06-13 15:41 ` Eli Zaretskii
2017-06-14 16:21 ` Yao Qi
2017-06-14 16:32 ` Eli Zaretskii
2017-06-15 13:19 ` Yao Qi
2017-06-15 14:45 ` Eli Zaretskii
[not found] ` <d0c0b3b2-e585-acbb-d63e-6be6a6fe11a9@redhat.com>
[not found] ` <86mv90hyci.fsf@gmail.com>
2017-06-22 15:36 ` Pedro Alves
2017-06-22 15:58 ` Yao Qi
2017-06-26 21:38 ` Simon Marchi
2017-06-29 15:24 ` Yao Qi
2017-06-12 8:42 ` [PATCH 11/25] Use VEC for target_desc.reg_defs Yao Qi
2017-06-28 19:01 ` Pedro Alves
2017-06-29 11:05 ` Yao Qi
2017-06-29 11:31 ` Pedro Alves
2017-06-29 13:24 ` Yao Qi
2017-06-12 8:42 ` [PATCH 13/25] Dynamically create tdesc in GDBserver Yao Qi
2017-06-12 8:42 ` [PATCH 03/25] Class-fy tdesc_reg tdesc_type and tdesc_feature Yao Qi
2017-06-19 20:55 ` Simon Marchi
2017-06-19 21:30 ` Simon Marchi
2017-06-20 10:31 ` Yao Qi
2017-06-12 8:42 ` [PATCH 19/25] GDBserver: remove srv_i386_linux_xmlfiles Yao Qi
2017-06-12 8:42 ` [PATCH 18/25] [GDBserver] Use pre-generated tdesc as test Yao Qi
2017-06-12 8:42 ` [PATCH 23/25] [GDBserver] Convert amd64-linux target descriptions Yao Qi
2017-06-28 19:00 ` Pedro Alves
2017-06-12 8:42 ` [PATCH 17/25] Remove features/i386/i386-*linux.c Yao Qi
2017-06-19 19:59 ` [PATCH 00/25 V2] Make GDB builtin target descriptions more flexible Simon Marchi
2017-06-20 11:02 ` Yao Qi
2017-06-26 14:45 ` Tedeschi, Walfred
2017-06-27 13:49 ` Alan Hayward
2017-06-28 8:28 ` Yao Qi
2017-06-28 8:06 ` Yao Qi
2017-06-28 19:06 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86efuf582m.fsf@gmail.com \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox