From: <ipe...@us...> - 2010-03-15 20:04:18
|
Revision: 13415 http://x10.svn.sourceforge.net/x10/?rev=13415&view=rev Author: ipeshansky Date: 2010-03-15 20:04:11 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Update to latest debug info spec. Modified Paths: -------------- trunk/x10.compiler/src/x10cpp/debug/LineNumberMap.java trunk/x10.runtime/src-cpp/x10aux/debug.h Modified: trunk/x10.compiler/src/x10cpp/debug/LineNumberMap.java =================================================================== --- trunk/x10.compiler/src/x10cpp/debug/LineNumberMap.java 2010-03-15 19:58:42 UTC (rev 13414) +++ trunk/x10.compiler/src/x10cpp/debug/LineNumberMap.java 2010-03-15 20:04:11 UTC (rev 13415) @@ -639,6 +639,45 @@ } w.writeln("};"); } + + // A meta-structure that refers to all of the above + w.write("static const struct _MetaDebugInfo_t _MetaDebugInfo __attribute__((used)) = {"); + w.newline(4); w.begin(0); + w.writeln("sizeof(struct _MetaDebugInfo_t),"); + w.writeln("X10_META_LANG,"); + w.writeln("0,"); + w.writeln("sizeof(_X10strings),"); + if (!m.isEmpty()) { + w.writeln("sizeof(_X10sourceList),"); + w.writeln("sizeof(_X10toCPPlist),"); + w.writeln("sizeof(_CPPtoX10xrefList),"); + } else { + w.writeln("0,"); + w.writeln("0,"); + w.writeln("0,"); + } + if (!m.methods.isEmpty()) { + w.writeln("sizeof(_X10methodNameList),"); + } else { + w.writeln("0,"); + } + w.writeln("_X10strings,"); + if (!m.isEmpty()) { + w.writeln("_X10sourceList,"); + w.writeln("_X10toCPPlist,"); + w.writeln("_CPPtoX10xrefList,"); + } else { + w.writeln("NULL,"); + w.writeln("NULL,"); + w.writeln("NULL,"); + } + if (!m.methods.isEmpty()) { + w.write("_X10methodNameList,"); + } else { + w.write("NULL,"); + } + w.end(); w.newline(); + w.writeln("};"); } private static String encodeIntAsChars(int i) { Modified: trunk/x10.runtime/src-cpp/x10aux/debug.h =================================================================== --- trunk/x10.runtime/src-cpp/x10aux/debug.h 2010-03-15 19:58:42 UTC (rev 13414) +++ trunk/x10.runtime/src-cpp/x10aux/debug.h 2010-03-15 20:04:11 UTC (rev 13415) @@ -38,6 +38,21 @@ // static const struct _X10methodName _X10methodNameList[] = {}; // // A list of the X10 method names. // // Sorted by X10 method name. +// static const struct _MetaDebugInfo _MetaDebugInfo __attribute__((used)) = { +// sizeof(struct _MetaDebugInfo), +// X10_META_LANG, +// sizeof(_X10strings), +// sizeof(_X10sourceList), +// sizeof(_X10toCPPlist), +// sizeof(_CPPtoX10xrefList), +// sizeof(_X10methodNameList), +// _X10strings, +// _X10sourceList, +// _X10toCPPlist, +// _CPPtoX10xrefList, +// _X10methodNameList +// }; +// // A meta-structure that refers to all of the above struct _X10sourceFile { @@ -64,10 +79,6 @@ uint32_t _CPPtoLine; // Last line number of C++ line range }; -struct _MethodSignature -{ -}; - struct _X10methodName { uint32_t _x10class; // Index of the X10 containing class name in _X10strings @@ -81,6 +92,33 @@ uint16_t _lineIndex; // Index into _X10toCPPlist of the first line of the method }; +enum _MetaLanguage { + X10_META_LANG = 0 // Metalanguage 0 is X10 +}; + +#ifndef NULL +#define NULL ((void*)0) +#endif + +struct _MetaDebugInfo_t { + unsigned short structSize; // size of this structure + unsigned char metalanguage; // language (allows the use of this technique for other languages) + unsigned char debugVersion; // version of this structure (so we can change it in future) + + // The remainder of this structure is language/version specific + unsigned x10stringSize; // the size in bytes of the string table (including the trailing NUL) + unsigned x10sourceListSize; // the size in bytes of the X10 source list + unsigned x10toCPPlistSize; // the size in bytes of the X10->C++ cross reference + unsigned cPPtoX10xrefListSize; // the size in bytes of the C++->X10 cross reference + unsigned x10methodNameListSize; // the size in bytes of the X10 method name mapping list + + const char* x10strings; // The string table + const struct _X10sourceFile* x10sourceList; // The list of X10 source files + const struct _X10toCPPxref* x10toCPPlist; // The X10->C++ cross reference + const struct _CPPtoX10xref* cPPtoX10xrefList; // The C++->X10 cross reference + const struct _X10methodName* x10methodNameList; // The method name mapping list +}; + extern void _X10_Entry_Hook(); // A hook at the start of every X10 method. extern void _X10_Exit_Hook(); // A hook at the end of every X10 method. extern void _X10_Statement_Hook(); // A hook at the start of every X10 executable statement. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |