rizin icon indicating copy to clipboard operation
rizin copied to clipboard

Add NetBSD debug tests and fix errors

Open well-mannered-goat opened this issue 6 months ago • 2 comments

Your checklist for this pull request

  • [x] I've read the guidelines for contributing to this repository.
  • [x] I made sure to follow the project's coding style.
  • [ ] I've documented every RZ_API function and struct this PR changes.
  • [x] I've added tests that prove my changes are effective (required for changes to RZ_API).
  • [ ] I've updated the Rizin book with the relevant information (if needed).

Detailed description

  • Added netbsd x86_64 register profile so that the registers are assigned correct values and hence the core->offset, this would show the correct address in the rizin prompt instead of 0x000 for netbsd in debugger mode.
  • Fixed native_wait function in netbsd.c to use the correct reason instead of assigning RZ_DEBUG_REASON_TRAP and correctly show prompt if process is exited.
  • The netbsd attach function just ignored if the ptrace failed (which it would because the debugee is attached from fork and trace), so instead added proper error handling.
  • added some netbsd tests, used the binary files that xvilka had pushed in rizin-testbins earlier.

Test plan

rz-test test/db/archos/netbsd-x64 CI is green

Closing issues

closed #3274 and partially #3072

well-mannered-goat avatar Jun 16 '25 12:06 well-mannered-goat

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 44.54%. Comparing base (9f17373) to head (e9f0aac).

Additional details and impacted files
Files with missing lines Coverage Δ
librz/debug/debug.c 43.69% <ø> (-0.41%) :arrow_down:

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9f17373...e9f0aac. Read the comment docs.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 16 '25 14:06 codecov[bot]

Ignore the comment about breakpoints - I see they are part of one test

notxvilka avatar Jun 17 '25 15:06 notxvilka

Have tweaked some tests to check how they are working, will fix rz-test accordingly

well-mannered-goat avatar Jun 18 '25 17:06 well-mannered-goat