A while back we were given a nios2-elf executable that caused GDB to segfault while reading its debug information. The binary turned out to have invalid DWARF-2 information in the .debug_line section: although the file name table had references to entries in the directory table, the directory table itself was empty. The executable was produced by some very old version of GCC (4.1.2?), and we verified that more current toolchain versions don't produce such bad debug information any more. But, since it's generally a bad thing for GDB to segfault, here is a patch that makes the DWARF-2 reader more robust by making sure the directory table is non-NULL before trying to access entries in it. OK to commit? -Sandra