Re: [PATCH 0/4] Save target description in tfile.

Marcin Kościelnicki
2016-02-10T14:25:31Z

On 10/02/16 15:24, Pedro Alves wrote:
> On 02/06/2016 03:39 PM, Marcin KoÅ›cielnicki wrote:
>> As discussed in the s390 trace thread, this adds target description
>> in XML format to tfile format. The idea is simple:
>>
>> 1. target.xml is read from the target.
>> 2. Includes are processed, resulting in a single in-memory XML file
>> containing all the data.
>> 3. The resulting file is stored in tfile header by prefixing every line
>> with "tdesc ". We may insert a spurious newline at the end of file
>> with this encoding, but that won't matter for XML.
>> 4. When tfile is read, the XML is stored in an allocated buffer, and
>> xfer for TARGET_OBJECT_AVAILABLE_FEATURES is implemented, reading
>> from it.
>> 5. target_find_description is called to force reading it.
>>
>> Patch #1 makes tsave write the XML data into tfile. Patch #2 makes
>> tfile reader fetch and parse this data. Patch #3 fixes wrong register
>> ordering in tfile_fetch_registers (noticed on x86_64 with AVX -
>> plain x86_64 was apparently fine). Patch #4 fixes an off-by-one
>> in the same function that prevented fetching the last register
>> (orig_rax for plain x86_64, $ymm15h for x86_64 with AVX).
>>
>
> I'd be good to also document the tdesc header lines in
> the "Trace File Format" node in the manual.

Alright, will do that in another commit.
>
> Thanks,
> Pedro Alves
>