public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [commit] remove dead if stmt from amd64_linux_syscall_record
@ 2011-02-26 20:12 Michael Snyder
  2011-02-28  5:40 ` Hui Zhu
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Snyder @ 2011-02-26 20:12 UTC (permalink / raw)
  To: gdb-patches, Hui Zhu, Mark Kettenis

[-- Attachment #1: Type: text/plain, Size: 57 bytes --]

The condition can't be false, so the statement is dead.


[-- Attachment #2: if.txt --]
[-- Type: text/plain, Size: 1760 bytes --]

2011-02-26  Michael Snyder  <msnyder@vmware.com>

	* amd64-linux-tdep.c (amd64_linux_syscall_record): Delete
	dead if statement.  Condition can't be false.

Index: amd64-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-linux-tdep.c,v
retrieving revision 1.41
diff -u -p -u -p -r1.41 amd64-linux-tdep.c
--- amd64-linux-tdep.c	7 Jan 2011 19:36:15 -0000	1.41
+++ amd64-linux-tdep.c	26 Feb 2011 19:40:25 -0000
@@ -1174,25 +1174,24 @@ amd64_linux_syscall_record (struct regca
       break;
 
     case amd64_sys_arch_prctl:
-      if (syscall_native == amd64_sys_arch_prctl)
-        {
-          ULONGEST arg3;
-
-          regcache_raw_read_unsigned (regcache, amd64_linux_record_tdep.arg3,
-                                      &arg3);
-          if (arg3 == RECORD_ARCH_GET_FS || arg3 == RECORD_ARCH_GET_GS)
-            {
-	      CORE_ADDR addr;
-
-	      regcache_raw_read_unsigned (regcache,
-                                          amd64_linux_record_tdep.arg2,
-                                          &addr);
-	      if (record_arch_list_add_mem (addr,
-                                            amd64_linux_record_tdep.size_ulong))
-                return -1;
-            }
-          goto record_regs;
-        }
+      {
+	ULONGEST arg3;
+
+	regcache_raw_read_unsigned (regcache, amd64_linux_record_tdep.arg3,
+				    &arg3);
+	if (arg3 == RECORD_ARCH_GET_FS || arg3 == RECORD_ARCH_GET_GS)
+	  {
+	    CORE_ADDR addr;
+
+	    regcache_raw_read_unsigned (regcache,
+					amd64_linux_record_tdep.arg2,
+					&addr);
+	    if (record_arch_list_add_mem (addr,
+					  amd64_linux_record_tdep.size_ulong))
+	      return -1;
+	  }
+	goto record_regs;
+      }
       break;
     }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [commit] remove dead if stmt from amd64_linux_syscall_record
  2011-02-26 20:12 [commit] remove dead if stmt from amd64_linux_syscall_record Michael Snyder
@ 2011-02-28  5:40 ` Hui Zhu
  0 siblings, 0 replies; 2+ messages in thread
From: Hui Zhu @ 2011-02-28  5:40 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches, Mark Kettenis

Thanks Michael.

Best,
Hui

On Sun, Feb 27, 2011 at 03:52, Michael Snyder <msnyder@vmware.com> wrote:
> The condition can't be false, so the statement is dead.
>
>
> 2011-02-26  Michael Snyder  <msnyder@vmware.com>
>
>        * amd64-linux-tdep.c (amd64_linux_syscall_record): Delete
>        dead if statement.  Condition can't be false.
>
> Index: amd64-linux-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/amd64-linux-tdep.c,v
> retrieving revision 1.41
> diff -u -p -u -p -r1.41 amd64-linux-tdep.c
> --- amd64-linux-tdep.c  7 Jan 2011 19:36:15 -0000       1.41
> +++ amd64-linux-tdep.c  26 Feb 2011 19:40:25 -0000
> @@ -1174,25 +1174,24 @@ amd64_linux_syscall_record (struct regca
>       break;
>
>     case amd64_sys_arch_prctl:
> -      if (syscall_native == amd64_sys_arch_prctl)
> -        {
> -          ULONGEST arg3;
> -
> -          regcache_raw_read_unsigned (regcache,
> amd64_linux_record_tdep.arg3,
> -                                      &arg3);
> -          if (arg3 == RECORD_ARCH_GET_FS || arg3 == RECORD_ARCH_GET_GS)
> -            {
> -             CORE_ADDR addr;
> -
> -             regcache_raw_read_unsigned (regcache,
> -                                          amd64_linux_record_tdep.arg2,
> -                                          &addr);
> -             if (record_arch_list_add_mem (addr,
> -
>  amd64_linux_record_tdep.size_ulong))
> -                return -1;
> -            }
> -          goto record_regs;
> -        }
> +      {
> +       ULONGEST arg3;
> +
> +       regcache_raw_read_unsigned (regcache, amd64_linux_record_tdep.arg3,
> +                                   &arg3);
> +       if (arg3 == RECORD_ARCH_GET_FS || arg3 == RECORD_ARCH_GET_GS)
> +         {
> +           CORE_ADDR addr;
> +
> +           regcache_raw_read_unsigned (regcache,
> +                                       amd64_linux_record_tdep.arg2,
> +                                       &addr);
> +           if (record_arch_list_add_mem (addr,
> +
> amd64_linux_record_tdep.size_ulong))
> +             return -1;
> +         }
> +       goto record_regs;
> +      }
>       break;
>     }
>
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-28  5:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-26 20:12 [commit] remove dead if stmt from amd64_linux_syscall_record Michael Snyder
2011-02-28  5:40 ` Hui Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).