@@ -55,6 +55,10 @@ const targetAsset = assets.targets?.[targetPlatform];
5555const configuredDebuggerPath = resolveConfiguredPath ( process . env . NETCOREDBG_PATH ) ;
5656const configuredLicensePath = resolveConfiguredPath ( process . env . NETCOREDBG_LICENSE ) ;
5757const defaultExeName = targetPlatform . startsWith ( 'win32' ) ? 'netcoredbg.exe' : 'netcoredbg' ;
58+ const requiredCompanion =
59+ targetPlatform . startsWith ( 'linux' ) ? 'libdbgshim.so'
60+ : targetPlatform . startsWith ( 'darwin' ) ? 'libdbgshim.dylib'
61+ : '' ;
5862const targetDir = path . join ( extensionRoot , '.debugger' ) ;
5963const targetExe = path . join ( targetDir , defaultExeName ) ;
6064const targetLicense = path . join ( targetDir , 'LICENSE.netcoredbg' ) ;
@@ -87,6 +91,13 @@ const findNetcoredbg = (root, exeName) => {
8791 return '' ;
8892} ;
8993
94+ const hasRequiredCompanion = ( root ) => {
95+ if ( ! requiredCompanion ) {
96+ return true ;
97+ }
98+ return fs . existsSync ( path . join ( root , requiredCompanion ) ) ;
99+ } ;
100+
90101const downloadFile = ( url , destination ) =>
91102 new Promise ( ( resolve , reject ) => {
92103 const request = ( currentUrl ) => {
@@ -139,7 +150,13 @@ const resolveSourceExe = async () => {
139150
140151 const localCandidate = path . join ( sourceDir , defaultExeName ) ;
141152 if ( fs . existsSync ( localCandidate ) ) {
142- return localCandidate ;
153+ if ( ! hasRequiredCompanion ( path . dirname ( localCandidate ) ) ) {
154+ console . warn (
155+ `Local netcoredbg at ${ localCandidate } is missing ${ requiredCompanion } ; downloading target asset instead.`
156+ ) ;
157+ } else {
158+ return localCandidate ;
159+ }
143160 }
144161
145162 if ( ! targetAsset ?. url ) {
0 commit comments