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: [PATCH 07/25] Lazily and dynamically create i386-linux target descriptions


Pedro Alves <palves@redhat.com> writes:

> I don't see the unit test in the patch.
>

It is moved to patch 08/25.

> Can you say something about the "regnum = %ld" change?  Is it
> related to the rest of the patch?
>

Without this change, the lazily generated tdesc doesn't equal to the
original pre-generated tdesc if the register has regnum attribute, like

  <reg name="xmm0" bitsize="128" type="vec128" regnum="32"/>

most of the reg doesn't have "regnum" attribute so the number is
allocated sequentially.  If the reg has "regnum", it explicitly set the
register number.  I'll rewrite the commit log this way,

Instead of using pre-generated target descriptions, this patch
changes GDB to lazily and dynamically create target descriptions
according to the target hardware capability (xcr0 in i386).
This support any combination of target features.

Some reg in XML target description has attribute "regnum" which set the
register number explicitly rather than using the sequentially allocated
number,

  <reg name="xmm0" bitsize="128" type="vec128" regnum="32"/>

In order to handle this, this patch also changes the visitor to print
the code to set regnum when reg has attribute "regnum".

2017-06-20  Yao Qi  <yao.qi@linaro.org>

	* i386-linux-tdep.c: Don't include features/i386/i386-XXX-linux.c.
        include features/i386/32bit-XXX.c instead.
        (i386_linux_read_description): Generate
        target description if it doesn't exist.
        * target-descriptions.c (print_c_tdesc::visit): Print code to
        set regnum.
        (print_c_tdesc) <m_next_regnum>: New field.
        * features/i386/32bit-linux.c: Regenerated.
        * features/i386/32bit-sse.c: Regenerated.

>> 
>> 2017-04-27  Yao Qi  <yao.qi@linaro.org>
>> 
>> 	* i386-linux-tdep.c (i386_linux_read_description): Generate
>> 	target description if it doesn't exist.
>>         [GDB_SELF_TEST] (i386_linux_read_description_test): New unit test.
>>         (_initialize_i386_linux_tdep) [GDB_SELF_TEST]: Register unit test.
>
> Leading TAB vs spaces.
>

These two lines should be removed.

>> +private:
>> +  /* The register number to use for the next register we see.  */
>> +  int next_regnum = 0;
>>  };
>
> "m_" prefix.

I'll fix it.

-- 
Yao (齐尧)


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