avatartwo / avatar2

Python core of avatar²
Apache License 2.0
518 stars 98 forks source link

fixing a parsing error #115

Closed kindtrojan closed 1 year ago

kindtrojan commented 1 year ago

The parsing assumes a 4 line header, which is removed and assumes to blank line. However, it appears to have blank lines in the output, which causes index out of range errors. Solution: 1) splitting on the last part of the header "objfile" to remove unwanted header lines, and then ignoring the blank lines while parsing.

The output to be parsed:

 process 502

 Mapped address spaces:

          Start Addr           End Addr       Size     Offset objfile

            0x400000           0x401000     0x1000        0x0 /tests/a.out

      0x7ffe1723f000     0x7ffe17260000    0x21000        0x0 [stack]

      0x7ffe1735c000     0x7ffe17360000     0x4000        0x0 [vvar]

      0x7ffe17360000     0x7ffe17362000     0x2000        0x0 [vdso]

      0xffffffffff600000 0xffffffffff601000     0x1000        0x0 [vsyscall]