Commit | Line | Data |
---|---|---|
e98a2d6e PP |
1 | define ctf-btr-show-stack |
2 | if (stack_empty($arg0)) | |
3 | printf "stack is empty!\n" | |
4 | else | |
5 | set $stack_size = stack_size($arg0) | |
6 | set $stack_at = (int) ($stack_size - 1) | |
7 | printf "%3s %10s %4s %3s\n", "pos", "base addr", "blen", "idx" | |
8 | ||
9 | while ($stack_at >= 0) | |
10 | set $stack_entry = (struct stack_entry *) g_ptr_array_index($arg0->entries, $stack_at) | |
11 | ||
12 | if ($stack_at == $stack_size - 1) | |
13 | printf "%3d %10p %3d %3d <-- top\n", $stack_at, \ | |
14 | $stack_entry->base_type, $stack_entry->base_len, \ | |
15 | $stack_entry->index | |
16 | else | |
17 | printf "%3d %10p %3d %3d\n", $stack_at, \ | |
18 | $stack_entry->base_type, $stack_entry->base_len, \ | |
19 | $stack_entry->index | |
20 | end | |
21 | set $stack_at = $stack_at - 1 | |
22 | end | |
23 | end | |
24 | end |