* [RFA] i386-tdep.c, i386_process_record, document fall-through case.
@ 2011-03-02 22:34 Michael Snyder
2011-03-02 22:47 ` Mark Kettenis
2011-03-04 19:05 ` Michael Snyder
0 siblings, 2 replies; 10+ messages in thread
From: Michael Snyder @ 2011-03-02 22:34 UTC (permalink / raw)
To: gdb-patches, Hui Zhu
[-- Attachment #1: Type: text/plain, Size: 38 bytes --]
Hui, is this right?
Thanks,
Michael
[-- Attachment #2: fallthru7.txt --]
[-- Type: text/plain, Size: 627 bytes --]
2011-03-02 Michael Snyder <msnyder@vmware.com>
* i386-tdep.c (i386_process_record): Document fall through.
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.324
diff -u -p -u -p -r1.324 i386-tdep.c
--- i386-tdep.c 8 Feb 2011 14:01:47 -0000 1.324
+++ i386-tdep.c 2 Mar 2011 22:31:15 -0000
@@ -4543,6 +4543,7 @@ Do you want to stop the program?"),
ir.addr -= 1;
goto no_support;
}
+ /* ELSE FALL THROUGH */
case 0x0fb2: /* lss Gv */
case 0x0fb4: /* lfs Gv */
case 0x0fb5: /* lgs Gv */
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] i386-tdep.c, i386_process_record, document fall-through case.
2011-03-02 22:34 [RFA] i386-tdep.c, i386_process_record, document fall-through case Michael Snyder
@ 2011-03-02 22:47 ` Mark Kettenis
2011-03-04 19:05 ` Michael Snyder
1 sibling, 0 replies; 10+ messages in thread
From: Mark Kettenis @ 2011-03-02 22:47 UTC (permalink / raw)
To: msnyder; +Cc: gdb-patches, teawater
> Date: Wed, 02 Mar 2011 14:34:21 -0800
> From: Michael Snyder <msnyder@vmware.com>
>
> Hui, is this right?
Michael, if it is correct, please document these with a simple
/* FALLTHROUGH */
instead of inventing your own all caps annotations.
Thanks,
Mark
> 2011-03-02 Michael Snyder <msnyder@vmware.com>
>
> * i386-tdep.c (i386_process_record): Document fall through.
>
> Index: i386-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/i386-tdep.c,v
> retrieving revision 1.324
> diff -u -p -u -p -r1.324 i386-tdep.c
> --- i386-tdep.c 8 Feb 2011 14:01:47 -0000 1.324
> +++ i386-tdep.c 2 Mar 2011 22:31:15 -0000
> @@ -4543,6 +4543,7 @@ Do you want to stop the program?"),
> ir.addr -= 1;
> goto no_support;
> }
> + /* ELSE FALL THROUGH */
> case 0x0fb2: /* lss Gv */
> case 0x0fb4: /* lfs Gv */
> case 0x0fb5: /* lgs Gv */
>
> --------------040400010108040302090109--
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] i386-tdep.c, i386_process_record, document fall-through case.
2011-03-02 22:34 [RFA] i386-tdep.c, i386_process_record, document fall-through case Michael Snyder
2011-03-02 22:47 ` Mark Kettenis
@ 2011-03-04 19:05 ` Michael Snyder
2011-03-07 9:01 ` Hui Zhu
1 sibling, 1 reply; 10+ messages in thread
From: Michael Snyder @ 2011-03-04 19:05 UTC (permalink / raw)
To: gdb-patches, Hui Zhu
Michael Snyder wrote:
> Hui, is this right?
>
> Thanks,
> Michael
>
Ping? ;-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] i386-tdep.c, i386_process_record, document fall-through case.
2011-03-04 19:05 ` Michael Snyder
@ 2011-03-07 9:01 ` Hui Zhu
2011-03-07 19:06 ` Michael Snyder
0 siblings, 1 reply; 10+ messages in thread
From: Hui Zhu @ 2011-03-07 9:01 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
Hi Michael,
Sorry for late.
I don't know we need this patch or not.
As some people's mail, they don't like this part code. This part
should rewrite to share code with opcode or something.
So I think in the near future, this code will be rewritten by these
guys or somebody else.
Thanks,
Hui
On Sat, Mar 5, 2011 at 03:05, Michael Snyder <msnyder@vmware.com> wrote:
> Michael Snyder wrote:
>>
>> Hui, is this right?
>>
>> Thanks,
>> Michael
>>
>
> Ping? ;-)
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] i386-tdep.c, i386_process_record, document fall-through case.
2011-03-07 9:01 ` Hui Zhu
@ 2011-03-07 19:06 ` Michael Snyder
2011-03-08 4:35 ` Hui Zhu
0 siblings, 1 reply; 10+ messages in thread
From: Michael Snyder @ 2011-03-07 19:06 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches
But should there be a break there? Or not?
Hui Zhu wrote:
> Hi Michael,
>
> Sorry for late.
>
> I don't know we need this patch or not.
>
> As some people's mail, they don't like this part code. This part
> should rewrite to share code with opcode or something.
> So I think in the near future, this code will be rewritten by these
> guys or somebody else.
>
> Thanks,
> Hui
>
> On Sat, Mar 5, 2011 at 03:05, Michael Snyder <msnyder@vmware.com> wrote:
>> Michael Snyder wrote:
>>> Hui, is this right?
>>>
>>> Thanks,
>>> Michael
>>>
>> Ping? ;-)
>>
>>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] i386-tdep.c, i386_process_record, document fall-through case.
2011-03-07 19:06 ` Michael Snyder
@ 2011-03-08 4:35 ` Hui Zhu
2011-03-08 4:54 ` Joel Brobecker
0 siblings, 1 reply; 10+ messages in thread
From: Hui Zhu @ 2011-03-08 4:35 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
I am not sure.
As my poor understanding of C language, break or not break are both OK
for this part.
Thanks,
Hui
On Tue, Mar 8, 2011 at 02:46, Michael Snyder <msnyder@vmware.com> wrote:
> But should there be a break there? Or not?
>
>
>
> Hui Zhu wrote:
>>
>> Hi Michael,
>>
>> Sorry for late.
>>
>> I don't know we need this patch or not.
>>
>> As some people's mail, they don't like this part code. This part
>> should rewrite to share code with opcode or something.
>> So I think in the near future, this code will be rewritten by these
>> guys or somebody else.
>>
>> Thanks,
>> Hui
>>
>> On Sat, Mar 5, 2011 at 03:05, Michael Snyder <msnyder@vmware.com> wrote:
>>>
>>> Michael Snyder wrote:
>>>>
>>>> Hui, is this right?
>>>>
>>>> Thanks,
>>>> Michael
>>>>
>>> Ping? ;-)
>>>
>>>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] i386-tdep.c, i386_process_record, document fall-through case.
2011-03-08 4:35 ` Hui Zhu
@ 2011-03-08 4:54 ` Joel Brobecker
2011-03-08 4:58 ` Hui Zhu
2011-03-08 17:20 ` Tom Tromey
0 siblings, 2 replies; 10+ messages in thread
From: Joel Brobecker @ 2011-03-08 4:54 UTC (permalink / raw)
To: Hui Zhu; +Cc: Michael Snyder, gdb-patches
> As my poor understanding of C language, break or not break are both OK
> for this part.
I'm going to be a little extremist, and I don't really mean what
I am about to ask, but: If the author of the code does not understand
the code, and no other maintainer is able to review associated patches,
is it time to remove that code?
Speaking about the patch itself, I had a look, and I think, from
what I understand, that, YES, the fallthrough is intended. IMO,
it would have been clearer to write the code as follow:
case 0xc4: /* les Gv */
case 0xc5: /* lds Gv */
case 0x0fb2: /* lss Gv */
case 0x0fb4: /* lfs Gv */
case 0x0fb5: /* lgs Gv */
if ((opcode == 0xc4 || opcode == 0xc5)
&& ir.regmap[X86_RECORD_R8_REGNUM])
{
ir.addr -= 1;
goto no_support;
}
if (i386_record_modrm (&ir))
return -1;
(thus, not requiring a fallthrough)
So patch is approved.
--
Joel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] i386-tdep.c, i386_process_record, document fall-through case.
2011-03-08 4:54 ` Joel Brobecker
@ 2011-03-08 4:58 ` Hui Zhu
2011-03-08 18:50 ` Michael Snyder
2011-03-08 17:20 ` Tom Tromey
1 sibling, 1 reply; 10+ messages in thread
From: Hui Zhu @ 2011-03-08 4:58 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Michael Snyder, gdb-patches
And about the code:
case 0xc4: /* les Gv */
case 0xc5: /* lds Gv */
if (ir.regmap[X86_RECORD_R8_REGNUM])
{
ir.addr -= 1;
goto no_support;
}
switch (opcode)
{
case 0xc4: /* les Gv */
regnum = X86_RECORD_ES_REGNUM;
break;
case 0xc5: /* lds Gv */
regnum = X86_RECORD_DS_REGNUM;
break;
I check my code didn't very clear. This part is a "/* ELSE FALL THROUGH */".
On Tue, Mar 8, 2011 at 12:32, Joel Brobecker <brobecker@adacore.com> wrote:
>> As my poor understanding of C language, break or not break are both OK
>> for this part.
>
> I'm going to be a little extremist, and I don't really mean what
> I am about to ask, but: If the author of the code does not understand
> the code, and no other maintainer is able to review associated patches,
> is it time to remove that code?
Interesting.
Please go ahead if you want. :)
BTW If somebody say something wrong about his code, his code need
prepare to be removed, right?
I suggest you post your words to the website of gdb. That will be
powerful motto for gdb club. :)
Thanks,
Hui
>
> Speaking about the patch itself, I had a look, and I think, from
> what I understand, that, YES, the fallthrough is intended. IMO,
> it would have been clearer to write the code as follow:
>
> case 0xc4: /* les Gv */
> case 0xc5: /* lds Gv */
> case 0x0fb2: /* lss Gv */
> case 0x0fb4: /* lfs Gv */
> case 0x0fb5: /* lgs Gv */
> if ((opcode == 0xc4 || opcode == 0xc5)
> && ir.regmap[X86_RECORD_R8_REGNUM])
> {
> ir.addr -= 1;
> goto no_support;
> }
> if (i386_record_modrm (&ir))
> return -1;
>
> (thus, not requiring a fallthrough)
>
> So patch is approved.
>
> --
> Joel
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] i386-tdep.c, i386_process_record, document fall-through case.
2011-03-08 4:54 ` Joel Brobecker
2011-03-08 4:58 ` Hui Zhu
@ 2011-03-08 17:20 ` Tom Tromey
1 sibling, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2011-03-08 17:20 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Hui Zhu, Michael Snyder, gdb-patches
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> I'm going to be a little extremist, and I don't really mean what
Joel> I am about to ask, but: If the author of the code does not understand
Joel> the code, and no other maintainer is able to review associated patches,
Joel> is it time to remove that code?
I think the code is understandable, just not as clear as I might like.
In my case the issue here is not understandability but rather laziness:
looking up all the details is a pain, surely somebody else will look at
it sooner than I will, etc.
In sum I think that removing it is somewhat too extremist :)
Tom
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] i386-tdep.c, i386_process_record, document fall-through case.
2011-03-08 4:58 ` Hui Zhu
@ 2011-03-08 18:50 ` Michael Snyder
0 siblings, 0 replies; 10+ messages in thread
From: Michael Snyder @ 2011-03-08 18:50 UTC (permalink / raw)
To: Hui Zhu; +Cc: Joel Brobecker, gdb-patches
Hui Zhu wrote:
> And about the code:
> case 0xc4: /* les Gv */
> case 0xc5: /* lds Gv */
> if (ir.regmap[X86_RECORD_R8_REGNUM])
> {
> ir.addr -= 1;
> goto no_support;
> }
>
> switch (opcode)
> {
> case 0xc4: /* les Gv */
> regnum = X86_RECORD_ES_REGNUM;
> break;
> case 0xc5: /* lds Gv */
> regnum = X86_RECORD_DS_REGNUM;
> break;
>
> I check my code didn't very clear. This part is a "/* ELSE FALL THROUGH */".
Thank you. So committed.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-03-08 18:47 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02 22:34 [RFA] i386-tdep.c, i386_process_record, document fall-through case Michael Snyder
2011-03-02 22:47 ` Mark Kettenis
2011-03-04 19:05 ` Michael Snyder
2011-03-07 9:01 ` Hui Zhu
2011-03-07 19:06 ` Michael Snyder
2011-03-08 4:35 ` Hui Zhu
2011-03-08 4:54 ` Joel Brobecker
2011-03-08 4:58 ` Hui Zhu
2011-03-08 18:50 ` Michael Snyder
2011-03-08 17:20 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox