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]

documented memory map format


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

Attachment: signature.asc
Description: This is a digitally signed message part.


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