|
4 | 4 | import sys
|
5 | 5 | import traceback
|
6 | 6 |
|
| 7 | +# Add compatibility for older GDB versions |
| 8 | +if not hasattr(gdb, 'SYMBOL_FUNCTION_DOMAIN'): |
| 9 | + gdb.SYMBOL_FUNCTION_DOMAIN = 0 # This is the value used in newer GDB versions |
| 10 | + |
| 11 | +# Configure demangling for Itanium C++ ABI (which Nim uses) |
| 12 | +try: |
| 13 | + gdb.execute("set demangle-style gnu-v3") # GNU v3 style handles Itanium mangling |
| 14 | + gdb.execute("set print asm-demangle on") |
| 15 | + gdb.execute("set print demangle on") |
| 16 | +except Exception as e: |
| 17 | + gdb.write(f"Warning: Could not configure demangling: {str(e)}\n", gdb.STDERR) |
| 18 | + |
7 | 19 | # some feedback that the nim runtime support is loading, isn't a bad
|
8 | 20 | # thing at all.
|
9 | 21 | gdb.write("Loading Nim Runtime support.\n", gdb.STDERR)
|
@@ -70,12 +82,12 @@ class NimTypeRecognizer:
|
70 | 82 | type_map_static = {
|
71 | 83 | 'NI': 'system.int', 'NI8': 'int8', 'NI16': 'int16', 'NI32': 'int32',
|
72 | 84 | 'NI64': 'int64',
|
73 |
| - |
| 85 | + |
74 | 86 | 'NU': 'uint', 'NU8': 'uint8','NU16': 'uint16', 'NU32': 'uint32',
|
75 | 87 | 'NU64': 'uint64',
|
76 |
| - |
| 88 | + |
77 | 89 | 'NF': 'float', 'NF32': 'float32', 'NF64': 'float64',
|
78 |
| - |
| 90 | + |
79 | 91 | 'NIM_BOOL': 'bool',
|
80 | 92 |
|
81 | 93 | 'NIM_CHAR': 'char', 'NCSTRING': 'cstring', 'NimStringDesc': 'string', 'NimStringV2': 'string'
|
@@ -556,7 +568,7 @@ def children(self):
|
556 | 568 | except RuntimeError:
|
557 | 569 | inaccessible = True
|
558 | 570 | yield "data[{0}]".format(i), "inaccessible"
|
559 |
| - |
| 571 | + |
560 | 572 | ################################################################################
|
561 | 573 |
|
562 | 574 | class NimArrayPrinter:
|
|
0 commit comments