| ... | ... | @@ -107,11 +107,11 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 107 | 107 | }, |
| 108 | 108 | \\breakpoint set --file basic.zig --source-pattern-regexp '_ = basic;' |
| 109 | 109 | \\process launch |
| 110 | | \\frame variable --show-types basic |
| 110 | \\frame variable --show-types -- basic |
| 111 | 111 | \\breakpoint delete --force 1 |
| 112 | 112 | , |
| 113 | 113 | &.{ |
| 114 | | \\(lldb) frame variable --show-types basic |
| 114 | \\(lldb) frame variable --show-types -- basic |
| 115 | 115 | \\(root.basic.Basic) basic = { |
| 116 | 116 | \\ (void) void = {} |
| 117 | 117 | \\ (bool) bool_false = false |
| ... | ... | @@ -243,11 +243,11 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 243 | 243 | }, |
| 244 | 244 | \\breakpoint set --file pointers.zig --source-pattern-regexp '_ = pointers;' |
| 245 | 245 | \\process launch |
| 246 | | \\frame variable --show-types pointers |
| 246 | \\frame variable --show-types -- pointers |
| 247 | 247 | \\breakpoint delete --force 1 |
| 248 | 248 | , |
| 249 | 249 | &.{ |
| 250 | | \\(lldb) frame variable --show-types pointers |
| 250 | \\(lldb) frame variable --show-types -- pointers |
| 251 | 251 | \\(root.pointers.Pointers) pointers = { |
| 252 | 252 | \\ (*u32) single = 0x0000000000001010 |
| 253 | 253 | \\ (*const u32) single_const = 0x0000000000001014 |
| ... | ... | @@ -330,13 +330,13 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 330 | 330 | }, |
| 331 | 331 | \\breakpoint set --file strings.zig --source-pattern-regexp '_ = strings;' |
| 332 | 332 | \\process launch |
| 333 | | \\frame variable --show-types strings.slice |
| 334 | | \\frame variable --show-types --format character strings.slice |
| 335 | | \\frame variable --show-types --format c-string strings |
| 333 | \\frame variable --show-types -- strings.slice |
| 334 | \\frame variable --show-types --format character -- strings.slice |
| 335 | \\frame variable --show-types --format c-string -- strings |
| 336 | 336 | \\breakpoint delete --force 1 |
| 337 | 337 | , |
| 338 | 338 | &.{ |
| 339 | | \\(lldb) frame variable --show-types strings.slice |
| 339 | \\(lldb) frame variable --show-types -- strings.slice |
| 340 | 340 | \\([:0]const u8) strings.slice = len=9 { |
| 341 | 341 | \\ (u8) [0] = 115 |
| 342 | 342 | \\ (u8) [1] = 108 |
| ... | ... | @@ -348,7 +348,7 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 348 | 348 | \\ (u8) [7] = 92 |
| 349 | 349 | \\ (u8) [8] = 0 |
| 350 | 350 | \\} |
| 351 | | \\(lldb) frame variable --show-types --format character strings.slice |
| 351 | \\(lldb) frame variable --show-types --format character -- strings.slice |
| 352 | 352 | \\([:0]const u8) strings.slice = len=9 { |
| 353 | 353 | \\ (u8) [0] = 's' |
| 354 | 354 | \\ (u8) [1] = 'l' |
| ... | ... | @@ -360,7 +360,7 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 360 | 360 | \\ (u8) [7] = '\\' |
| 361 | 361 | \\ (u8) [8] = '\x00' |
| 362 | 362 | \\} |
| 363 | | \\(lldb) frame variable --show-types --format c-string strings |
| 363 | \\(lldb) frame variable --show-types --format c-string -- strings |
| 364 | 364 | \\(root.strings.Strings) strings = { |
| 365 | 365 | \\ ([*c]const u8) c_ptr = "c_ptr\x07\x08\t" |
| 366 | 366 | \\ ([*:0]const u8) many_ptr = "many_ptr\n\x0b\x0c" |
| ... | ... | @@ -412,7 +412,7 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 412 | 412 | \\breakpoint set --file enums.zig --source-pattern-regexp '_ = enums;' |
| 413 | 413 | \\process launch |
| 414 | 414 | \\expression --show-types -- Enums |
| 415 | | \\frame variable --show-types enums |
| 415 | \\frame variable --show-types -- enums |
| 416 | 416 | \\breakpoint delete --force 1 |
| 417 | 417 | , |
| 418 | 418 | &.{ |
| ... | ... | @@ -432,7 +432,7 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 432 | 432 | \\ (root.enums.Enums.Three) third = .third |
| 433 | 433 | \\ } |
| 434 | 434 | \\} |
| 435 | | \\(lldb) frame variable --show-types enums |
| 435 | \\(lldb) frame variable --show-types -- enums |
| 436 | 436 | \\(root.enums.Enums) enums = { |
| 437 | 437 | \\ (root.enums.Enums.Zero) zero = @enumFromInt(13) |
| 438 | 438 | \\ (root.enums.Enums.One) one = .first |
| ... | ... | @@ -476,7 +476,7 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 476 | 476 | \\breakpoint set --file errors.zig --source-pattern-regexp '_ = errors;' |
| 477 | 477 | \\process launch |
| 478 | 478 | \\expression --show-types -- Errors |
| 479 | | \\frame variable --show-types errors |
| 479 | \\frame variable --show-types -- errors |
| 480 | 480 | \\breakpoint delete --force 1 |
| 481 | 481 | , |
| 482 | 482 | &.{ |
| ... | ... | @@ -496,7 +496,7 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 496 | 496 | \\ (error{One,Two,Three}) Three = error.Three |
| 497 | 497 | \\ } |
| 498 | 498 | \\} |
| 499 | | \\(lldb) frame variable --show-types errors |
| 499 | \\(lldb) frame variable --show-types -- errors |
| 500 | 500 | \\(root.errors.Errors) errors = { |
| 501 | 501 | \\ (error{One}) one = error.One |
| 502 | 502 | \\ (error{One,Two}) two = error.Two |
| ... | ... | @@ -535,23 +535,23 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 535 | 535 | }, |
| 536 | 536 | \\breakpoint set --file optionals.zig --source-pattern-regexp 'maybe_u32 = 123;' |
| 537 | 537 | \\process launch |
| 538 | | \\frame variable null_u32 maybe_u32 nonnull_u32 |
| 538 | \\frame variable -- null_u32 maybe_u32 nonnull_u32 |
| 539 | 539 | \\breakpoint delete --force 1 |
| 540 | 540 | \\ |
| 541 | 541 | \\breakpoint set --file optionals.zig --source-pattern-regexp '_ = \.{ &null_u32, &nonnull_u32 };' |
| 542 | 542 | \\process continue |
| 543 | | \\frame variable --show-types null_u32 maybe_u32 nonnull_u32 |
| 543 | \\frame variable --show-types -- null_u32 maybe_u32 nonnull_u32 |
| 544 | 544 | \\breakpoint delete --force 2 |
| 545 | 545 | , |
| 546 | 546 | &.{ |
| 547 | | \\(lldb) frame variable null_u32 maybe_u32 nonnull_u32 |
| 547 | \\(lldb) frame variable -- null_u32 maybe_u32 nonnull_u32 |
| 548 | 548 | \\(?u32) null_u32 = null |
| 549 | 549 | \\(?u32) maybe_u32 = null |
| 550 | 550 | \\(?u32) nonnull_u32 = (nonnull_u32.? = 456) |
| 551 | 551 | \\(lldb) breakpoint delete --force 1 |
| 552 | 552 | \\1 breakpoints deleted; 0 breakpoint locations disabled. |
| 553 | 553 | , |
| 554 | | \\(lldb) frame variable --show-types null_u32 maybe_u32 nonnull_u32 |
| 554 | \\(lldb) frame variable --show-types -- null_u32 maybe_u32 nonnull_u32 |
| 555 | 555 | \\(?u32) null_u32 = null |
| 556 | 556 | \\(?u32) maybe_u32 = { |
| 557 | 557 | \\ (u32) maybe_u32.? = 123 |
| ... | ... | @@ -605,7 +605,7 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 605 | 605 | \\breakpoint set --file unions.zig --source-pattern-regexp '_ = unions;' |
| 606 | 606 | \\process launch |
| 607 | 607 | \\expression --show-types -- Unions |
| 608 | | \\frame variable --show-types unions |
| 608 | \\frame variable --show-types -- unions |
| 609 | 609 | \\breakpoint delete --force 1 |
| 610 | 610 | , |
| 611 | 611 | &.{ |
| ... | ... | @@ -628,7 +628,7 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 628 | 628 | \\ (@typeInfo(unions.Unions.Tagged).@"union".tag_type.?) eu = .eu |
| 629 | 629 | \\ } |
| 630 | 630 | \\} |
| 631 | | \\(lldb) frame variable --show-types unions |
| 631 | \\(lldb) frame variable --show-types -- unions |
| 632 | 632 | \\(root.unions.Unions) unions = { |
| 633 | 633 | \\ (root.unions.Unions.Untagged) untagged = { |
| 634 | 634 | \\ (u32) u32 = 3217031168 |
| ... | ... | @@ -694,17 +694,17 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 694 | 694 | }, |
| 695 | 695 | \\breakpoint set --file storage.zig --source-pattern-regexp 'local_var = local_var;' |
| 696 | 696 | \\process launch |
| 697 | | \\target variable --show-types --format hex global_const global_var global_threadlocal1 global_threadlocal2 |
| 698 | | \\frame variable --show-types --format hex param1 param2 param3 param4 param5 param6 param7 param8 local_comptime_val local_comptime_ptr.0 local_const local_var |
| 697 | \\target variable --show-types --format hex -- global_const global_var global_threadlocal1 global_threadlocal2 |
| 698 | \\frame variable --show-types --format hex -- param1 param2 param3 param4 param5 param6 param7 param8 local_comptime_val local_comptime_ptr.0 local_const local_var |
| 699 | 699 | \\breakpoint delete --force 1 |
| 700 | 700 | , |
| 701 | 701 | &.{ |
| 702 | | \\(lldb) target variable --show-types --format hex global_const global_var global_threadlocal1 global_threadlocal2 |
| 702 | \\(lldb) target variable --show-types --format hex -- global_const global_var global_threadlocal1 global_threadlocal2 |
| 703 | 703 | \\(u64) global_const = 0x19e50dc8d6002077 |
| 704 | 704 | \\(u64) global_var = 0xcc423cec08622e32 |
| 705 | 705 | \\(u64) global_threadlocal1 = 0xb4d643528c042121 |
| 706 | 706 | \\(u64) global_threadlocal2 = 0x43faea1cf5ad7a22 |
| 707 | | \\(lldb) frame variable --show-types --format hex param1 param2 param3 param4 param5 param6 param7 param8 local_comptime_val local_comptime_ptr.0 local_const local_var |
| 707 | \\(lldb) frame variable --show-types --format hex -- param1 param2 param3 param4 param5 param6 param7 param8 local_comptime_val local_comptime_ptr.0 local_const local_var |
| 708 | 708 | \\(u64) param1 = 0x6a607e08125c7e00 |
| 709 | 709 | \\(u64) param2 = 0x98944cb2a45a8b51 |
| 710 | 710 | \\(u64) param3 = 0xa320cf10601ee6fb |
| ... | ... | @@ -1305,26 +1305,95 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 1305 | 1305 | }, |
| 1306 | 1306 | \\breakpoint set --file main.zig --source-pattern-regexp 'x = fabsf\(x\);' |
| 1307 | 1307 | \\process launch |
| 1308 | | \\frame variable x |
| 1308 | \\frame variable -- x |
| 1309 | 1309 | \\breakpoint delete --force 1 |
| 1310 | 1310 | \\ |
| 1311 | 1311 | \\breakpoint set --file main.zig --source-pattern-regexp '_ = &x;' |
| 1312 | 1312 | \\process continue |
| 1313 | | \\frame variable x |
| 1313 | \\frame variable -- x |
| 1314 | 1314 | \\breakpoint delete --force 2 |
| 1315 | 1315 | , |
| 1316 | 1316 | &.{ |
| 1317 | | \\(lldb) frame variable x |
| 1317 | \\(lldb) frame variable -- x |
| 1318 | 1318 | \\(f32) x = -1234.5 |
| 1319 | 1319 | \\(lldb) breakpoint delete --force 1 |
| 1320 | 1320 | \\1 breakpoints deleted; 0 breakpoint locations disabled. |
| 1321 | 1321 | , |
| 1322 | | \\(lldb) frame variable x |
| 1322 | \\(lldb) frame variable -- x |
| 1323 | 1323 | \\(f32) x = 1234.5 |
| 1324 | 1324 | \\(lldb) breakpoint delete --force 2 |
| 1325 | 1325 | \\1 breakpoints deleted; 0 breakpoint locations disabled. |
| 1326 | 1326 | }, |
| 1327 | 1327 | ); |
| 1328 | db.addLldbTest( |
| 1329 | "hash_map", |
| 1330 | target, |
| 1331 | &.{ |
| 1332 | .{ |
| 1333 | .path = "main.zig", |
| 1334 | .source = |
| 1335 | \\const std = @import("std"); |
| 1336 | \\const Context = struct { |
| 1337 | \\ pub fn hash(_: Context, key: u32) Map.Hash { |
| 1338 | \\ return key; |
| 1339 | \\ } |
| 1340 | \\ pub fn eql(_: Context, lhs: u32, rhs: u32) bool { |
| 1341 | \\ return lhs == rhs; |
| 1342 | \\ } |
| 1343 | \\}; |
| 1344 | \\const Map = std.HashMap(u32, u32, Context, 63); |
| 1345 | \\fn testHashMap(map: Map) void { |
| 1346 | \\ _ = map; |
| 1347 | \\} |
| 1348 | \\pub fn main() !void { |
| 1349 | \\ var map = Map.init(std.heap.page_allocator); |
| 1350 | \\ defer map.deinit(); |
| 1351 | \\ try map.ensureTotalCapacity(10); |
| 1352 | \\ map.putAssumeCapacity(0, 1); |
| 1353 | \\ map.putAssumeCapacity(2, 3); |
| 1354 | \\ map.putAssumeCapacity(4, 5); |
| 1355 | \\ map.putAssumeCapacity(6, 7); |
| 1356 | \\ map.putAssumeCapacity(8, 9); |
| 1357 | \\ |
| 1358 | \\ testHashMap(map); |
| 1359 | \\} |
| 1360 | \\ |
| 1361 | , |
| 1362 | }, |
| 1363 | }, |
| 1364 | \\breakpoint set --file main.zig --source-pattern-regexp '_ = map;' |
| 1365 | \\process launch |
| 1366 | \\frame variable --show-types -- map.unmanaged |
| 1367 | \\breakpoint delete --force 1 |
| 1368 | , |
| 1369 | &.{ |
| 1370 | \\(lldb) frame variable --show-types -- map.unmanaged |
| 1371 | \\(std.hash_map.HashMapUnmanaged(u32,u32,main.Context,63)) map.unmanaged = len=5 capacity=16 { |
| 1372 | \\ (std.hash_map.HashMapUnmanaged(u32,u32,main.Context,63).KV) [0] = { |
| 1373 | \\ (u32) key = 0 |
| 1374 | \\ (u32) value = 1 |
| 1375 | \\ } |
| 1376 | \\ (std.hash_map.HashMapUnmanaged(u32,u32,main.Context,63).KV) [1] = { |
| 1377 | \\ (u32) key = 2 |
| 1378 | \\ (u32) value = 3 |
| 1379 | \\ } |
| 1380 | \\ (std.hash_map.HashMapUnmanaged(u32,u32,main.Context,63).KV) [2] = { |
| 1381 | \\ (u32) key = 4 |
| 1382 | \\ (u32) value = 5 |
| 1383 | \\ } |
| 1384 | \\ (std.hash_map.HashMapUnmanaged(u32,u32,main.Context,63).KV) [3] = { |
| 1385 | \\ (u32) key = 6 |
| 1386 | \\ (u32) value = 7 |
| 1387 | \\ } |
| 1388 | \\ (std.hash_map.HashMapUnmanaged(u32,u32,main.Context,63).KV) [4] = { |
| 1389 | \\ (u32) key = 8 |
| 1390 | \\ (u32) value = 9 |
| 1391 | \\ } |
| 1392 | \\} |
| 1393 | \\(lldb) breakpoint delete --force 1 |
| 1394 | \\1 breakpoints deleted; 0 breakpoint locations disabled. |
| 1395 | }, |
| 1396 | ); |
| 1328 | 1397 | db.addLldbTest( |
| 1329 | 1398 | "multi_array_list", |
| 1330 | 1399 | target, |
| ... | ... | @@ -1615,11 +1684,11 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void { |
| 1615 | 1684 | }, |
| 1616 | 1685 | \\breakpoint set --file main.zig --source-pattern-regexp 'testSegmentedList\(\);' |
| 1617 | 1686 | \\process launch |
| 1618 | | \\frame variable list0 list1 list2 list4 |
| 1687 | \\frame variable -- list0 list1 list2 list4 |
| 1619 | 1688 | \\breakpoint delete --force 1 |
| 1620 | 1689 | , |
| 1621 | 1690 | &.{ |
| 1622 | | \\(lldb) frame variable list0 list1 list2 list4 |
| 1691 | \\(lldb) frame variable -- list0 list1 list2 list4 |
| 1623 | 1692 | \\(std.segmented_list.SegmentedList(usize,0)) list0 = len=32 { |
| 1624 | 1693 | \\ [0] = 0 |
| 1625 | 1694 | \\ [1] = 1 |