documented memory map format
Mike Frysinger
vapier@gentoo.org
Mon Dec 6 08:58:00 GMT 2010
i was adding support for memory maps to our jtag monitor and hit a bit of a
snag with the current documentation [1]. it describes the top level structure
of the xml file gdb expects as including a header of <xml> and <!DOCTYPE>
tags. but when the response packet includes these, gdb errors with:
(gdb) info mem
Using memory regions provided by the target.
warning: Could not parse XML memory map: XML or text declaration not at start
of entity
There are no memory regions defined.
however, as soon as i drop both of those tags (so the response starts off with
<memory-map>), everything works nicely. but the documentation [1] doesnt seem
to mention this, at least not that i can see. perhaps the xml wording implies
this someway and i'm not xml savvy enough.
also, the provided dtd [2] doesnt seem to validate xml maps that gdb itself
accepts. so is the dtd just wrong ? for example (i get this error even if i
drop the <xml> and <!DOCTYPE> tags):
$ cat test.xml
<?xml version="1.0"?>
<!DOCTYPE memory-map
PUBLIC "+//IDN gnu.org//DTD GDB Memory Map V1.0//EN"
"http://sourceware.org/gdb/gdb-memory-map.dtd">
<memory-map><memory start="0" length="1" type="ram"/></memory-map>
$ xmllint --dtdvalid gdb-memory-map.dtd test.xml
<?xml version="1.0"?>
<!DOCTYPE memory-map PUBLIC "+//IDN gnu.org//DTD GDB Memory Map V1.0//EN"
"http://sourceware.org/gdb/gdb-memory-map.dtd">
<memory-map><memory start="0" length="1" type="ram"/></memory-map>
test.xml:5: element memory: validity error : Element memory content does not
follow the DTD, expecting (property), got
Document test.xml does not validate against test.dtd
[1] http://sourceware.org/gdb/current/onlinedocs/gdb/Memory-Map-
Format.html#Memory-Map-Format
[2] http://sourceware.org/gdb/gdb-memory-map.dtd
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/gdb/attachments/20101206/f580c15a/attachment.sig>
More information about the Gdb
mailing list