Bläddra i källkod

Added back the "wantsDIForwardDecl = false" for LLVM

Not having this extra type information was causing types like enums to come out as 'void' in debug information due to (seemingly) an LLVM bug with forward decls
Brian Fiete 5 år sedan
förälder
incheckning
939c818581
3 ändrade filer med 18 tillägg och 7 borttagningar
  1. 4 3
      IDEHelper/Compiler/BfIRBuilder.cpp
  2. 13 3
      IDEHelper/DbgModule.cpp
  3. 1 1
      IDEHelper/Debugger.cpp

+ 4 - 3
IDEHelper/Compiler/BfIRBuilder.cpp

@@ -1887,9 +1887,10 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine)
 			
 			
 	// Types that don't have a proper 'defining module' need to be defined in every module they are used	
 	// Types that don't have a proper 'defining module' need to be defined in every module they are used	
 	bool wantsDIForwardDecl = (type->GetModule() != mModule) && (!type->IsFunction());
 	bool wantsDIForwardDecl = (type->GetModule() != mModule) && (!type->IsFunction());
-	// Forward declarations of valuetypes doesn't work in LLVM backend for Win32.....
-//  	if ((!mIsBeefBackend) && (type->IsValueType()))
-//  		wantsDIForwardDecl = false;
+	// Forward declarations of valuetypes don't work in LLVM backend for Win32.....
+	//TODO: Why was this commented out?
+  	if ((!mIsBeefBackend) && (type->IsValueType()))
+  		wantsDIForwardDecl = false;
 	if (mModule->mExtensionCount != 0)
 	if (mModule->mExtensionCount != 0)
 		wantsDIForwardDecl = true;
 		wantsDIForwardDecl = true;
 	if (forceDbgDefine)
 	if (forceDbgDefine)

+ 13 - 3
IDEHelper/DbgModule.cpp

@@ -1663,8 +1663,7 @@ void DbgType::ToString(StringImpl& str, DbgLanguage language, bool allowDirectBf
 			}
 			}
 			return;
 			return;
 		}
 		}
-
-		char* nameP = (char*)mTypeName;
+		
 		//String combName;
 		//String combName;
 		/*if (mTemplateParams != NULL)
 		/*if (mTemplateParams != NULL)
 		{
 		{
@@ -1677,6 +1676,7 @@ void DbgType::ToString(StringImpl& str, DbgLanguage language, bool allowDirectBf
 		{
 		{
 			FixName();
 			FixName();
 		}		
 		}		
+		char* nameP = (char*)mTypeName;
 
 
 		if (parent == NULL)
 		if (parent == NULL)
 		{
 		{
@@ -2285,7 +2285,17 @@ void DbgModule::Fail(const StringImpl& error)
 			*mFailMsgPtr = error;
 			*mFailMsgPtr = error;
 	}
 	}
 
 
-	mDebugger->OutputRawMessage("error " + error + "\n");
+	String errorStr = "error ";
+	if (!mFilePath.IsEmpty())
+	{
+		errorStr += "Error in ";
+		errorStr += mFilePath;
+		errorStr += ": ";
+	}
+	errorStr += error;	
+	errorStr += "\n";
+
+	mDebugger->OutputRawMessage(errorStr);
 	mFailed = true;
 	mFailed = true;
 }
 }
 
 

+ 1 - 1
IDEHelper/Debugger.cpp

@@ -5,7 +5,7 @@
 USING_NS_BF;
 USING_NS_BF;
 
 
 DbgModuleMemoryCache::DbgModuleMemoryCache(uintptr addr, int size)
 DbgModuleMemoryCache::DbgModuleMemoryCache(uintptr addr, int size)
-{
+{	
 	mAddr = addr;
 	mAddr = addr;
 	mSize = size;
 	mSize = size;