Skip to content

Commit 4cc7793

Browse files
committed
Handle the empty register list
Close #277
1 parent 0a5335d commit 4cc7793

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.gdbinit

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1985,6 +1985,10 @@ class Registers(Dashboard.Module):
19851985
changed = self.table and (self.table.get(name, '') != string_value)
19861986
self.table[name] = string_value
19871987
registers.append((name, string_value, changed))
1988+
# handle the empty register list
1989+
if not registers:
1990+
msg = 'No registers to show (check the "dashboard registers -style list" attribute)'
1991+
return [ansi(msg, R.style_error)]
19881992
# compute lengths considering an extra space between and around the
19891993
# entries (hence the +2 and term_width - 1)
19901994
max_name = max(len(name) for name, _, _ in registers)
@@ -2036,7 +2040,8 @@ class Registers(Dashboard.Module):
20362040
'list': {
20372041
'doc': '''String of space-separated register names to display.
20382042
2039-
The empty list (default) causes to show all the available registers.''',
2043+
The empty list (default) causes to show all the available registers. For
2044+
architectures different from x86 setting this attribute might be mandatory.''',
20402045
'default': '',
20412046
'name': 'register_list',
20422047
}

0 commit comments

Comments
 (0)