# HG changeset patch
# User laurent
# Date 1305539886 -7200
# Node ID d0e3fc4b9951e9f0b50819d0ec90de5bc46bacae
# Parent  c7be4d09c5f490c4a29ec3af9195343ea58ebaef
Fix bug when debugging located variables of type memory (%M)

diff -r c7be4d09c5f4 -r d0e3fc4b9951 plugger.py
--- a/plugger.py	Thu Apr 21 12:35:27 2011 +0200
+++ b/plugger.py	Mon May 16 11:58:06 2011 +0200
@@ -1320,12 +1320,14 @@
            "extern_variables_declarations":"\n".join([
               {"EXT":"extern __IEC_%(type)s_p %(C_path)s;",
                "IN":"extern __IEC_%(type)s_p %(C_path)s;",
+               "MEM":"extern __IEC_%(type)s_p %(C_path)s;",
                "OUT":"extern __IEC_%(type)s_p %(C_path)s;",
                "VAR":"extern __IEC_%(type)s_t %(C_path)s;"}[v["vartype"]]%v 
                for v in self._VariablesList if v["vartype"] != "FB" and v["C_path"].find('.')<0]),
            "for_each_variable_do_code":"\n".join([
                {"EXT":"    (*fp)((void*)&%(C_path)s,%(type)s_P_ENUM);\n",
                 "IN":"    (*fp)((void*)&%(C_path)s,%(type)s_P_ENUM);\n",
+                "MEM":"    (*fp)((void*)&%(C_path)s,%(type)s_P_ENUM);\n",
                 "OUT":"    (*fp)((void*)&%(C_path)s,%(type)s_O_ENUM);\n",
                 "VAR":"    (*fp)((void*)&%(C_path)s,%(type)s_ENUM);\n"}[v["vartype"]]%v
                 for v in self._VariablesList if v["vartype"] != "FB" and v["type"] in DebugTypesSize ]),
@@ -1334,6 +1336,7 @@
                "        *varp = (void*)&%(C_path)s;\n"%v+
                {"EXT":"        return %(type)s_P_ENUM;\n",
                 "IN":"        return %(type)s_P_ENUM;\n",
+                "MEM":"        return %(type)s_P_ENUM;\n",
                 "OUT":"        return %(type)s_O_ENUM;\n",
                 "VAR":"        return %(type)s_ENUM;\n"}[v["vartype"]]%v
                 for v in self._VariablesList if v["vartype"] != "FB" and v["type"] in DebugTypesSize ])}