[Gd-chatter] r10827 - trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32

andreas at gwydiondylan.org andreas at gwydiondylan.org
Mon Jul 17 20:28:25 CEST 2006


Author: andreas
Date: Mon Jul 17 20:28:23 2006
New Revision: 10827

Modified:
   trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/misc_utils.c
   trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/server.c
   trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/symbol_lookup.c
Log:
job: fd

 * Make program execution work with a PATH longer than 1024 characters
 * Properly close resources in dbghelp.dll (not that it helps...)
 * removed some more debugging output

Modified: trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/misc_utils.c
==============================================================================
--- trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/misc_utils.c	(original)
+++ trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/misc_utils.c	Mon Jul 17 20:28:23 2006
@@ -466,8 +466,6 @@
   LPDBGLIBRARY  last_library;
   LPDBGLIBRARY  new_library;
 
-  debugger_message("Adding DLL: %= %=", info.lpBaseOfDll, info.hFile);
-
 
   // Create the new library first.
 
@@ -551,8 +549,6 @@
   BOOL success;
 
   if ((module == NULL) || (module->DebugType == NOT_YET_LOADED)) {
-    debugger_message("Loading debug information\n", 0, 0);
-
     module->DebugType = NONE;
     create_library_debug_map(process, module);
     pull_image_information(module);
@@ -570,7 +566,6 @@
 			0);
       if (base != 0) {
 	module->SymbolHandlerWorking = 1;
-        debugger_message("Succeeded!\n", 0, 0);
       }
 
       memset(&(module->ImagehlpModuleStruct), 0, sizeof(IMAGEHLP_MODULE64));
@@ -580,9 +575,6 @@
           SymGetModuleInfo64(process->ProcessHandle,
 		            (DWORD64) module->ImageInformation.ImageBase,
 		            &(module->ImagehlpModuleStruct));
-	if(!success) {
-          debugger_message("SymGetModuleInfo64 failed with %=\n", GetLastError(), 0);
-        }
       }
     }
   }
@@ -651,6 +643,19 @@
     break;
 
   case EXIT_PROCESS_DEBUG_EVENT:
+    if (process->SymbolHandlerWorking) {
+      LPDBGLIBRARY  module = process->LibraryList;
+
+      while (module != NULL) {
+        if (module->SymbolHandlerWorking) {
+          SymUnloadModule64(process->ProcessHandle,
+                            (DWORD64) module->ImageInformation.ImageBase);
+        }
+        module = module->Next;
+      }
+      
+      SymCleanup(process->ProcessHandle);
+    }
     break;
 
   case CREATE_THREAD_DEBUG_EVENT:

Modified: trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/server.c
==============================================================================
--- trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/server.c	(original)
+++ trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/server.c	Mon Jul 17 20:28:23 2006
@@ -19,7 +19,7 @@
 MODULED *module_enumeration_descriptor_from_base_address
     (MODULED *list, DWORD base);
 
-#define ENVIRONMENT_VARIABLE_BUFFER_SIZE 1024
+#define ENVIRONMENT_VARIABLE_BUFFER_SIZE 32768
 #define ENVIRONMENT_PATH "PATH"
 
 void extend_path_environment_variable
@@ -294,10 +294,13 @@
   char            *name_starts;
   char            *search_path = NULL;
   char            *default_extension = ".exe";
-  char            original_path_variable[ENVIRONMENT_VARIABLE_BUFFER_SIZE];
-  char            extended_path_variable[ENVIRONMENT_VARIABLE_BUFFER_SIZE];
+  char            *original_path_variable;
+  char            *extended_path_variable;
   OSVERSIONINFO   platform_data;
 
+  original_path_variable = malloc(ENVIRONMENT_VARIABLE_BUFFER_SIZE);
+  extended_path_variable = malloc(ENVIRONMENT_VARIABLE_BUFFER_SIZE);
+
   platform_data.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
   GetVersionEx(&platform_data);
   if (platform_data.dwPlatformId == VER_PLATFORM_WIN32_NT)
@@ -521,6 +524,10 @@
   process_handle->ExitProcessFunction = (TARGET_ADDRESS)NULL;
   process_handle->ExitingProcess = FALSE;
 
+  free(original_path_variable);
+  free(extended_path_variable);
+
+
   // Return it as a handle.
   return ((NUB) process_handle);
 }

Modified: trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/symbol_lookup.c
==============================================================================
--- trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/symbol_lookup.c	(original)
+++ trunk/fundev/sources/runtime-manager/debugger-nub/x86-win32/symbol_lookup.c	Mon Jul 17 20:28:23 2006
@@ -519,7 +519,7 @@
     // DbgHelp did not come through for us, so defer to bruteforce
     // methods.
 
-    debugger_message("Tried to lookup symbols for %= and failed!\n", addr, 0);
+//    debugger_message("Tried to lookup symbols for %= and failed!\n", addr, 0);
 
     module = library_descriptor_from_address (process, (DWORD) addr);
 



More information about the chatter mailing list