gdb/dwarf: use ranged for loop in some spots

I noticed that these loops could be written to avoid the iteration
variable `i`.

Change-Id: I8b58eb9913b6ac8505ee45eb8009ef7027236cb9
2 files changed