| 1 | define ctf-notif-iter-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 %3s\n", "pos", "base addr", "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 <-- top\n", $stack_at, \ |
| 14 | $stack_entry->base, $stack_entry->index |
| 15 | else |
| 16 | printf "%3d %10p %3d\n", $stack_at, \ |
| 17 | $stack_entry->base, $stack_entry->index |
| 18 | end |
| 19 | set $stack_at = $stack_at - 1 |
| 20 | end |
| 21 | end |
| 22 | end |