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: [Prec/RFA] Remove macros for record size in i386-linux-tdep.c


On Sat, May 23, 2009 at 21:47, Pedro Alves <pedro@codesourcery.com> wrote:
> A Saturday 23 May 2009 13:12:54, Hui Zhu escreveu:
>> On Sat, May 23, 2009 at 19:59, Hui Zhu <teawater@gmail.com> wrote:
>> > On Sat, May 23, 2009 at 19:12, Pedro Alves <pedro@codesourcery.com> wrote:
>> >> On Saturday 23 May 2009 05:00:22, Hui Zhu wrote:
>> >>> 2009-05-23 ?Hui Zhu ?<teawater@gmail.com>
>> >>>
>> >>> ????????* i386-linux-tdep.c (I386_LINUX_RECORD_SIZE_*,
>> >>> ????????I386_LINUX_RECORD_IOCTL_*,
>> >>> ????????I386_LINUX_RECORD_FCNTL_*) Removed.
>> >>> ????????(i386_linux_init_abi): Change size of record from macros to
>> >>> ????????numbers.
>> >>
>> >> Okay.
>> >>
>> >>> ????????* i386-linux-tdep.c (i386_linux_init_abi): Change
>> >>> ????????i386_linux_record_tdep.size_char from 8 to 1.
>> >>
>> >> You didn't mention this, so I take it it was going to be a separate patch.
>> >> Why do you need size_char at all? ?size of char is always 1 by definition.
>> >> Does the kernel define this as variable somewhere also?
>> >
>> > OK. ?I make a new patch remove it.
>> > Please help me review it.
>> >
>> > Thanks,
>> > Hui
>> >
>> > 2009-05-23 ?Hui Zhu ?<teawater@gmail.com>
>> >
>> > ? ? ? ?* i386-linux-tdep.c (I386_LINUX_RECORD_SIZE_*,
>> > ? ? ? ?I386_LINUX_RECORD_IOCTL_*,
>> > ? ? ? ?I386_LINUX_RECORD_FCNTL_*) Removed.
>> > ? ? ? ?(i386_linux_init_abi): Change size of record from macros to
>> > ? ? ? ?numbers.
>> >
>> > ? ? ? ?* i386-linux-tdep.c (i386_linux_init_abi): Remove size_char.
>> > ? ? ? ?* linux-record.c (record_linux_system_call): Ditto.
>> > ? ? ? ?* linux-record.h (linux_record_tdep): Ditto.
>
> This is OK, although the changelog wants to record different unrelated
> changes: either commit this in two parts, or merge the (i386_linux_init_abi)
> entries.
>
>> About char part. ?I am not very sure about it. ?This is from gdb:
>> /* Number of bits in a char or unsigned char for the target machine.
>> ? ?Just like CHAR_BIT in <limits.h> but describes the target machine. ?*/
>> #if !defined (TARGET_CHAR_BIT)
>> #define TARGET_CHAR_BIT 8
>> #endif
>>
>> So, maybe we can keep it.
>
> No, this is bits in char, while size_char wants bytes per char,
> which is always 1. ?Even if we were to make GDB behave
> for TARGET_CHAR_BIT != 8, linux-record would not be the place to
> store that info.
>

OK.  I got it.  Thanks.
What about the last patch? It remove char_size.

Hui


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