westerndigitalcorporation / swerv-ISS

Western Digital’s Open Source RISC-V SweRV Instruction Set Simulator
200 stars 41 forks source link

whisper --disass cli argument doesn't work #17

Closed BassMunkee closed 4 years ago

BassMunkee commented 4 years ago

Hi there, I wanted a way to disassemble instructions to their symbolic names and as per the Readme, it is possible through the --disass param for whisper. However, it doesn't seem to be there.

Is this something which has been removed or yet to be implemented. If the general functionality is present but not exposed, I can try to implement it and submit a PR. Any pointers which can help me get started is appreciated.

jrahmeh commented 4 years ago

It is a bug. We will fix asap.

On Thu, Dec 12, 2019, 5:55 AM Srikanth A V notifications@github.com wrote:

Hi there, I wanted a way to disassemble instructions to their symbolic names and as per the Readme, it is possible through the --disass param for whisper. However, it doesn't seem to be there.

Is this something which has been removed or yet to be implemented. If the general functionality is present but not exposed, I can try to implement it and submit a PR. Any pointers which can help me get started is appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/westerndigitalcorporation/swerv-ISS/issues/17?email_source=notifications&email_token=AASHQX2IF6PUJZWS2GSAJDTQYI7GDA5CNFSM4JZ64NV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IAB3UZQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASHQX4YKFQP75KKP2ZKESLQYI7GDANCNFSM4JZ64NVQ .

jrahmeh commented 4 years ago

Hi Bassunkee,

If you run whisper with the --abinames switch it should display the symbolic register names. If that is not the case, please provide an example and we will fix it.

Joe

BassMunkee commented 4 years ago

Thanks for the reply, Joe.

I'm currently not trying to disassemble a program but just trying to get the names of instructions from their hex value using the disas param. This seems to work in interactive mode, but not as a direct param to whisper

There are 2 things that needs to be fixed.

  1. The param for disassembly should be corrected from disass to disas in the Readme.
  2. The disas command seems to work in interactive mode as described in the Readme, but this param has not been implemented in the regular mode, i.e., whipser **--disas** 0x3b

I noticed that it is not being captured in the parseCmdLineArgs() function. I'm not familiar with boost::program_options, so that's the extent of info I could find out so far.

Edit: Added the command and output message

> ./whisper --disas 0x93 0x33
> Error: Failed to load ELF file 0x93
> Error: Failed to load ELF file 0x33

Hope this helps.

Srikanth

jrahmeh commented 4 years ago

Hi Srikanth,

We had decided a while ago not to support command line disassembly (the --disas option). I will remove the help message for that option.

Joe

BassMunkee commented 4 years ago

Thanks for the clarification. Is there a technical reason for dropping it or is it a design decision?

jrahmeh commented 4 years ago

It complicates the top level code and the same functionality is available in interactive mode.

On Sun, Dec 15, 2019 at 9:06 AM Srikanth A V notifications@github.com wrote:

Thanks for the clarification. Is there a technical reason for dropping it or is it a design decision?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/westerndigitalcorporation/swerv-ISS/issues/17?email_source=notifications&email_token=AASHQX6TL7KUY3SKSKH67NDQYZBWZA5CNFSM4JZ64NV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG43CBA#issuecomment-565817604, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASHQXYZZT6JOQG2MH3EG5DQYZBWZANCNFSM4JZ64NVQ .