Skip to content

Commit f6d252f

Browse files
committed
Use gdb.Architecture.integer_type to fix big numbers handling on Windows
TN: UA19-042 Change-Id: I62cbdc5fdd8371b80edec0f27b136ba9ccde35e8
1 parent a1b2559 commit f6d252f

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

gnatdbg/big_numbers.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@ def get(self):
3333
# don't have debug info for this type, so we have to poke blindly at
3434
# memory.
3535
#
36-
# We consider that big number data is layed out as an array of uint32_t
37-
# values. The first one gives the number N of 32-bit digits that make
38-
# up this number (24 least significant bits) and whether that number is
39-
# negative (25th bit). Then the next N uint32_t values are the 32-bit
40-
# digits for the big number (most significant digits first).
36+
# We consider that big number data is layed out as an array of unsigned
37+
# 32-bit values. The first one gives the number N of 32-bit digits
38+
# that make up this number (24 least significant bits) and whether that
39+
# number is negative (25th bit). Then the next N unsigned values are
40+
# the 32-bit digits for the big number (most significant digits first).
4141
#
4242
# TODO: it is not clear reading the spec how the first digit is mapped
4343
# on big-endian systems.
44-
uint32_t = gdb.lookup_type('uint32_t')
44+
uint32_t = gdb.selected_frame().architecture().integer_type(
45+
32, signed=False
46+
)
4547
data_ptr = self._bignum_address.cast(uint32_t.pointer())
4648

4749
info = data_ptr.dereference()
-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
driver: python
2-
control:
3-
# TODO: remove this limitation once UA22-033 is implemented
4-
- [XFAIL, "env.target.os.name == 'windows'", "uint32_t not available on Windows"]

testsuite/tests/big-reals/test.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
driver: python
2-
control:
3-
# TODO: remove this limitation once UA22-033 is implemented
4-
- [XFAIL, "env.target.os.name == 'windows'", "uint32_t not available on Windows"]

0 commit comments

Comments
 (0)