This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Missing test cases for jit-reader interface
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Andy Wingo <wingo at igalia dot com>
- Cc: gdb-patches at sourceware dot org, jan dot kratochvil at redhat dot com, sanjoyd at sourceware dot org
- Date: Wed, 25 Feb 2015 22:38:53 +0000
- Subject: Re: Missing test cases for jit-reader interface
- Authentication-results: sourceware.org; auth=none
- References: <87oaolx6xy dot fsf at igalia dot com> <87k2z8ydq4 dot fsf at igalia dot com> <86y4nmvvme dot fsf at gmail dot com> <87egpeufib dot fsf at igalia dot com>
On 02/25/2015 04:23 PM, Andy Wingo wrote:
> The test is arch-specific because it has a simple x86 "jit". See
> jithost.c.
>
If jithost.c has arch-specific stuff, let us move all arch-specific
stuff there, like,
#if defined __x86_64__
code[0] = 0xcc; /* SIGTRAP */
code[1] = 0xc3; /* RET */
#else
#error "don't know what instructions to generate"
#endif
in jit-reader.exp, if jithost.c is compiled successfully, do the tests,
otherwise, emit UNSUPPORTED and return. In this way, once some one
wants to extend jit-reader.exp for other targets, he or she needs
to change this part in jithost.c to generate corresponding instructions,
breakpoint instruction and return instruction, right?
jitreader.c needs the same treatment too, but I am fine to leave it
as-is now.
>>> >> +if { ![isnative] } {
>>> >> + return -1
>>> >> +}
>> >
>> > and remove it too.
> Does it not need to be this way? If you are debugging from a big-endian
> host, you will read the addresses wrong from the inferior, as the
> jit-reader .so reads the values directly. (Seems to me anyway.)
>
My understanding is that jitreader accesses inferior through GDB, no?
--
Yao