Bug 14696

Summary: 'info var" incorrect
Product: gdb Reporter: eager
Component: gdbAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: minor CC: ssbssa
Priority: P2    
Version: HEAD   
Target Milestone: 12.1   
Host: Target:
Build: Last reconfirmed:

Description eager 2012-10-10 17:57:08 UTC
The "info var" command displays a symbol incorrectly when it is a const array of pointers.  



test.c:
int a, b;
int * const c[5] = {&a, &a, &a, &a, &a};
int const d[5] = {1, 2, 3, 4, 5};

int main(void) {
  *c[0] = 4;
// c[1] = &b;  /* Illegal assignment. */
  return 0;
}

$ gcc -g -o test test.c

$gdb test
. . .
(gdb) info var c
All variables matching regular expression "c":

File test.c:
int * constc[5];
(gdb) info var d
All variables matching regular expression "d":

File test.c:
const int d[5];
Comment 1 Hannes Domani 2023-12-31 15:26:45 UTC
Dup.

*** This bug has been marked as a duplicate of bug 28121 ***