[1/9] gdb: remove invalid / dead code from gdbarch.py

Message ID 20230223221830.499934-2-simon.marchi@efficios.com
State Committed
Commit aa992b382f91f426cd51bf1375d78eacb509f2cc
Headers
Series Add typing annotations to gdbarch*.py and make-target-delegates.py |

Commit Message

Simon Marchi Feb. 23, 2023, 10:18 p.m. UTC
  My editor flagged that the variable `c` (in the lines removed by this
patch) was unknown.  I guess it ends up working because there is a `c`
variable in the global scope.  I tried putting `assert False` inside
that if, and it is not hit, showing that we never enter this if.  So,
remove it.  There is no change in the generated files.

Change-Id: Id3b9f67719e88cada7c6fde673c8d7842ab13617
---
 gdb/gdbarch.py | 2 --
 1 file changed, 2 deletions(-)
  

Patch

diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py
index 3ebc35980472..68c7bbae6618 100755
--- a/gdb/gdbarch.py
+++ b/gdb/gdbarch.py
@@ -64,8 +64,6 @@  class _Component:
         assert self.predicate and not isinstance(self.invalid, str)
         if self.predefault:
             predicate = f"gdbarch->{self.name} != {self.predefault}"
-        elif isinstance(c, Value):
-            predicate = f"gdbarch->{self.name} != 0"
         else:
             predicate = f"gdbarch->{self.name} != NULL"
         return predicate