On WebAssembly clang only wires a 0- or 2-argument main to the program entry point: EmitMainVoidAlias emits the __main_void alias for a no-argument main, and the 2-argument form is mangled to __main_argc_argv. A 3-argument main(argc, argv, envp) matches neither, so main is never connected to the entry point and is left as an undefined-weak stub whose body is `unreachable`. The affected inferiors trap with "Exception: unreachable" before reaching main (even when run outside the debugger) so any test using them fails on wasm. Drop the unused third parameter, and where the environment is actually iterated read it from `environ` instead. The inferiors now run on WebAssembly and behave identically on other platforms.
9 lines
180 B
C
9 lines
180 B
C
#include <stdio.h>
|
|
|
|
int main(int argc, char const *argv[]) {
|
|
puts("stop here"); // Set breakpoint here
|
|
puts("hello");
|
|
puts("Set tid-specific breakpoint here");
|
|
return 0;
|
|
}
|