[Converted from Gnats 11] Basically, i386-unknown-OpenBSD uses the same configuration as i386-unknown-netbsd. Both are a.out platforms, with pic code working. gdb is utterly unable to debug pic code. Trying to advance line by line invariably ends up in _GLOBAL_OFFSET_TABLE_ instead of the right function. This makes debugging pic code next to impossible. We found out about this when we switched libgcc to -fpic. This might be fixable at gcc's level, I don't know. Similar problems occur with m68k and sparc. It looks like gdb is completely lost when it comes to debugging a.out pic code. _GLOBAL_OFFSET_TABLE_ makes it lose its way. Release: GDB 5.0 Environment: i386-unknown-OpenBSD (a.out platforms in general) How-To-Repeat: Attached is a simple archive which holds a simple source file, the corresponding assembly output, and a sample gdb session... (compiled with gcc -save-temps -g -O2 -fpic). Problem is happening with gdb 4.16.1 (bundled with OpenBSD) and reproducible with more recent gdb releases (such as 5.0).
Fix: No idea. It seems that process() doesn't stop where it should. The determination of current pc address and corresponding range looks sane.