参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke

结论:对齐 LinuxCNC tooldata_nml.cc 与 tooldata_db.cc 的失败诊断输出,收紧 WASM tooldata link probe;未扩展临时 smoke 行为。
This commit is contained in:
cnc
2026-06-03 21:19:24 +08:00
parent feb04102e7
commit 945e839e9d
2 changed files with 14 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
#include "tooldata.hh" #include "tooldata.hh"
#include <cstdio>
#include <cstring> #include <cstring>
#include <unistd.h> #include <unistd.h>
@@ -15,7 +16,11 @@ bool db_live = false;
extern "C" { extern "C" {
int tool_nml_register(CANON_TOOL_TABLE *tblptr) { int tool_nml_register(CANON_TOOL_TABLE *tblptr) {
return tblptr ? 0 : -1; if (!tblptr) {
std::fprintf(stderr, "%5d!!!PROBLEM tool_nml_register()\n", getpid());
return -1;
}
return 0;
} }
int tooldata_db_init(char progname_plus_args[], int) { int tooldata_db_init(char progname_plus_args[], int) {
@@ -29,10 +34,14 @@ int tooldata_db_init(char progname_plus_args[], int) {
for (char *token = program; token; token = strtok_r(nullptr, " ", &saveptr)) { for (char *token = program; token; token = strtok_r(nullptr, " ", &saveptr)) {
++argc; ++argc;
if (argc >= MAX_DB_PROGRAM_ARGS) { if (argc >= MAX_DB_PROGRAM_ARGS) {
std::fprintf(stderr,
"!!!!db_init: argc exceeds MAX_DB_PROGRAM_ARGS=%d\n",
MAX_DB_PROGRAM_ARGS);
return -1; return -1;
} }
} }
if (!program || access(program, X_OK) != 0) { if (!program || access(program, X_OK) != 0) {
std::fprintf(stderr, "!!!!db_init: <%s> not executable\n", program ? program : "");
return -1; return -1;
} }
return -1; return -1;

View File

@@ -11,5 +11,9 @@ probe=$(./build-linuxcnc-wasm-standalone-probe.sh --mode tooldata-link)
"$probe" 2>"$probe.err" "$probe" 2>"$probe.err"
grep -F "tool_mmap_user(): tool mmap not available" "$probe.err" >/dev/null grep -F "tool_mmap_user(): tool mmap not available" "$probe.err" >/dev/null
grep -F "tooldata_put() no tool_mmap_base" "$probe.err" >/dev/null grep -F "tooldata_put() no tool_mmap_base" "$probe.err" >/dev/null
grep -F "!!!PROBLEM tool_nml_register()" "$probe.err" >/dev/null
grep -F "!!!!db_init: <" "$probe.err" >/dev/null
grep -F "not executable" "$probe.err" >/dev/null
grep -F "!!!!db_init: argc exceeds MAX_DB_PROGRAM_ARGS=10" "$probe.err" >/dev/null
echo "linuxcnc wasm tooldata shim link probe passed" echo "linuxcnc wasm tooldata shim link probe passed"