This is the mail archive of the gdb@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]

GDB segfaults while reading memory 0 with MI


Hi,

with HEAD I'm getting a segfault when reading memory from location 0
using MI
-data-read-memory 0 x 1 1 320 causes it
while
x 0 
works.

Session below.

I'm running Ubuntu in a virtual machine.

Looks like the culprit (although I don't understand anything about it)
is target.c::memory_xfer_partial when it calls
 if (ops->to_has_all_memory (ops))
because the method to_has_all_memory() is void.

There were recent changes in this code.

Let me know if I should open a bugzilla.

Thanks

Marc


~"GNU gdb (GDB) 6.8.50.20090612-cvs\n"
~"Copyright (C) 2009 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>\n"
~"This is free software: you are free to change and redistribute it.\n"
~"There is NO WARRANTY, to the extent permitted by law.  Type \"show
copying\"\n"
~"and \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-linux-gnu\".\n"
~"For bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>...\n"
(gdb) 
start
&"start\n"
~"Temporary breakpoint 1 at 0x80483fd: file b.cc, line 9.\n"
~"Starting program: /home/marc/testing/a.out \n"
=thread-group-created,id="20660"
=thread-created,id="1",group-id="20660"
^running
*running,thread-id="all"
(gdb) 
=library-loaded,id="/lib/ld-linux.so.2",target-name="/lib/ld-linux.so.2"
,host-name="/lib/ld-linux.so.2",symbols-loaded="0"
=library-loaded,id="/usr/lib/libstdc++.so.6",target-name="/usr/lib/libst
dc++.so.6",host-name="/usr/lib/libstdc++.so.6",symbols-loaded="0"
=library-loaded,id="/lib/tls/i686/cmov/libm.so.6",target-name="/lib/tls/
i686/cmov/libm.so.6",host-name="/lib/tls/i686/cmov/libm.so.6",symbols-lo
aded="0"
=library-loaded,id="/lib/libgcc_s.so.1",target-name="/lib/libgcc_s.so.1"
,host-name="/lib/libgcc_s.so.1",symbols-loaded="0"
=library-loaded,id="/lib/tls/i686/cmov/libc.so.6",target-name="/lib/tls/
i686/cmov/libc.so.6",host-name="/lib/tls/i686/cmov/libc.so.6",symbols-lo
aded="0"
~"\n"
~"Temporary breakpoint 1, main () at b.cc:9\n"
~"9\t          int a = 0;\n"
*stopped,frame={addr="0x080483fd",func="main",args=[],file="b.cc",fullna
me="/home/marc/testing/b.cc",line="9"},thread-id="1",stopped-threads="al
l"
(gdb) 
x 0
&"x 0\n"
~"0x0:\t"
&"Cannot access memory at address 0x0\n"
^error,msg="Cannot access memory at address 0x0"
(gdb) 
-data-read-memory 0 x 1 1 320
Segmentation fault


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