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

riscv_read_by_any_size() is redundant #1205

Open
en-sc opened this issue Jan 15, 2025 · 0 comments
Open

riscv_read_by_any_size() is redundant #1205

en-sc opened this issue Jan 15, 2025 · 0 comments
Labels
Good First Issue This label marks the first good issue for anyone willing to contribute to the project.

Comments

@en-sc
Copy link
Collaborator

en-sc commented Jan 15, 2025

riscv_read_by_any_size() is used to try all available sizes when reading memory:

/**
* Read one memory item using any memory access size that will work.
* Read larger section of memory and pick out the required portion, if needed.
* */
int riscv_read_by_any_size(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
{

riscv_read_by_any_size() is currently used in riscv_semihosting() and in riscv_add_breakpoint() to read instructions.

There is also target_read_buffer(). It provides the same interface.
Seems like riscv_read_by_any_size() should be the implementation of target_read_buffer() (currently target_read_buffer_default() is used).

@en-sc en-sc added the Good First Issue This label marks the first good issue for anyone willing to contribute to the project. label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue This label marks the first good issue for anyone willing to contribute to the project.
Projects
None yet
Development

No branches or pull requests

1 participant