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

Library loading in remote process #4

Open
rhuizer opened this issue Feb 1, 2020 · 0 comments
Open

Library loading in remote process #4

rhuizer opened this issue Feb 1, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@rhuizer
Copy link
Contributor

rhuizer commented Feb 1, 2020

Currently pt_inject can be used to execute code in a pt_process. Although this is a very low-level primitive, it is not very flexible. An additional function for loading shared libraries into processes is therefore desirable.

One approach is to describe shared libraries using pt_module, and add a function such as pt_process_module_load(struct pt_process *p, struct pt_module *m) to load them into processes. The drawback here is that it adds additional meaning to the pt_module structure, which would now describe both shared libraries loaded into a debuggee process, as well as on disk shared libraries. This weakens type safety, and creates behind the scenes management code overhead.

Another approach is to add pt_process_library_load(struct pt_process *p, const char *pathname), which is simple, but does not allow for other shared library representations than one that can be referred to by a pathname. In other words, we could load shared libraries from disk, but not from memory.

Finally, a new structure such as pt_library could be added to refer to libraries external to the debuggee, and the new function would be pt_process_library_load(struct pt_process *p, struct pt_library *l). Once loaded it would then appear as a pt_module within the debuggee process.

The last option has my preference, but I'm leaving this open for a bit for further discussion and contemplation.

@rhuizer rhuizer added the enhancement New feature or request label Feb 1, 2020
@rhuizer rhuizer self-assigned this Feb 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant