rizinorg / rizin

UNIX-like reverse engineering framework and command-line toolset.
https://rizin.re
GNU Lesser General Public License v3.0
2.71k stars 363 forks source link

Refactor native debugger #4581

Open wargio opened 4 months ago

wargio commented 4 months ago

Currently the native debugger implemented in Rizin is a mess of #ifdef which always brings bugs each time is touched. The idea behind this refactoring is to split all the native archs into files and just fill a structure with function pointers for each feature that the native debugger code needs. This allows to cleanup the code and fix all weird behaviors in each OS.

  1. Split all the native OS code in its own file (https://github.com/rizinorg/rizin/pull/4604)
  2. Split all the native arch code for each OS in its own file (https://github.com/rizinorg/rizin/pull/4604)
  3. Ensure the current code is still working (even if bugged) in the same way. (https://github.com/rizinorg/rizin/pull/4604)
  4. Start patching all the various issues in the repo related to the native debugger.
wargio commented 4 months ago

Android and linux must be splitted in its own OS. also any unix compatible shared code can be copied and pasted multiple times.

tushar3q34 commented 3 months ago

Hey @wargio can you share a bit more about what file(s) are supposed to be changed ? By reading the code, I think that the changes are targeted towards debug_native.c . Please correct me if I'm wrong.

wargio commented 3 months ago

That is correct. The issue is that the debugger is full of bugs and quite unreliable because one change in an arch, breaks another arch. So the idea is to split more in depth the debugger and have os/arch This way we can reuse the common api and implement whatever is arch specific

tushar3q34 commented 3 months ago

Ok thank you very much for the quick response. Can I start working on this issue ?

wargio commented 3 months ago

No need to ask for permission, go for it

tushar3q34 commented 2 months ago

Hello @wargio I am almost done with refactoring the code. Can you tell me how should I test my changes ? I have used meson test -C build.

wargio commented 2 months ago

Just open a PR and see what you break. Be sure your branch name starts with dist-

wargio commented 2 months ago

i would not close this since the last point is not done.