Why your errno value isn't printing in GDB—and what to do about it

17 · Red Hat · June 5, 2024, 7:37 a.m.
Summary
When debugging a program using the GNU Project Debugger (GDB), printing the value of errno should be easy, but sometimes it isn't. This article explains why printing errno might not work and what to do when it doesn't.This article will focus on systems with runtime environments which use the GNU C Library (glibc) as the C library; printing errno on other modern multi-threaded systems which use a different C library implementation should be similar, though some of the details for accessing errno ...