Get rid of obsoleted __bp__ references

This commit is contained in:
Takashi Kokubun 2023-07-20 11:54:47 -07:00
Родитель bbf059fb84
Коммит a7127745f1
2 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -65,14 +65,14 @@ class CFP(gdb.Command):
self.print_stack(cfp, -1, self.frame_types(cfp, -1)) self.print_stack(cfp, -1, self.frame_types(cfp, -1))
print() 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}):') print(f'Stack (size={stack_size}):')
for i in range(0, stack_size): for i in range(0, stack_size):
self.print_stack(cfp, i, self.rp(cfp, i)) self.print_stack(cfp, i, self.rp(cfp, i))
print(self.regs(cfp, stack_size)) print(self.regs(cfp, stack_size))
def print_stack(self, cfp, bp_index, content): 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) value = self.get_value(cfp, bp_index)
regs = self.regs(cfp, bp_index) regs = self.regs(cfp, bp_index)
if content: if content:
@ -81,9 +81,9 @@ class CFP(gdb.Command):
print('{:2} 0x{:x} [{}] {}(0x{:x})'.format(regs, address, bp_index, content, value)) print('{:2} 0x{:x} [{}] {}(0x{:x})'.format(regs, address, bp_index, content, value))
def regs(self, cfp, bp_index): 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 = [] 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}'): if address == self.get_int(f'{cfp}->{field}'):
regs.append(reg) regs.append(reg)
return ' '.join(regs) return ' '.join(regs)
@ -119,7 +119,7 @@ class CFP(gdb.Command):
return ' | '.join(types) return ' | '.join(types)
def get_value(self, cfp, bp_index): 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): def get_int(self, expr):
return int(self.get_string(f'printf "%ld", ({expr})')) return int(self.get_string(f'printf "%ld", ({expr})'))

Просмотреть файл

@ -4841,7 +4841,6 @@ fn gen_push_frame(
// .self = recv, // .self = recv,
// .ep = <sp - 1>, // .ep = <sp - 1>,
// .block_code = 0, // .block_code = 0,
// .__bp__ = sp,
// }; // };
asm.comment("push callee control frame"); asm.comment("push callee control frame");