code: def get_memory_map_xml(self):
          
          root = ElementTree.Element('memory-map')
          for r in  self._context.core.memory_map:
              # Look up the region type name. Regions default to ram if gdb doesn't
              # have a concept of the region type.
              gdbType = GDB_TYPE_MAP.get(r.type, 'ram')
              
              start = hex(r.start).rstrip("L")
              length = hex(r.length).rstrip("L")
              mem = ElementTree.SubElement(root, 'memory', type=gdbType, start=start, length=length)
              if r.is_flash:
                  prop = ElementTree.SubElement(mem, 'property', name='blocksize')
                  prop.text = hex(r.blocksize).rstrip("L")
          return MAP_XML_HEADER + ElementTree.tostring(root)
docs: ! @brief Generate GDB memory map XML.