Skip to content

Commit

Permalink
Get rid of obsoleted __bp__ references
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Jul 20, 2023
1 parent bbf059f commit a712774
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions misc/gdb.py
Expand Up @@ -65,14 +65,14 @@ def invoke(self, offset, from_tty):
self.print_stack(cfp, -1, self.frame_types(cfp, -1))
print()

stack_size = int((self.get_int(f'{cfp}->sp') - self.get_int(f'{cfp}->__bp__')) / 8)
stack_size = int((self.get_int(f'{cfp}->sp') - self.get_int(f'vm_base_ptr({cfp})')) / 8)
print(f'Stack (size={stack_size}):')
for i in range(0, stack_size):
self.print_stack(cfp, i, self.rp(cfp, i))
print(self.regs(cfp, stack_size))

def print_stack(self, cfp, bp_index, content):
address = self.get_int(f'{cfp}->__bp__ + {bp_index}')
address = self.get_int(f'vm_base_ptr({cfp}) + {bp_index}')
value = self.get_value(cfp, bp_index)
regs = self.regs(cfp, bp_index)
if content:
Expand All @@ -81,9 +81,9 @@ def print_stack(self, cfp, bp_index, content):
print('{:2} 0x{:x} [{}] {}(0x{:x})'.format(regs, address, bp_index, content, value))

def regs(self, cfp, bp_index):
address = self.get_int(f'{cfp}->__bp__ + {bp_index}')
address = self.get_int(f'vm_base_ptr({cfp}) + {bp_index}')
regs = []
for reg, field in { 'EP': 'ep', 'BP': '__bp__', 'SP': 'sp' }.items():
for reg, field in { 'EP': 'ep', 'SP': 'sp' }.items():
if address == self.get_int(f'{cfp}->{field}'):
regs.append(reg)
return ' '.join(regs)
Expand Down Expand Up @@ -119,7 +119,7 @@ def frame_types(self, cfp, bp_index):
return ' | '.join(types)

def get_value(self, cfp, bp_index):
return self.get_int(f'{cfp}->__bp__[{bp_index}]')
return self.get_int(f'vm_base_ptr({cfp})[{bp_index}]')

def get_int(self, expr):
return int(self.get_string(f'printf "%ld", ({expr})'))
Expand Down
1 change: 0 additions & 1 deletion yjit/src/codegen.rs
Expand Up @@ -4841,7 +4841,6 @@ fn gen_push_frame(
// .self = recv,
// .ep = <sp - 1>,
// .block_code = 0,
// .__bp__ = sp,
// };
asm.comment("push callee control frame");

Expand Down

0 comments on commit a712774

Please sign in to comment.