This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Missing test cases for jit-reader interface


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]