Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Marc Khouzam" <marc.khouzam@ericsson.com>
To: <gdb@sourceware.org>
Subject: GDB segfaults while reading memory 0 with MI
Date: Tue, 16 Jun 2009 15:53:00 -0000	[thread overview]
Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA07976B99@ecamlmw720.eamcs.ericsson.se> (raw)

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


             reply	other threads:[~2009-06-16 15:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16 15:53 Marc Khouzam [this message]
2009-06-16 18:31 ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6D19CA8D71C89C43A057926FE0D4ADAA07976B99@ecamlmw720.eamcs.ericsson.se \
    --to=marc.khouzam@ericsson.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox