Skip to content

Conversation

@knn-k
Copy link
Contributor

@knn-k knn-k commented Apr 12, 2022

This commit adds code for setting "flavor" and "count" in the thread
commands in the core files on AArch64 macOS.

Signed-off-by: KONNO Kazuhiro konno@jp.ibm.com

This commit adds code for setting "flavor" and "count" in the thread
commands in the core files on AArch64 macOS.

Signed-off-by: KONNO Kazuhiro <konno@jp.ibm.com>
@knn-k
Copy link
Contributor Author

knn-k commented Apr 12, 2022

otool -l shows the output like the following when this PR is applied. The register values in it look reasonable.

Load command 0
        cmd LC_THREAD
    cmdsize 848
     flavor ARM_THREAD_STATE64
      count ARM_THREAD_STATE64_COUNT
            x0  0x000000016b36dac0 x1  0x0000000007000806 x2  0x0000000000000000
            x3  0x0000000000000c00 x4  0x0000000000001703 x5  0x00000000ffffffff
            x6  0x0000000000000000 x7  0x0000000135109510 x8  0x00000000fffffbbf
            x9  0x000000001f52e2dc x10 0x000000007d4b8b72 x11 0x000000b2f323c36e
            x12 0x00000000016e3600 x13 0x0000000000044c91 x14 0x0000000000000000
            x15 0x0000000000000000 x16 0xffffffffffffffe1 x17 0x00000002082ac790
            x18 0x0000000000000000 x19 0x0000000000000000 x20 0x00000000ffffffff
            x21 0x0000000000001703 x22 0x0000000000000c00 x23 0x000000016b36dac0
            x24 0x0000000007000806 x25 0x0000000000000000 x26 0x0000000007000806
            x27 0x0000000000001703 x28 0x000000016b36da48  fp 0x000000016b36d950
             lr 0x000000019d135144 sp  0x000000016b36d900  pc 0x000000019d134d94
           cpsr 0x80000000

@knn-k
Copy link
Contributor Author

knn-k commented Apr 12, 2022

I am not making changes to the code for x86 in this PR.

macOS data structures seem to be different between x86 and AArch64.
x86_thread_state_t, x86_float_state, and x86_exception_state contain x86_state_hdr_t.
On the other hand, arm_thread_state64_t, arm_neon_state64_t, and arm_exception_state64_t don't contain arm_state_hdr_t.

@knn-k
Copy link
Contributor Author

knn-k commented Apr 14, 2022

@keithc-ca Could you take a look at this, please? Thanks.

Copy link
Contributor

@keithc-ca keithc-ca left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me based on the comments, including the otool output.

@0xdaryl
Copy link
Contributor

0xdaryl commented Apr 19, 2022

Jenkins build osx,aarch64

@0xdaryl 0xdaryl merged commit 27cfca3 into eclipse-omr:master Apr 19, 2022
@knn-k knn-k deleted the macos_core_flavor branch April 19, 2022 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants