gdb/dwarf: use ranged for loop in some pots

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

Change-Id: Ia3717acbbf732f0337870d35ac60fe6400383324
2 files changed