Support tuples in nim-gdb (#21410)

* Support for printing tuple types

* Add test of printing a tuple

* Add support for printing tuples in GDB

* Forgot to [skip ci]
This commit is contained in:
Jake Leahy 2023-02-21 22:02:42 +11:00 • committed by GitHub
commit e54d3cc418
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 5 deletions

View file

@ -28,7 +28,8 @@ outputs = [
'seq(3, 3) = {"one", "two", "three"}',
'Table(3, 64) = {[4] = "four", [5] = "five", [6] = "six"}',
'Table(3, 8) = {["two"] = 2, ["three"] = 3, ["one"] = 1}',
'{a = 1, b = "some string"}'
'{a = 1, b = "some string"}',
'("hello", 42)'
]
argRegex = re.compile("^.* = (?:No suitable Nim \$ operator found for type: \w+\s*)*(.*)$")

View file

@ -80,7 +80,10 @@ proc testProc(): void =
var obj = MyObj(a: 1, b: "some string")
myDebug(obj) #15
assert counter == 15
var tup = ("hello", 42)
myDebug(tup) # 16
assert counter == 16
testProc()