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

Fix: gdb cannot parse some regs value when debugging ARM64 #1526

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

the-soloist
Copy link

@the-soloist the-soloist commented Jan 9, 2025

Checklist

Which kind of PR do you create?

  • This PR only contains minor fixes.
  • This PR contains major feature update.
  • This PR introduces a new function/api for Qiling Framework.

Coding convention?

  • The new code conforms to Qiling Framework naming convention.
  • The imports are arranged properly.
  • Essential comments are added.
  • The reference of the new code is pointed out.

Extra tests?

  • No extra tests are needed for this PR.
  • I have added enough tests for this PR.
  • Tests will be added after some discussion and review.

Changelog?

  • This PR doesn't need to update Changelog.
  • Changelog will be updated after some proper review.
  • Changelog has been updated in my PR.

Target branch?

  • The target branch is dev branch.

One last thing


edit: test with gdb 12.1
image

gdb-multiarch is unable to correctly retrieve the values of the cspr, fpsr, and fpcr registers when debugging programs on the ARM64 architecture because Qiling has not defined them.

image

After modification, it can be correctly parsed.

image
import sys
import qiling
import struct
from pathlib import Path
from qiling import Qiling
from qiling.debugger.qdb import QlQdb
from qiling.const import QL_VERBOSE
from qiling.os.mapper import QlFsMappedObject


def main():
    ql = Qiling(["./rootfs/bin/arm64_hello"],
                rootfs="./rootfs",
                verbose=QL_VERBOSE.DEBUG)
    ql.debugger = True
    ql.run()


if __name__ == "__main__":
    main()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant