From 9509fc86a50ad107ee4d601e917cf072f135aa5e Mon Sep 17 00:00:00 2001 From: Igor Kulaychuk Date: Wed, 27 Sep 2017 16:32:39 +0300 Subject: [GDBJIT] Provide full file names in generated DWARF (#14172) * Fix compile unit info Provide full path to source in SequencePoints for GDBJIT Use source file and directory path for compile unit info in DWARF instead of module name. * Add a class for building Directory Table and File Table * Fix code inconsistencies and add comments --- src/vm/gdbjit.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/vm/gdbjit.h') diff --git a/src/vm/gdbjit.h b/src/vm/gdbjit.h index f7267ad2a1..6cfe52c36d 100644 --- a/src/vm/gdbjit.h +++ b/src/vm/gdbjit.h @@ -340,6 +340,7 @@ class Elf_Builder; class NotifyGdb { public: + class FileTableBuilder; static void MethodPrepared(MethodDesc* methodDescPtr); static void MethodPitched(MethodDesc* methodDescPtr); template @@ -422,7 +423,7 @@ private: #ifdef FEATURE_GDBJIT_SYMTAB static bool EmitSymtab(Elf_Builder &, MethodDesc* methodDescPtr, PCODE pCode, TADDR codeSize); #endif // FEATURE_GDBJIT_SYMTAB - static bool EmitDebugInfo(Elf_Builder &, MethodDesc* methodDescPtr, PCODE pCode, TADDR codeSize, const char *szModuleFile); + static bool EmitDebugInfo(Elf_Builder &, MethodDesc* methodDescPtr, PCODE pCode, TADDR codeSize); static bool BuildSymbolTableSection(MemBuf& buf, PCODE addr, TADDR codeSize, int methodCount, NewArrayHolder &symbolNames, int symbolCount, @@ -432,14 +433,15 @@ private: static bool BuildDebugAbbrev(MemBuf& buf); static bool BuildDebugInfo(MemBuf& buf, PTK_TypeInfoMap pTypeMap, FunctionMemberPtrArrayHolder &method); static bool BuildDebugPub(MemBuf& buf, const char* name, uint32_t size, uint32_t dieOffset); - static bool BuildLineTable(MemBuf& buf, PCODE startAddr, TADDR codeSize, SymbolsInfo* lines, unsigned nlines); - static bool BuildFileTable(MemBuf& buf, SymbolsInfo* lines, unsigned nlines); + static bool BuildLineTable(MemBuf& buf, PCODE startAddr, TADDR codeSize, SymbolsInfo* lines, unsigned nlines, + const char * &cuPath); + static bool BuildFileTable(MemBuf& buf, SymbolsInfo* lines, unsigned nlines, const char * &cuPath); static bool BuildLineProg(MemBuf& buf, PCODE startAddr, TADDR codeSize, SymbolsInfo* lines, unsigned nlines); static void IssueSetAddress(char*& ptr, PCODE addr); static void IssueEndOfSequence(char*& ptr); static void IssueSimpleCommand(char*& ptr, uint8_t command); static void IssueParamCommand(char*& ptr, uint8_t command, char* param, int param_len); - static void SplitPathname(const char* path, const char*& pathName, const char*& fileName); + static const char* SplitFilename(const char* path); static bool CollectCalledMethods(CalledMethod* pCM, TADDR nativeCode, FunctionMemberPtrArrayHolder &method, NewArrayHolder &symbolNames, int &symbolCount); }; -- cgit v1.2.3