Skip to content

Commit d73050d

Browse files
committed
handle when a peripheral don't have a _description
1 parent 94bd022 commit d73050d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cmdebug/svd_gdb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,10 @@ def invoke(self, args, from_tty):
253253
peripherals = self.svd_device.peripherals
254254
column_width = max(len(p.name) for p in peripherals) + 2 # padding
255255
for p in peripherals:
256-
desc = re.sub(r'\s+', ' ', p._description)
256+
if hasattr(p, "_description"):
257+
desc = re.sub(r'\s+', ' ', p._description)
258+
else:
259+
desc = "<No description>"
257260
gdb.write("\t{}:{}{}\n".format(p.name, "".ljust(column_width - len(p.name)), desc))
258261
return
259262

0 commit comments

Comments
 (0)