Skip to content

Commit 92a0494

Browse files
authored
Update for libexecinfo crash handler change. (#12158)
* Update for libexecinfo crash handler change. * Update ThirdPartyNotices.txt
1 parent d2bd18a commit 92a0494

File tree

4 files changed

+46
-11
lines changed

4 files changed

+46
-11
lines changed

Extension/ThirdPartyNotices.txt

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ THE SOFTWARE.
17931793

17941794
---------------------------------------------------------
17951795

1796-
follow-redirects 1.15.5 - MIT
1796+
follow-redirects 1.15.6 - MIT
17971797
https://github.com/follow-redirects/follow-redirects
17981798

17991799
Copyright 2014-present Olivier Lalonde <[email protected]> , James Talmage <[email protected]> , Ruben Verborgh
@@ -3003,9 +3003,10 @@ The notices below are from non-npm sources.
30033003
- ANTLR (http://www.antlr2.org/)
30043004
- C++11 Sublime Text Snippets (https://github.com/Rapptz/cpp-sublime-snippet)
30053005
- Clang (https://clang.llvm.org/)
3006-
- gcc-9/libgcc (https://packages.ubuntu.com/focal/gcc-9-base)
3006+
- gcc-11/libgcc (https://packages.ubuntu.com/jammy/gcc-11-base)
30073007
- Guidelines Support Library (https://github.com/Microsoft/GSL)
30083008
- libc++ (https://libcxx.llvm.org/index.html)
3009+
- libexecinfo (https://github.com/ronchaine/libexecinfo)
30093010
- libuv (https://github.com/libuv/libuv)
30103011
- LLDB (https://lldb.llvm.org/)
30113012
- LLVM (http://llvm.org/)
@@ -3850,6 +3851,38 @@ obstacle to adoption, that text has been removed.
38503851
=========================================
38513852
END OF musl NOTICES AND INFORMATION
38523853

3854+
%% libexecinfo NOTICES AND INFORMATION BEGIN HERE
3855+
=========================================
3856+
libexecinfo is licensed for use as follows:
3857+
3858+
====
3859+
Copyright (c) 2003 Maxim Sobolev <[email protected]>
3860+
All rights reserved.
3861+
*
3862+
Redistribution and use in source and binary forms, with or without
3863+
modification, are permitted provided that the following conditions
3864+
are met:
3865+
1. Redistributions of source code must retain the above copyright
3866+
notice, this list of conditions and the following disclaimer.
3867+
2. Redistributions in binary form must reproduce the above copyright
3868+
notice, this list of conditions and the following disclaimer in the
3869+
documentation and/or other materials provided with the distribution.
3870+
*
3871+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
3872+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3873+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3874+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
3875+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3876+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3877+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3878+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3879+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3880+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3881+
SUCH DAMAGE.
3882+
3883+
=========================================
3884+
END OF libexecinfo NOTICES AND INFORMATION
3885+
38533886
%% libuv NOTICES AND INFORMATION BEGIN HERE
38543887
=========================================
38553888
libuv is licensed for use as follows:

Extension/src/LanguageServer/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,8 +1489,8 @@ export class DefaultClient implements Client {
14891489
}
14901490
const serverName: string = this.getName(this.rootFolder);
14911491
const serverOptions: ServerOptions = {
1492-
run: { command: serverModule, options: { detached: false } },
1493-
debug: { command: serverModule, args: [serverName], options: { detached: true } }
1492+
run: { command: serverModule, options: { detached: false, cwd: util.getExtensionFilePath("bin") } },
1493+
debug: { command: serverModule, args: [serverName], options: { detached: true, cwd: util.getExtensionFilePath("bin") } }
14941494
};
14951495

14961496
// The IntelliSense process should automatically detect when AutoPCH is

Extension/src/LanguageServer/extension.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ function reportMacCrashes(): void {
959959
}
960960

961961
export function watchForCrashes(crashDirectory: string): void {
962-
if (process.platform !== "win32") {
962+
if (process.platform !== "win32" && (process.platform === "darwin" || os.arch() === "x64")) {
963963
prevCrashFile = "";
964964
fs.stat(crashDirectory, (err) => {
965965
const crashObject: Record<string, string> = {};
@@ -1124,9 +1124,9 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, er
11241124
data = crashFile + "\n";
11251125
const filtPath: string | null = which.sync("c++filt", { nothrow: true });
11261126
const isMac: boolean = process.platform === "darwin";
1127-
const startStr: string = isMac ? " _" : "(";
1128-
const offsetStr: string = isMac ? " + " : "+0x";
1129-
const endOffsetStr: string = isMac ? " " : ")";
1127+
const startStr: string = isMac ? " _" : "<";
1128+
const offsetStr: string = isMac ? " + " : "+";
1129+
const endOffsetStr: string = isMac ? " " : " <";
11301130
const dotStr: string = "…";
11311131
data += lines[0]; // signal type
11321132
for (let lineNum: number = 2; lineNum < lines.length - 3; ++lineNum) { // skip first/last lines
@@ -1136,7 +1136,7 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, er
11361136
}
11371137
const line: string = lines[lineNum];
11381138
const startPos: number = line.indexOf(startStr);
1139-
if (startPos === -1 || line[startPos + 1] === "+") {
1139+
if (startPos === -1 || line[startPos + (isMac ? 1 : 4)] === "+") {
11401140
data += dotStr;
11411141
const startAddressPos: number = line.indexOf("0x");
11421142
const endAddressPos: number = line.indexOf(endOffsetStr, startAddressPos + 2);
@@ -1181,9 +1181,9 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, er
11811181
}
11821182
addressData += `${line.substring(startAddressPos, startPos)}`;
11831183
} else {
1184-
const endPos: number = line.indexOf(")", offsetPos2);
1184+
const endPos: number = line.indexOf(">", offsetPos2);
11851185
if (endPos === -1) {
1186-
data += "<Missing )>";
1186+
data += "<Missing > >";
11871187
continue; // unexpected
11881188
}
11891189
data += line.substring(offsetPos2, endPos);

Extension/src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ async function makeBinariesExecutable(): Promise<void> {
188188
];
189189
oldMacBinaries.forEach(binary => promises.push(util.allowExecution(util.getExtensionFilePath(binary))));
190190
}
191+
} else if (os.arch() === "x64") {
192+
promises.push(util.allowExecution(util.getExtensionFilePath("./bin/libc.so")));
191193
}
192194
}
193195
await Promise.all(promises);

0 commit comments

Comments
 (0)