This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix cygwin build error with i386-linux-tdep.c
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: teawater at gmail dot com
- Cc: gdb-patches at sourceware dot org, msnyder at vmware dot com
- Date: Sun, 30 Aug 2009 15:56:24 +0200 (CEST)
- Subject: Re: [PATCH] Fix cygwin build error with i386-linux-tdep.c
- References: <daef60380908300615u40f59a38t7d2c2f2252c5924d@mail.gmail.com>
> From: Hui Zhu <teawater@gmail.com>
> Date: Sun, 30 Aug 2009 21:15:22 +0800
>
> 2009-08-29 Hui Zhu <teawater@gmail.com>
>
> * i386-linux-tdep.c (i386_linux_intx80_sysenter_record): Add
> (unsigned) before tmpu32.
Ugh! Casts like that are ugly.
This made me look at the code again and realize that what you're doing
in that function is wrong. You should be using
regcache_{raw|cooked}_read_unsigned() instead of regcache_raw_read().
Then the whole issue of printing an uint32_t goes away. When you do
change the code like that please use a more meaningful variable name
instead of 'tmpu32'. My suggestion would be 'syscall'.
Cheers,
Mark
> Index: gdb/i386-linux-tdep.c
> ===================================================================
> --- gdb.orig/i386-linux-tdep.c 2009-08-23 21:17:37.000000000 +0800
> +++ gdb/i386-linux-tdep.c 2009-08-30 20:19:53.828125000 +0800
> @@ -374,7 +374,7 @@
> if (tmpu32 > 499)
> {
> printf_unfiltered (_("Process record and replay target doesn't "
> - "support syscall number %u\n"), tmpu32);
> + "support syscall number %u\n"), (unsigned) tmpu32);
> return -1;
> }
>