Ticket #1439 (new todo)

Opened 5 years ago

Last modified 3 years ago

pbc_dump: Mark branch targets in -d mode

Reported by: Austin_Hastings Owned by:
Priority: normal Milestone:
Component: tools Version: 2.0.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

pbc_dump -d shows opcodes but does not indicate branch targets:

 012b:  0000001b 00000001 00000046                            unless_p_ic
 012e:  00000348 00000002 00000001                            shift_p_p
 0131:  00000023 00000004                                     set_args_pc
 0134:  00000024 00000004                                     get_results_pc
 0137:  000002c4 00000002 00000044                            callmethodcc_p_sc
 013a:  00000367 00000009 00000007                            iter_p_p
 013d:  0000001b 00000009 ffffffee                            unless_p_ic
 0140:  00000347 00000001 00000009                            shift_s_p
 0143:  000003d1 00000003 00000007 00000049                   set_p_p_kc
 0147:  000002d5 00000000 00000003 00000043                   isa_i_p_sc
 014b:  00000014 00000000 fffffff2                            if_i_ic

While backwards branching means that marking branch targets in the output stream as labels would be a two pass operation, it should be possible to do the match and indicate the target offset as part of the opcode:

 012b:  0000001b 00000001 00000046                            unless_p_ic 0171
 ...
 013d:  0000001b 00000009 ffffffee                            unless_p_ic 012b
 ...
 014b:  00000014 00000000 fffffff2                            if_i_ic 013d

Note: I make no guarantee those offsets are right.

Change History

Changed 3 years ago by jkeenan

  • owner set to dukeleto
  • component changed from none to tools

Changed 3 years ago by dukeleto

  • owner changed from dukeleto to jkeenan

Changed 3 years ago by jkeenan

  • owner jkeenan deleted
Note: See TracTickets for help on using tickets.