# elf: implement slice types in debug info · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/4192be84039cfac9ec458dc42370f67d700bd8ed)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 4192be84039cfac9ec458dc42370f67d700bd8ed

Requested commit: 4192be84039cfac9ec458dc42370f67d700bd8ed

Commit: 4192be84039cfac9ec458dc42370f67d700bd8ed

Tree: 0cd4faa2a22d76730ebcc008cfc6e232957aef49

Author: Jakub Konka

Committer: Jakub Konka

## Message

````
elf: implement slice types in debug info

Implements slice types including `[]const u8` for passing as
formal parameters in DWARF. Breaking on a function accepting
a slice in `gdb` will now yield the same behavior as stage1 and/or
LLVM backend:

```zig
fn sumArrayLens(a: []const u32, b: []const u8) usize {
  return a.len + b.len;
}
```

Both `a` and `b` can now be inspected in the debugger:

```
Breakpoint 1, sumArrayLens (a=..., b=...) at arr.zig:59
(gdb) p a
$1 = {ptr = 0x7fffffff685c, len = 5}
(gdb) p b
$2 = {ptr = 0x7fffffff683d "\252\252\252\\h\377\377\377\177", len = 3}
(gdb)
```

````

## Parents

- [aa4eaea778d090e7f0fde74409106d02c075d1ec](https://git.cafe/gitcafe/zig/commit/aa4eaea778d090e7f0fde74409106d02c075d1ec?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/4192be84039cfac9ec458dc42370f67d700bd8ed?format=markdown)
