Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rzil PIC #4322

Merged
merged 19 commits into from
May 19, 2024
Merged

Rzil PIC #4322

merged 19 commits into from
May 19, 2024

Conversation

imbillow
Copy link
Contributor

@imbillow imbillow commented Mar 3, 2024

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

ref #3461

https://en.wikipedia.org/wiki/PIC_instruction_listings

https://developerhelp.microchip.com/xwiki/bin/view/products/mcu-mpu/8bit-pic/enhanced-family/emdata/

Test plan

...

Closing issues

closes #3461

@XVilka XVilka added the RZIL label Mar 3, 2024
@github-actions github-actions bot removed the RZIL label Mar 3, 2024
@XVilka XVilka mentioned this pull request Mar 5, 2024
38 tasks
@github-actions github-actions bot added the PIC label Mar 26, 2024
@imbillow imbillow force-pushed the rzil-pic branch 2 times, most recently from d86d06e to 527f23b Compare March 26, 2024 14:17
@imbillow imbillow force-pushed the rzil-pic branch 2 times, most recently from 1d1cfaf to 2d21f83 Compare April 16, 2024 07:13
@XVilka XVilka added this to the 0.8.0 milestone Apr 21, 2024
@imbillow imbillow force-pushed the rzil-pic branch 3 times, most recently from 090beb3 to 70b0215 Compare April 29, 2024 00:39
@imbillow
Copy link
Contributor Author

Looks almost ready. The only thing left is rename, I guess?

This one should be done.

@imbillow
Copy link
Contributor Author

It seems rizin has some segment mapping issues for pic16 elf files. This causes the emulate test not to run as expected.

[0x00000000]> omlt
.----------------------------------------------------------------------.
| id | fd | pa    | pa_end | size | va    | va_end | perm | name       |
)----------------------------------------------------------------------(
| 1  | 3  | 0x34  | 0x7c   | 0x48 | 0x7db | 0x823  | r--  | fmap.LOAD0 |
| 2  | 3  | 0x7c  | 0xee   | 0x72 | 0x7a2 | 0x814  | r--  | fmap.LOAD1 |
| 3  | 3  | 0xee  | 0xf8   | 0xa  | 0x78c | 0x796  | r--  | fmap.LOAD2 |
| 4  | 4  | 0x0   | 0xa    | 0xa  | 0x70  | 0x7a   | rw-  | mmap.LOAD3 |
| 5  | 3  | 0xf8  | 0x102  | 0xa  | 0x0   | 0xa    | r--  | fmap.LOAD4 |
| 6  | 3  | 0x102 | 0x124  | 0x22 | 0x791 | 0x7b3  | r--  | fmap.LOAD5 |
| 7  | 3  | 0x124 | 0x154  | 0x30 | 0x5   | 0x35   | r--  | fmap.LOAD6 |
| 8  | 5  | 0x0   | 0x11   | 0x11 | 0x20  | 0x31   | rw-  | mmap.LOAD7 |
| 9  | 6  | 0x0   | 0x2    | 0x2  | 0x7e  | 0x80   | rw-  | mmap.LOAD8 |
`----------------------------------------------------------------------'

If you know the problem/fix, it's probably better to send as a separate PR, to merge before this one.

Though but I don't know the fix. It just feels like a pic16 emulateme test could be added with some hacks

@XVilka
Copy link
Member

XVilka commented May 17, 2024

Looks almost ready. The only thing left is rename, I guess?

This one should be done.

Oh, right, I was mistaken because of the old filenames shown in the diff (removed files).

@XVilka
Copy link
Member

XVilka commented May 17, 2024

It seems rizin has some segment mapping issues for pic16 elf files. This causes the emulate test not to run as expected.

[0x00000000]> omlt
.----------------------------------------------------------------------.
| id | fd | pa    | pa_end | size | va    | va_end | perm | name       |
)----------------------------------------------------------------------(
| 1  | 3  | 0x34  | 0x7c   | 0x48 | 0x7db | 0x823  | r--  | fmap.LOAD0 |
| 2  | 3  | 0x7c  | 0xee   | 0x72 | 0x7a2 | 0x814  | r--  | fmap.LOAD1 |
| 3  | 3  | 0xee  | 0xf8   | 0xa  | 0x78c | 0x796  | r--  | fmap.LOAD2 |
| 4  | 4  | 0x0   | 0xa    | 0xa  | 0x70  | 0x7a   | rw-  | mmap.LOAD3 |
| 5  | 3  | 0xf8  | 0x102  | 0xa  | 0x0   | 0xa    | r--  | fmap.LOAD4 |
| 6  | 3  | 0x102 | 0x124  | 0x22 | 0x791 | 0x7b3  | r--  | fmap.LOAD5 |
| 7  | 3  | 0x124 | 0x154  | 0x30 | 0x5   | 0x35   | r--  | fmap.LOAD6 |
| 8  | 5  | 0x0   | 0x11   | 0x11 | 0x20  | 0x31   | rw-  | mmap.LOAD7 |
| 9  | 6  | 0x0   | 0x2    | 0x2  | 0x7e  | 0x80   | rw-  | mmap.LOAD8 |
`----------------------------------------------------------------------'

If you know the problem/fix, it's probably better to send as a separate PR, to merge before this one.

Though but I don't know the fix. It just feels like a pic16 emulateme test could be added with some hacks

Could you please try to look if it's something easy/obvious? If yes, it's better to fix it properly. But if you can't see the problem quickly, then it will be fine to add the emulateme with workarounds.

Copy link
Member

@XVilka XVilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one small nitpick

librz/arch/p/asm/asm_pic.c Outdated Show resolved Hide resolved
@XVilka XVilka merged commit 14e9787 into dev May 19, 2024
45 of 47 checks passed
@XVilka XVilka deleted the rzil-pic branch May 19, 2024 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants