gdb: remove invalid / dead code from gdbarch.py
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 27 Feb 2023 01:13:54 +0000 (20:13 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 27 Feb 2023 18:28:32 +0000 (13:28 -0500)
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
Reviewed-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
gdb/gdbarch.py

index 3ebc359804724640b2d4b8a853d1e4c7e6ccf1e8..68c7bbae66180a5328b88dbe8c0ebf38d02cc6a7 100755 (executable)
@@ -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