Bug 14696 - 'info var" incorrect
Summary: 'info var" incorrect
Status: RESOLVED DUPLICATE of bug 28121
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 minor
Target Milestone: 12.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-10 17:57 UTC by eager
Modified: 2023-12-31 15:26 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***