libdebugger: Fix a regression with ELF loading in some cases.hrev50744
commit7cfc043e00a07b46a7bccc56b9475b1be54b8dae
authorRene Gollent <rene@gollent.com>
Thu, 8 Dec 2016 03:12:10 +0000 (7 22:12 -0500)
committerRene Gollent <rene@gollent.com>
Thu, 8 Dec 2016 03:17:34 +0000 (7 22:17 -0500)
tree985219b46dfa47ce908407dd4191de4d48ef28e1
parent245304f1413e76fdd53c6b03a95e360ce3b40513
libdebugger: Fix a regression with ELF loading in some cases.

ElfFile:
- The refactoring in commit 2c50fbb8e16102886d0cd28135dae0b58b9d33f4
  inadvertently introduced a failure case if a section in the ELF file
  is skipped, since it was explicitly passing in the insertion index
  to BObjectList::AddItem(). Since in the skipped case, this would be
  out of bounds for the list's current size, this would cause the whole
  operation to fail with an out of memory error, and consequently halt
  all further loading of debug information for that particular file.
  This manifested itself with libroot on at least gcc5, where no symbols
  could be seen.
src/kits/debugger/elf/ElfFile.cpp