test(basecamp): recognize bundled Linux host binaries

This commit is contained in:
danisharora099
2026-08-05 00:44:56 +05:30
parent 40c2caef46
commit 7a7481e499
+6 -1
View File
@@ -70,7 +70,12 @@ function formatProcessTree(rootPid) {
function moduleCommand(rows, executable, moduleName) {
const escaped = moduleName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
const expression = new RegExp(`(?:^|/)${executable}(?:\\s|$).*--name(?:=|\\s+)${escaped}(?:\\s|$)`);
const escapedExecutable = executable.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
// Bundle wrappers use the public executable name, while Linux process
// command lines expose the wrapped ELF basename (for example,
// `.logos_host.elf`). Both are the same Basecamp-owned host path.
const executableBasename = `(?:${escapedExecutable}|\\.${escapedExecutable}\\.elf)`;
const expression = new RegExp(`(?:^|/)${executableBasename}(?:\\s|$).*--name(?:=|\\s+)${escaped}(?:\\s|$)`);
return rows.find((row) => expression.test(row.command));
}