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

[libunwind] Implement handling for kRegisterUndefined for capability registers #728

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

dstolfa
Copy link
Contributor

@dstolfa dstolfa commented Feb 22, 2024

This should make all the morello tests pass except for libunwind_get_registers_pass.cpp which fails with:

/home/ds815/cheri/llvm-project/libunwind/test/libunwind_get_registers.pass.cpp:104:2: error: "Test not implemented for this architecture" [-Werror,-W#warnings]
#warning "Test not implemented for this architecture"

The DWARF that was problematic looked roughly like this:

  DW_CFA_undefined: reg228
  DW_CFA_advance_loc: 28
  DW_CFA_def_cfa: reg227 +32
  DW_CFA_offset_extended: reg228 -16
  DW_CFA_offset_extended: reg227 -32

libunwind/src/Registers.hpp Outdated Show resolved Hide resolved
Copy link
Member

@arichardson arichardson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches getSavedRegister() so seems completely reasonable. Just one minor suggestion

@jrtc27
Copy link
Member

jrtc27 commented Feb 22, 2024

Oh, actually, you don't need the define at all. Both uintcap_t and fake_capability have default initialisers that'll give you 0, so return fake_capability_t(); should be all you need.

This makes all supported morello tests pass.
@jrtc27 jrtc27 merged commit b32599b into dev Mar 20, 2024
6 checks passed
@jrtc27 jrtc27 deleted the DW_CFA_undefined branch March 20, 2024 16:29
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.

3 participants