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

Update x86 DWARF registers maps #1633

Merged
merged 4 commits into from
Nov 27, 2023
Merged

Conversation

hainest
Copy link
Contributor

@hainest hainest commented Nov 24, 2023

I will add the missing control registers in a separate PR after this is merged.

@hainest hainest added the DWARF Item is related to DWARF parsing label Nov 24, 2023
@hainest hainest requested a review from kupsch November 24, 2023 17:09
@hainest hainest self-assigned this Nov 24, 2023
Comment on lines 1180 to 1205
case 1043: return Dyninst::x86::cr0;
case 1044: return Dyninst::x86::cr2;
case 1045: return Dyninst::x86::cr4;
case 1046: return Dyninst::x86::cr6;
case 1047: return Dyninst::x86::dr0;
case 1048: return Dyninst::x86::dr2;
case 1049: return Dyninst::x86::dr4;
case 1050: return Dyninst::x86::dr6;
case 1051: return Dyninst::x86::ymm0;
case 1052: return Dyninst::x86::ymm2;
case 1053: return Dyninst::x86::ymm4;
case 1054: return Dyninst::x86::ymm6;
case 1055: return Dyninst::x86::zmm0;
case 1056: return Dyninst::x86::zmm2;
case 1057: return Dyninst::x86::zmm4;
case 1058: return Dyninst::x86::zmm6;
case 1059: return Dyninst::x86::k0;
case 1060: return Dyninst::x86::k2;
case 1061: return Dyninst::x86::k4;
case 1062: return Dyninst::x86::k6;
case 1063: return Dyninst::x86::oeax;
case 1064: return Dyninst::x86::gsbase;
case 1065: return Dyninst::x86::tr1;
case 1066: return Dyninst::x86::tr3;
case 1067: return Dyninst::x86::tr5;
case 1068: return Dyninst::x86::tr7;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason that the odd cr, dr, ymm, zmm, and k registers are missing, along with the even tr registers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the perl script I was using to generate these had a huge bug in it that I didn't notice. Fixed now.

Comment on lines 1422 to 1425
case 1102: return Dyninst::x86_64::tr0;
case 1103: return Dyninst::x86_64::tr2;
case 1104: return Dyninst::x86_64::tr4;
case 1105: return Dyninst::x86_64::tr6;
Copy link
Contributor

Choose a reason for hiding this comment

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

why are the odd tr registers missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above.

case 127: return Dyninst::InvalidReg;
case 128: return Dyninst::InvalidReg;
case 129: return Dyninst::InvalidReg;

Copy link
Contributor

Choose a reason for hiding this comment

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

The Oct 2023 ABI doc maps 130-145 to r16-r31 (the new registered defined by APX). These can likely be ignored for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. Capstone doesn't support AMX yet because it's based on LLVM 15 which has very poor support for them. The next release of Capstone will be based on at least LLVM 17 which has full support. I'll probably add the TMM registers soon just to have them.

@hainest hainest merged commit 5ac2236 into master Nov 27, 2023
@hainest hainest deleted the thaines/dwarf_register_mapping branch November 27, 2023 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DWARF Item is related to DWARF parsing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants