Re: Viewing the address of an array in gdb

"Mahmood Naderan via gdb" <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
Yes you are right. It picked the glibc symbol name "buffer". 
No matters. I will change the name. I thought there is something wrong with the buffer I defined.
Thank you very much.


Regards,
Mahmood 




    On Friday, July 6, 2018, 4:36:41 PM GMT+4:30, Pedro Alves <[email protected]> wrote: 
If you can't change the program, you can work around this by
unloading the shared library symbols, so that gdb sees the
program's symbol again.  E.g.:

(gdb) start
Temporary breakpoint 1 at 0x40048b
Starting program: /home/pedro/tmp/buffer 

Temporary breakpoint 1, 0x000000000040048b in main ()
(gdb) info symbol &buffer
buffer in section .bss of /lib64/libc.so.6
(gdb) nosharedlibrary 
(gdb) info symbol &buffer
buffer in section .bss
(gdb) x /30x  &buffer
0x601040 <buffer>:      0x00000000      0x00000000      0x00000000      0x00000000
0x601050 <buffer+16>:  0x00000000      0x00000000      0x00000000      0x00000000
0x601060 <buffer+32>:  0x00000000      0x00000000      0x00000000      0x00000000
0x601070 <buffer+48>:  0x00000000      0x00000000      0x00000000      0x00000000
0x601080 <buffer+64>:  0x00000000      0x00000000      0x00000000      0x00000000
0x601090 <buffer+80>:  0x00000000      0x00000000      0x00000000      0x00000000
0x6010a0 <buffer+96>:  0x00000000      0x00000000      0x00000000      0x00000000
0x6010b0:      0x00000000      0x00000000
(gdb) 

Thanks,
Pedro Alves
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.