mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
misc/gdb.py: Fix the swapped Params and Locals conditions
cfp printed Params only when the frame had locals and Locals only when it had params, so a method with arguments and no locals showed an empty Locals instead of its arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e8b378affa
commit
b4bc7bc702
1 file changed
+2
-2
Notes:
git
2026-10-01 22:17:20 +00:00
+2
-2
@@ -76,13 +76,13 @@ class CFP(gdb.Command):
|
||||
local_size = self.get_int(f'{body}->local_table_size - {body}->param.size')
|
||||
param_size = self.get_int(f'{body}->param.size')
|
||||
|
||||
if local_size:
|
||||
if param_size:
|
||||
print(f'Params (size={param_size}):')
|
||||
for i in range(-3 - local_size - param_size, -3 - local_size):
|
||||
self.print_stack(cfp, i, self.rp(cfp, i))
|
||||
print()
|
||||
|
||||
if param_size:
|
||||
if local_size:
|
||||
print(f'Locals (size={local_size}):')
|
||||
for i in range(-3 - local_size, -3):
|
||||
self.print_stack(cfp, i, self.rp(cfp, i))
|
||||
|
||||
Reference in new issue
Block a user