+++ This bug was initially created as a clone of Bug #185337 +++ Description of problem: I compiled a simple test program, started gdb on it, set a breakpoint, started my program, and after it hit the breakpoint, attempted to "p errno". Instead of printing the value of errno, gdb said "Cannot access memory at address 0x8" Version-Release number of selected component (if applicable): gdb-6.3.0.0-1.96 How reproducible: Always. Steps to Reproduce: 1.Compile the attached program with gcc -o convert -g convert.c 2.gdb convert 3.b 59 4.run utf8 cp850 foobarbaz 5.p errno Actual results: Cannot access memory at address 0x8 Expected results: $1 = 0 Additional info: This works on RHEL3, hence regression. -- Additional comment from fenlason on 2006-03-13 15:26 EST -- Created an attachment (id=126068) source for simple test program -- Additional comment from fenlason on 2006-03-14 15:33 EST -- This is also broken in rawhide with gdb-6.3.0.0-1.122 -- Additional comment from jan.kratochvil on 2006-07-25 08:30 EST -- Please retest if compiled with -ggdb3: gcc -o convert -ggdb3 convert.c -ggdb3 -ggdb2 FC5 gdb OK Cannot find thread-local variables CVS gdb OK Cannot access memory at address 0x8 FC4 gdb OK Cannot access memory at address 0x8 As it is fixed by on of the Red Hat vendor patches, suggesting to extend the error message by: ", try gcc -ggdb3"
Bug 185337 is resolving it the proper way - by TLS decoding. "-ggdb3" suggestion is a wrong workaround (too expensive and not applicable to all the TLS symbols).