achan1989 / ghidra-65816

WDC 65816 processor module for Ghidra
MIT License
22 stars 3 forks source link

Can't read language spec #11

Closed hellow554 closed 3 years ago

hellow554 commented 3 years ago

1613413447_grim

Ghidra Version is 9.2.2

achan1989 commented 3 years ago

It worked last time I tried it (though that was a while ago). Is there a file at /opt/ghidra/Ghidra/Processors/65816/data/languages/65816.slaspec and does it have sensible file permissions? Same for the parent directories?

hellow554 commented 3 years ago
marcel@thinker /o/g/G/Processors> la 65816/
total 24K
drwxr-xr-x  3 root root 4.0K Jun  3  2019 ./
drwxr-xr-x 35 root root 4.0K Feb 15 19:21 ../
drwxr-xr-x  3 root root 4.0K Jun  3  2019 data/
-rw-r--r--  1 root root   24 Jun  3  2019 .gitignore
-rw-r--r--  1 root root 1.1K Jun  3  2019 LICENSE
-rw-r--r--  1 root root    0 Jun  3  2019 Module.manifest
-rw-r--r--  1 root root 2.5K Jun  3  2019 README.md
marcel@thinker /o/g/G/Processors> la 65816/data/
total 12K
drwxr-xr-x 3 root root 4.0K Jun  3  2019 ./
drwxr-xr-x 3 root root 4.0K Jun  3  2019 ../
drwxr-xr-x 2 root root 4.0K Jun  3  2019 languages/
marcel@thinker /o/g/G/Processors> la 65816/data/languages/
total 136K
drwxr-xr-x 2 root root 4.0K Jun  3  2019  ./
drwxr-xr-x 3 root root 4.0K Jun  3  2019  ../
-rw-r--r-- 1 root root  454 Jun  3  2019  65816.cspec
-rw-r--r-- 1 root root  982 Jun  3  2019  65816.ldefs
-rw-r--r-- 1 root root  168 Jun  3  2019  65816.opinion
-rw-r--r-- 1 root root 1.3K Jun  3  2019  65816.pspec
-rw-r--r-- 1 root root   42 Jun  3  2019  65816.slaspec
-rw-r--r-- 1 root root  971 Jun  3  2019  658xx_memaccess_other.sinc
-rw-r--r-- 1 root root 2.2K Jun  3  2019  658xx_memaccess_pc.sinc
-rw-r--r-- 1 root root  17K Jun  3  2019  658xx_memaccess.sinc
-rw-r--r-- 1 root root  50K Jun  3  2019  658xx.sinc
-rw-r--r-- 1 root root  25K Jun  3  2019 'all instructions.ods'

Please note, that there is no 65816.sla file... is that normal?

oziphantom commented 3 years ago

mine has a 65816.sla file and it is 1,4967KB.

hellow554 commented 3 years ago

Any idea how it gets created? https://github.com/achan1989/ghidra-65816/tree/master/data/languages doesn't contain such file.

achan1989 commented 3 years ago

If I remember correctly, the .sla file is auto-generated by Ghidra after it loads and processes the .slaspec file.

@hellow554 your data files are all owned by root, so unless you're running Ghidra as root (which is probably a bad idea!) Ghidra won't have permission to read the files.

hellow554 commented 3 years ago

Ghidra is installed to /opt by my package manager pacman. So I copied your files into /opt/... as well and gave them the same file permissions as all the other processor types as well. That should be the right way to do. Is there a specific reason the .sla file is generated on the fly? Why do other processor specs to not do that? :/

achan1989 commented 3 years ago

I don't remember, it's been a long time since I've used this module.

qwertymodo commented 3 years ago

The issue seems to be a handful of unused labels in 658xx.sinc getting treated as errors. Commenting out the labels with a '#' at the beginning of the following lines seems to solve it

658xx.sinc:1579: <binary>
658xx.sinc:1622: <binary>
658xx.sinc:2018: <to_emulation>
658xx.sinc:2044: <to_emulation>
achan1989 commented 3 years ago

This should have been fixed by PR #13 which is now merged.