shingfeel opened issue #3118:
I use nginx to process http requests. and load wasm file, set "wasmtime_config_debug_info_set" flag, compile modules and link modules in main process. Then fork and call wasm func in child process.
When i use a debugger: gdb -p [pid] to attach to child process and want to beak point in wasm function. It failed with:"Function "xxxxxx" not defined"。It seem's debuger can't find debug_info in child process.
I wonder why debuger work fine in main process and don't work in child process?
alexcrichton commented on issue #3118:
Wasmtime manually has to tell GDB about code that we've generated (along with debuginfo), but maybe GDB doesn't preserve this information across forks? Wasmtime doesn't do anything after a fork to re-inform GDB about dynamically generated code.
My guess is that GDB "forgets" about dynamically loaded code after a fork and we'd have to re-inform it of code, but that's just a hunch and I don't actually know how gdb works in this regard.
shingfeel commented on issue #3118:
thank @alexcrichton for your answer.
It seems GDB really "forgets" to dynamically loaded code after fork. in my code, recompile wasm module after fork and GDB now working correctly.
shingfeel closed issue #3118:
I use nginx to process http requests. and load wasm file, set "wasmtime_config_debug_info_set" flag, compile modules and link modules in main process. Then fork and call wasm func in child process.
When i use a debugger: gdb -p [pid] to attach to child process and want to beak point in wasm function. It failed with:"Function "xxxxxx" not defined"。It seem's debuger can't find debug_info in child process.
I wonder why debuger work fine in main process and don't work in child process?
Last updated: Nov 22 2024 at 17:03 UTC