This patch is to allow setting how auto-displays are affected when memory is not accessible. It's very common to, when single-stepping, or stepping over, initially setup some auto-displays and then begin stepping. I don't see any reason why, in the event an object is not accessible, the auto-display should be disabled. I know that the actual error is "To prevent infinite recursion" but I'm not finding how that will happen based on the already present code. Is it something from the past? Basically, it does the following: (gdb) b main Breakpoint 1 at 0x8048371: file null.c, line 5. (gdb) r Breakpoint 1, main () at null.c:5 5 char buf[][64] = { "foo", "bar" }; (gdb) set display strict off (gdb) disp q (gdb) disp *q (gdb) n 6 char *q = NULL; 2: *q = -115 '\215' 1: q = 0x8048426 "\215\203 ÿÿÿ\215" (gdb) 8 q = NULL; 2: *q = Cannot access memory at address 0x0 1: q = 0x0 (gdb) 9 q = buf[0]; 2: *q = Cannot access memory at address 0x0 1: q = 0x0 (gdb) 10 q = buf[1]; 2: *q = 102 'f' 1: q = 0xbfeec3fc "foo" (gdb) 11 q = (void *)0xDEAD; 2: *q = 98 'b' 1: q = 0xbfeec43c "bar" (gdb) 13 return 0; 2: *q = Cannot access memory at address 0xdead 1: q = 0xdead
(gdb) Additionally, in the exercising of implementing it, it also fixes a "bug" where if a display is disabled, as per default behavior, the rest of the valid displays will still be displayed. Previously things would just stop at the first exception caught. (gdb) set display strict on (gdb) n 8 q = NULL; Disabling display 2 to avoid infinite recursion. 2: *q = Cannot access memory at address 0x0 1: q = 0x0 gdb/ChangeLog: 2007-03-30 Christopher Layne