This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/18436] Can't print dynamically allocated global array
- From: "stanton at haas dot berkeley.edu" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Wed, 20 May 2015 20:16:20 +0000
- Subject: [Bug gdb/18436] Can't print dynamically allocated global array
- Auto-submitted: auto-generated
- References: <bug-18436-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=18436
--- Comment #9 from stanton at haas dot berkeley.edu ---
I just noticed something odd. Using gcc 5.1 and gdb 7.7.1 (both MacPorts), I
can inspect v[0] fine if I compile like this:
gcc -g main.c -o main
It fails if I compile the same program (same gcc, some gdb) like this:
gcc -g -c -o main.o main.c
gcc -o main main.o
Any idea why this should be different?
> On May 20, 2015, at 11:17 AM, Richard Stanton <stanton@haas.berkeley.edu> wrote:
>
> Unfortunately, the workaround below doesnât work on my system:
>
> (gdb) print vec[0]
> cannot subscript something of type `<data variable, no debug info>'
> (gdb) print ((double*)vec)[0]
> Cannot access memory at address 0x200000
>
> I just installed MacPorts gcc 5.1.0, and also hand-compiled gdb 7.9.1. It didnât help.
>
>
--
You are receiving this mail because:
You are on the CC list for the bug.