This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/18436] Can't print dynamically allocated global array


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]