Re: Bug in i386_process_record?

Michael Snyder
2009-08-28T01:35:02Z

Hui Zhu wrote:
> On Thu, Aug 27, 2009 at 09:43, Hui Zhu<teawater@gmail.com> wrote:
>> On Thu, Aug 27, 2009 at 08:28, Michael Snyder<msnyder@vmware.com> wrote:
>>> Do you think you could add some new tests to i386-reverse.exp,
>>> to verify the string instructions?
>>>
>>> Thanks,
>>> Michael
>>>
>> OK. I will do it.
>>
>> Thanks,
>> Hui
>>
>
> Hi Michael,
>
> I make a patch to add the test for string insn.
>
> Please help me review it.

Good start -- but you need to write some expect script to go with it!
;-)

> 2009-08-27 Hui Zhu <teawater@gmail.com>
>
> * gdb.reverse/i386-reverse.c (string_insn_tests): New function.
> (main): Call "string_insn_tests".
>
> ---
> testsuite/gdb.reverse/i386-reverse.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> --- a/testsuite/gdb.reverse/i386-reverse.c
> +++ b/testsuite/gdb.reverse/i386-reverse.c
> @@ -38,9 +38,25 @@ inc_dec_tests (void)
> asm ("dec %edi");
> } /* end inc_dec_tests */
>
> +void
> +string_insn_tests (void)
> +{
> + register char x asm("ax");
> + char *dstp = (char *) 1;
> + int d0;
> + int len = 0;
> +
> + asm volatile("rep\n"
> + "stosb" /* %0, %2, %3 */ :
> + "=D" (dstp), "=c" (d0) :
> + "0" (dstp), "1" (len), "a" (x) :
> + "memory");
> +}
> +
> int
> main ()
> {
> inc_dec_tests ();
> + string_insn_tests ();
> return 0; /* end of main */
> }