From: Tom Tromey Date: Tue, 10 Feb 2026 14:47:42 +0000 (-0700) Subject: Handle fixed-point types in amd64_classify X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cdb01e167ed486d02e9a4aff98936b77597a352;p=thirdparty%2Fbinutils-gdb.git Handle fixed-point types in amd64_classify gdb.ada/fixed_points_function.exp was failing when compiled with gnat-llvm. Debugging showed that this was a gdb bug that was hidden by differences in the DWARF generated by gcc and gnat-llvm. In particular, gcc emitted a DW_TAG_subrange_type (a subrange of the fixed-point type) for the function's parameter type, whereas gnat-llvm used a fixed-point type directly. Then, the test failed because amd64_classify recognizes subrange types but not fixed-point types. Under the hood, fixed-point types are really just integers, so the fix is to handle these directly in amd64_classify. Approved-By: Christina Schimpe --- diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index ff2e9dee117..1334ce6fb07 100755 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -693,11 +693,12 @@ amd64_classify (struct type *type, enum amd64_reg_class theclass[2]) /* Arguments of types (signed and unsigned) _Bool, char, short, int, long, long long, and pointers are in the INTEGER class. Similarly, - range types, used by languages such as Ada, are also in the INTEGER - class. */ + range and fixed-point types, used by languages such as Ada, are + also in the INTEGER class. This comes form the System V ABI + (section 3.2.3, Parameter Passing). */ if ((code == TYPE_CODE_INT || code == TYPE_CODE_ENUM || code == TYPE_CODE_BOOL || code == TYPE_CODE_RANGE - || code == TYPE_CODE_CHAR + || code == TYPE_CODE_CHAR || code == TYPE_CODE_FIXED_POINT || code == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type)) && (len == 1 || len == 2 || len == 4 || len == 8)) theclass[0] = AMD64_INTEGER;