disassembly failure

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

disassembly failure

Jump to solution
2,059 Views
Richly
Contributor III

Using CW10, I tried disassembling some legacy assembler code that requires the -Ci (Case insensitivity on label name) setting.  Once that is set, the code will assemble just fine; CTRL-B to build the project works.  However, selecting Disassemble by right-clicking on the file itself, when it's open in the editor, fails spectacularly, complaining "No Disassembly: Processor unknown. To disassemble, specify the processor with the -proc option."

 

Has anyone found a work-around for this?

Labels (1)
Tags (1)
0 Kudos
1 Solution
1,084 Views
BlackNight
NXP Employee
NXP Employee

First: thanks for reporting that problem, and indeed I can confirm it.

 

I looked into this issue, and the thing is: the option you have set 'per file' is not passed/handled by the disassembly menu command. What happens is that the first the file gets compiled/assembled, and then the resulting object file gets decoded to print the listing. The issue is that the -Ci option is not passed to the assembler: the assembler fails with an error. The other issue is that the decoder is not checking the error code from the assembler, and finally shows the assembler text output as hex listing (this is what you see).

You can see this behaviour in the Console View (you  might need to change the view showing the 'Disassembler' console).

I will log an issue about above so this could hopefully be fixed for a next release.

 

What I suggest you to use as workaround: Specify the -Ci option as 'global' option for the project (not per file) for now. This will assemble all files with the -Ci option, and hopefully this is not a problem for you.

 

Best regards,

BK

View solution in original post

0 Kudos
7 Replies
1,084 Views
CompilerGuru
NXP Employee
NXP Employee

The decoder (used to disassemble) falls back to disassemble a file as binary blob when it does not recognize it, for example

when you are decoding garbage (or a source file, same thing for the decoder :smileyhappy: ).

So which file are you decoding? Is the extension known in eclipse?

As workaround you can also decode the object or application elf file instead.

 

It worked for me for *.s/*.asm files, it did not detect *.S as assembly files at all though. *.S files where not built and also the disassembly context menu was disabled.

 

Daniel

0 Kudos
1,084 Views
Richly
Contributor III

The disassembler works fine on the source files I've tried unless the file requires the -Ci (ignore case of labels) flag.

 

The legacy code I'm working with (some of it decades old) is pretty cavalier about case, so a label like READKEY may be referred to as ReadKey in some places.  The code will assemble just fine when the -Ci flag is present, but it does not disassemble.

 

If you want to see this for yourself, let CW10 create a new project for something like the MC9S08SH16, and select the relocatable assembly option.  Build the project (CTRL-B); it works. Look at the automatically generated assembly file (asm_main.asm) in the editor and right click. Select disassemble.  It works.  Now set the assembler to ignore the case of labels (see below) and add the line

    BRA  ASM_MAIN

just before the RTS line in the file asm_main.asm.  The program will still assemble when you build the project (CTRL-B), but it won't disassemble.  In fact, the result is fairly ugly.  Scroll to the bottom and you'll see the somewhat bizarre comment that it can't disassemble because it doesn't know what the processor is!  This is the issue I'm asking about.

 

Thanks,

    Richly

 

To set the assembler to ignore case, right-click on any .asm file in the CodeWarrior Projects window and select Properties.  Expand the C/C++ Build branch of the tree and select Settings.  In the Tool Settings tab of the panel that appears, select the Language option of the HCS08 Assembler node.  Check the first option, Case insensitivity on label name (-Ci), and then click OK.

0 Kudos
1,084 Views
J2MEJediMaster
Specialist I

It sounds like you need to file a service request on this problem. Click here to do that.

 

---Tom

0 Kudos
1,084 Views
Richly
Contributor III

Thanks.  I'd already filed a service request but was hoping that someone has a workaround that works.  The response so far from tech support has not been helpful.  They suggested making changes to the MCUinit.* files, which did nothing for the original problem disassembling asm_main.asm.

0 Kudos
1,085 Views
BlackNight
NXP Employee
NXP Employee

First: thanks for reporting that problem, and indeed I can confirm it.

 

I looked into this issue, and the thing is: the option you have set 'per file' is not passed/handled by the disassembly menu command. What happens is that the first the file gets compiled/assembled, and then the resulting object file gets decoded to print the listing. The issue is that the -Ci option is not passed to the assembler: the assembler fails with an error. The other issue is that the decoder is not checking the error code from the assembler, and finally shows the assembler text output as hex listing (this is what you see).

You can see this behaviour in the Console View (you  might need to change the view showing the 'Disassembler' console).

I will log an issue about above so this could hopefully be fixed for a next release.

 

What I suggest you to use as workaround: Specify the -Ci option as 'global' option for the project (not per file) for now. This will assemble all files with the -Ci option, and hopefully this is not a problem for you.

 

Best regards,

BK

0 Kudos
1,084 Views
Richly
Contributor III

Thanks, BK.  That's it!  You've solved my problem.  I'm perfectly happy to use the -Ci option for the project. I assume it doesn't apply to C programs, just the assembly language programs, but that's just exactly what I need.

 

Again, thanks.

    Richly

0 Kudos
1,084 Views
BlackNight
NXP Employee
NXP Employee

glad that this works for you.

And yes: as you specify the -Ci option only for the assembler, it only applies to assembly files.

 

Erich

 

0 Kudos