refactor(vm): use crate tracing
This commit is contained in:
parent
51438c5568
commit
a7c2068b01
130
Cargo.lock
generated
130
Cargo.lock
generated
|
@ -2,6 +2,15 @@
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ansi_term"
|
||||||
|
version = "0.12.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
|
||||||
|
dependencies = [
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "atty"
|
name = "atty"
|
||||||
version = "0.2.14"
|
version = "0.2.14"
|
||||||
|
@ -37,6 +46,12 @@ version = "0.1.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cfg-if"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "3.2.22"
|
version = "3.2.22"
|
||||||
|
@ -89,6 +104,8 @@ dependencies = [
|
||||||
"fogtix-bytecode",
|
"fogtix-bytecode",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"readfilez",
|
"readfilez",
|
||||||
|
"tracing",
|
||||||
|
"tracing-subscriber",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -122,7 +139,7 @@ version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2b1428b2b1abe959e6eedb0a17d0ab12f6ba20e1106cc29fc4874e3ba393c177"
|
checksum = "2b1428b2b1abe959e6eedb0a17d0ab12f6ba20e1106cc29fc4874e3ba393c177"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if 0.1.10",
|
||||||
"int-enum-impl",
|
"int-enum-impl",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -132,19 +149,34 @@ version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a2c3cecaad8ca1a5020843500c696de2b9a07b63b624ddeef91f85f9bafb3671"
|
checksum = "a2c3cecaad8ca1a5020843500c696de2b9a07b63b624ddeef91f85f9bafb3671"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if 0.1.10",
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lazy_static"
|
||||||
|
version = "1.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.133"
|
version = "0.2.133"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966"
|
checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "log"
|
||||||
|
version = "0.4.17"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memmap2"
|
name = "memmap2"
|
||||||
version = "0.2.3"
|
version = "0.2.3"
|
||||||
|
@ -175,6 +207,12 @@ version = "6.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff"
|
checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pin-project-lite"
|
||||||
|
version = "0.2.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ppv-lite86"
|
name = "ppv-lite86"
|
||||||
version = "0.2.16"
|
version = "0.2.16"
|
||||||
|
@ -272,12 +310,27 @@ version = "1.0.145"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b"
|
checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sharded-slab"
|
||||||
|
version = "0.1.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "siphasher"
|
name = "siphasher"
|
||||||
version = "0.3.10"
|
version = "0.3.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
|
checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "smallvec"
|
||||||
|
version = "1.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strsim"
|
name = "strsim"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
|
@ -310,6 +363,15 @@ version = "0.15.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16"
|
checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thread_local"
|
||||||
|
version = "1.1.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml"
|
name = "toml"
|
||||||
version = "0.5.9"
|
version = "0.5.9"
|
||||||
|
@ -319,12 +381,76 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tracing"
|
||||||
|
version = "0.1.36"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
"pin-project-lite",
|
||||||
|
"tracing-attributes",
|
||||||
|
"tracing-core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tracing-attributes"
|
||||||
|
version = "0.1.22"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tracing-core"
|
||||||
|
version = "0.1.29"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
"valuable",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tracing-log"
|
||||||
|
version = "0.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static",
|
||||||
|
"log",
|
||||||
|
"tracing-core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tracing-subscriber"
|
||||||
|
version = "0.3.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "60db860322da191b40952ad9affe65ea23e7dd6a5c442c2c42865810c6ab8e6b"
|
||||||
|
dependencies = [
|
||||||
|
"ansi_term",
|
||||||
|
"sharded-slab",
|
||||||
|
"smallvec",
|
||||||
|
"thread_local",
|
||||||
|
"tracing-core",
|
||||||
|
"tracing-log",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd"
|
checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "valuable"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi"
|
name = "winapi"
|
||||||
version = "0.3.9"
|
version = "0.3.9"
|
||||||
|
|
|
@ -8,6 +8,8 @@ publish = false
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "3.2"
|
clap = "3.2"
|
||||||
readfilez = "0.2"
|
readfilez = "0.2"
|
||||||
|
tracing = "0.1"
|
||||||
|
tracing-subscriber = "0.3"
|
||||||
|
|
||||||
[dependencies.fogtix-bytecode]
|
[dependencies.fogtix-bytecode]
|
||||||
path = "../fogtix-bytecode"
|
path = "../fogtix-bytecode"
|
||||||
|
|
|
@ -67,8 +67,8 @@ impl Process {
|
||||||
let previptr = self.instrp.1;
|
let previptr = self.instrp.1;
|
||||||
let nxti_arr = match self.instrp.0.h.get(previptr..) {
|
let nxti_arr = match self.instrp.0.h.get(previptr..) {
|
||||||
None => {
|
None => {
|
||||||
eprintln!(
|
tracing::error!(
|
||||||
"ERROR: reached EOF of module or jumped out of bounds -> {}",
|
"reached EOF of module or jumped out of bounds -> {}",
|
||||||
previptr
|
previptr
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
@ -77,8 +77,8 @@ impl Process {
|
||||||
};
|
};
|
||||||
let (nxtiptr, nxti) = match Instr::parse(nxti_arr) {
|
let (nxtiptr, nxti) = match Instr::parse(nxti_arr) {
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
eprintln!(
|
tracing::error!(
|
||||||
"ERROR: reached unparsable instruction {:?} @ {}",
|
"reached unparsable instruction {:?} @ {}",
|
||||||
&nxti_arr[..core::cmp::min(nxti_arr.len(), 20)],
|
&nxti_arr[..core::cmp::min(nxti_arr.len(), 20)],
|
||||||
self.instrp.1
|
self.instrp.1
|
||||||
);
|
);
|
||||||
|
@ -102,7 +102,7 @@ impl Process {
|
||||||
}
|
}
|
||||||
match self.stack.pop() {
|
match self.stack.pop() {
|
||||||
None => {
|
None => {
|
||||||
eprintln!("ERROR: `call-r` invoked on empty stack @ {}", previptr);
|
tracing::error!("`call-r` invoked on empty stack @ {}", previptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Some(StackEntValue::Pointer(wp)) => {
|
Some(StackEntValue::Pointer(wp)) => {
|
||||||
|
@ -112,9 +112,10 @@ impl Process {
|
||||||
self.stack.extend(args);
|
self.stack.extend(args);
|
||||||
}
|
}
|
||||||
Some(x) => {
|
Some(x) => {
|
||||||
eprintln!(
|
tracing::error!(
|
||||||
"ERROR: `call-r` invoked on non-pointer {:?} @ {}",
|
"`call-r` invoked on non-pointer {:?} @ {}",
|
||||||
x, previptr
|
x,
|
||||||
|
previptr
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -122,9 +123,10 @@ impl Process {
|
||||||
if let Some(n2xti_arr) = self.instrp.0.h.get(self.instrp.1..) {
|
if let Some(n2xti_arr) = self.instrp.0.h.get(self.instrp.1..) {
|
||||||
if let Ok((_, trgi)) = Instr::parse(n2xti_arr) {
|
if let Ok((_, trgi)) = Instr::parse(n2xti_arr) {
|
||||||
if trgi != Instr::Label {
|
if trgi != Instr::Label {
|
||||||
eprintln!(
|
tracing::error!(
|
||||||
"ERROR: `call-r` arrived at non-jump target {:?} @ {}",
|
"`call-r` arrived at non-jump target {:?} @ {}",
|
||||||
trgi, previptr
|
trgi,
|
||||||
|
previptr
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -145,9 +147,10 @@ impl Process {
|
||||||
self.instrp.1 = match x.try_into() {
|
self.instrp.1 = match x.try_into() {
|
||||||
Ok(y) => y,
|
Ok(y) => y,
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
eprintln!(
|
tracing::error!(
|
||||||
"ERROR: jump to out-of-bounds address @ {} -> {}",
|
"jump to out-of-bounds address @ {} -> {}",
|
||||||
previptr, x
|
previptr,
|
||||||
|
x
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -155,9 +158,10 @@ impl Process {
|
||||||
if let Some(n2xti_arr) = self.instrp.0.h.get(self.instrp.1..) {
|
if let Some(n2xti_arr) = self.instrp.0.h.get(self.instrp.1..) {
|
||||||
if let Ok((_, trgi)) = Instr::parse(n2xti_arr) {
|
if let Ok((_, trgi)) = Instr::parse(n2xti_arr) {
|
||||||
if trgi != Instr::Label {
|
if trgi != Instr::Label {
|
||||||
eprintln!(
|
tracing::error!(
|
||||||
"ERROR: `call-l` arrived at non-jump target {:?} @ {}",
|
"`call-l` arrived at non-jump target {:?} @ {}",
|
||||||
trgi, previptr
|
trgi,
|
||||||
|
previptr
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -168,9 +172,10 @@ impl Process {
|
||||||
self.instrp.1 = match x.try_into() {
|
self.instrp.1 = match x.try_into() {
|
||||||
Ok(y) => y,
|
Ok(y) => y,
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
eprintln!(
|
tracing::error!(
|
||||||
"ERROR: jump to out-of-bounds address @ {} -> {}",
|
"jump to out-of-bounds address @ {} -> {}",
|
||||||
previptr, x
|
previptr,
|
||||||
|
x
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -178,9 +183,10 @@ impl Process {
|
||||||
if let Some(n2xti_arr) = self.instrp.0.h.get(self.instrp.1..) {
|
if let Some(n2xti_arr) = self.instrp.0.h.get(self.instrp.1..) {
|
||||||
if let Ok((_, trgi)) = Instr::parse(n2xti_arr) {
|
if let Ok((_, trgi)) = Instr::parse(n2xti_arr) {
|
||||||
if trgi != Instr::Label {
|
if trgi != Instr::Label {
|
||||||
eprintln!(
|
tracing::error!(
|
||||||
"ERROR: jump arrived at non-jump target {:?} @ {}",
|
"jump arrived at non-jump target {:?} @ {}",
|
||||||
trgi, previptr
|
trgi,
|
||||||
|
previptr
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -190,7 +196,7 @@ impl Process {
|
||||||
Instr::Return => match self.callstack.pop() {
|
Instr::Return => match self.callstack.pop() {
|
||||||
Some(x) => self.instrp = x,
|
Some(x) => self.instrp = x,
|
||||||
None => {
|
None => {
|
||||||
eprintln!("ERROR: return called on empty callstack @ {}", previptr);
|
tracing::error!("return called on empty callstack @ {}", previptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -207,7 +213,7 @@ impl Process {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Instr::Pop(_) if self.stack.is_empty() => {
|
Instr::Pop(_) if self.stack.is_empty() => {
|
||||||
eprintln!("ERROR: popped empty stack @ {}", previptr);
|
tracing::error!("popped empty stack @ {}", previptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Instr::Pop(cnt) => {
|
Instr::Pop(cnt) => {
|
||||||
|
@ -226,7 +232,7 @@ impl Process {
|
||||||
Instr::Dup => {
|
Instr::Dup => {
|
||||||
let x = match self.stack.last() {
|
let x = match self.stack.last() {
|
||||||
None => {
|
None => {
|
||||||
eprintln!("ERROR: dup on empty stack @ {}", previptr);
|
tracing::error!("dup on empty stack @ {}", previptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Some(x) => x.clone(),
|
Some(x) => x.clone(),
|
||||||
|
@ -236,7 +242,7 @@ impl Process {
|
||||||
Instr::Swap => {
|
Instr::Swap => {
|
||||||
let ssl = self.stack.len();
|
let ssl = self.stack.len();
|
||||||
if ssl < 2 {
|
if ssl < 2 {
|
||||||
eprintln!("ERROR: swap on empty stack @ {}", previptr);
|
tracing::error!("swap on empty stack @ {}", previptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
let x = &mut self.stack[ssl - 2..ssl];
|
let x = &mut self.stack[ssl - 2..ssl];
|
||||||
|
@ -251,7 +257,7 @@ impl Process {
|
||||||
self.stack.push(StackEntValue::Atom(Atom(b, a)));
|
self.stack.push(StackEntValue::Atom(Atom(b, a)));
|
||||||
}
|
}
|
||||||
x => {
|
x => {
|
||||||
eprintln!("ERROR: BIF atom:build @ {} called with {:?}", previptr, x);
|
tracing::error!("BIF atom:build @ {} called with {:?}", previptr, x);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,7 +267,7 @@ impl Process {
|
||||||
self.stack.push(StackEntValue::Int(b));
|
self.stack.push(StackEntValue::Int(b));
|
||||||
}
|
}
|
||||||
x => {
|
x => {
|
||||||
eprintln!("ERROR: BIF :atom:upper @ {} called with {:?}", previptr, x);
|
tracing::error!("BIF :atom:upper @ {} called with {:?}", previptr, x);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -270,7 +276,7 @@ impl Process {
|
||||||
self.stack.push(StackEntValue::Int(a));
|
self.stack.push(StackEntValue::Int(a));
|
||||||
}
|
}
|
||||||
x => {
|
x => {
|
||||||
eprintln!("ERROR: BIF :atom:lower @ {} called with {:?}", previptr, x);
|
tracing::error!("BIF :atom:lower @ {} called with {:?}", previptr, x);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -300,8 +306,8 @@ impl Process {
|
||||||
a
|
a
|
||||||
}
|
}
|
||||||
y => {
|
y => {
|
||||||
eprintln!(
|
tracing::error!(
|
||||||
"ERROR: BIF :math2:*({:?}) @ {} called with {:?}",
|
"BIF :math2:*({:?}) @ {} called with {:?}",
|
||||||
y,
|
y,
|
||||||
previptr,
|
previptr,
|
||||||
(
|
(
|
||||||
|
@ -314,7 +320,7 @@ impl Process {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
x => {
|
x => {
|
||||||
eprintln!("ERROR: BIF :math2:* @ {} called with {:?}", previptr, x);
|
tracing::error!("BIF :math2:* @ {} called with {:?}", previptr, x);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -336,6 +342,8 @@ fn main() {
|
||||||
)
|
)
|
||||||
.get_matches();
|
.get_matches();
|
||||||
|
|
||||||
|
tracing_subscriber::fmt::init();
|
||||||
|
|
||||||
let main_mod_path = matches.get_one::<PathBuf>("main").unwrap();
|
let main_mod_path = matches.get_one::<PathBuf>("main").unwrap();
|
||||||
|
|
||||||
let main_mod = Arc::new(Module {
|
let main_mod = Arc::new(Module {
|
||||||
|
|
|
@ -18,9 +18,10 @@ pub static NOOP_MODULE: Lazy<Arc<Module>> = Lazy::new(|| {
|
||||||
struct NoopOrigin;
|
struct NoopOrigin;
|
||||||
impl Origin for NoopOrigin {
|
impl Origin for NoopOrigin {
|
||||||
fn call(&self, p: &Pointer, a: &Atom, _stack: &mut Vec<StackEntValue>) -> InstrPtr {
|
fn call(&self, p: &Pointer, a: &Atom, _stack: &mut Vec<StackEntValue>) -> InstrPtr {
|
||||||
eprintln!(
|
tracing::error!(
|
||||||
"WARN: tried to invoke pointer {:?}({:?}) without valid context",
|
"tried to invoke pointer {:?}({:?}) without valid context",
|
||||||
p, a
|
p,
|
||||||
|
a
|
||||||
);
|
);
|
||||||
(Arc::clone(&NOOP_MODULE), 0)
|
(Arc::clone(&NOOP_MODULE), 0)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue