mirror of
				https://github.com/vim/vim.git
				synced 2025-10-31 09:57:14 -04:00 
			
		
		
		
	runtime(termdebug): gdb file/folder check is now performed only in CWD.
closes: #15268 Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
		
				
					committed by
					
						 Christian Brabandt
						Christian Brabandt
					
				
			
			
				
	
			
			
			
						parent
						
							27f53346a3
						
					
				
				
					commit
					2736cc725d
				
			| @@ -223,6 +223,11 @@ enddef | |||||||
|  |  | ||||||
| def SanityCheck(): bool | def SanityCheck(): bool | ||||||
|   var gdb_cmd = GetCommand()[0] |   var gdb_cmd = GetCommand()[0] | ||||||
|  |   var cwd = $'{getcwd()}/' | ||||||
|  |   if exists('+shellslash') && !&shellslash | ||||||
|  |     # on windows, need to handle backslash | ||||||
|  |     cwd->substitute('\\', '/', 'g') | ||||||
|  |   endif | ||||||
|   var is_check_ok = true |   var is_check_ok = true | ||||||
|   # Need either the +terminal feature or +channel and the prompt buffer. |   # Need either the +terminal feature or +channel and the prompt buffer. | ||||||
|   # The terminal feature does not work with gdb on win32. |   # The terminal feature does not work with gdb on win32. | ||||||
| @@ -230,11 +235,11 @@ def SanityCheck(): bool | |||||||
|     err = 'Cannot debug, +channel feature is not supported' |     err = 'Cannot debug, +channel feature is not supported' | ||||||
|   elseif (way is Way.Prompt) && !exists('*prompt_setprompt') |   elseif (way is Way.Prompt) && !exists('*prompt_setprompt') | ||||||
|     err = 'Cannot debug, missing prompt buffer support' |     err = 'Cannot debug, missing prompt buffer support' | ||||||
|   elseif (way is Way.Prompt) && !empty(glob(gdb_cmd)) |   elseif (way is Way.Prompt) && !empty(glob($'{cwd}{gdb_cmd}')) | ||||||
|     err = $"You have a file/folder named '{gdb_cmd}' in the current directory Termdebug may not work properly. Please exit and rename such a file/folder." |     err = $"You have a file/folder named '{gdb_cmd}' in the current directory Termdebug may not work properly. Please exit and rename such a file/folder." | ||||||
|   elseif !empty(glob(asmbufname)) |   elseif !empty(glob($'{cwd}{asmbufname}')) | ||||||
|     err = $"You have a file/folder named '{asmbufname}' in the current directory Termdebug may not work properly. Please exit and rename such a file/folder." |     err = $"You have a file/folder named '{asmbufname}' in the current directory Termdebug may not work properly. Please exit and rename such a file/folder." | ||||||
|   elseif !empty(glob(varbufname)) |   elseif !empty(glob($'{cwd}{varbufname}')) | ||||||
|     err = $"You have a file/folder named '{varbufname}' in the current directory Termdebug may not work properly. Please exit and rename such a file/folder." |     err = $"You have a file/folder named '{varbufname}' in the current directory Termdebug may not work properly. Please exit and rename such a file/folder." | ||||||
|   elseif !executable(gdb_cmd) |   elseif !executable(gdb_cmd) | ||||||
|     err = $"Cannot execute debugger program '{gdb_cmd}'" |     err = $"Cannot execute debugger program '{gdb_cmd}'" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user