Ticket #206 (closed RFC: fixed)

Opened 6 years ago

Last modified 4 years ago

extend disassembler to print constants in const table

Reported by: kjs Owned by: Paul C. Anagnostopoulos
Priority: normal Milestone:
Component: core Version:
Severity: medium Keywords: disassembler
Cc: Language:
Patch status: Platform:

Description

It would be really really helpful if pbc_disassemble could also print the contents of the constants table.

Now, whenever a reference is made to a constant, PMC_CONST(n) is printed. It'd be nice what this constant is (value).

(it would also hugely increase debugging capabilities for, say, debugging a PIR compiler)

Change History

  Changed 5 years ago by rurban

I do not understand.

pbc_disassemble already prints via print_constant_table() the constant table content.

$ ./pbc_disassemble -b t/native_pbc/string_1.pbc
=head1 Constant-table

PMC_CONST(0): 'ParrotInterpreter'
PMC_CONST(1): abc
PMC_CONST(2): a2c
PMC_CONST(3):    X
PMC_CONST(4): Dw
PMC_CONST(5):

PMC_CONST(6): t/op/string_133.pasm
PMC_CONST(7):
PMC_CONST(8): (null)

=cut

# Current Source Filename 't/op/string_133.pasm'
        set_s_sc S1,"a2c"
        set_s_sc S2,"Dw"
        bxors_s_s S1,S2
        print_s S1
        print_sc "\n"
        print_s S2
        print_sc "\n"
        set_s_sc S1,"abc"
        set_s_sc S2,"   X"
        bxors_s_s S1,S2
        print_s S1
        print_sc "\n"
        print_s S2
        print_sc "\n"
        end

Do you want the set_s_sc S1,"a2c" argument refer to PMC_CONST(1) and not the value? Or maybe add set_s_sc S1,"a2c" #PMC_CONST(1) as comment?

The trick here is that the disassmebled pbc can be assembled with parrot again, roundtrip.

in reply to: ↑ description   Changed 5 years ago by jkeenan

Replying to kjs:

It would be really really helpful if pbc_disassemble could also print the contents of the constants table. Now, whenever a reference is made to a constant, PMC_CONST(n) is printed. It'd be nice what this constant is (value). (it would also hugely increase debugging capabilities for, say, debugging a PIR compiler)

kjs: Has the response so far addressed your concerns?

Thank you very much.
kid51

  Changed 4 years ago by Paul C. Anagnostopoulos

Is there any reason this ticket shouldn't be closed?

  Changed 4 years ago by Paul C. Anagnostopoulos

  • owner set to Paul C. Anagnostopoulos
  • status changed from new to assigned

  Changed 4 years ago by Paul C. Anagnostopoulos

  • status changed from assigned to closed
  • resolution set to fixed

Since pbc_disassemble does list the constants table, I see no reason to keep this ticket open.

Note: See TracTickets for help on using tickets.