Hello
I am trying to add source-level debugging to my (rather big) emscripten C++
project.
The browser is trying to access the map file itself at the
SOURCE_MAP_BASE_URL/MyProject.wasm.map location, where SOURCE_MAP_BASE_URL
is the string passed to --source-map-base
So far, so good. I can simply start, for instance, python3 -m http.server
8080
The problem is that the map file contains entries relative to the build dir
:
{
"version": 3,
"sources": [
"../../../../orthanc/OrthancFramework/Sources/DicomFormat/DicomTag.h",
"../../../src/models/OrthancClient.cpp",
"../../../src/models/CustomLoaderCache.h",
"../../../../../../../../home/bgo/apps/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/unordered_map",
"boost_1_69_0/boost/smart_ptr/weak_ptr.hpp",
"boost_1_69_0/boost/smart_ptr/shared_ptr.hpp",
"../../../../../../../../home/bgo/apps/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/algorithm",
...
The browser, when it processes this map file, simply seems to truncate all
the leading ../ components of the path.
My question is : what is the best way to tackle this issue?
My first gut feeling would be to patch the map file so that all paths are
absolute, and then serve from my filesystem root. However, it requires the
map file to be served from a different location, which means I cannot use
an off-the-shelf server like Python http.server
May I inquire on how you specifically deal with this issue in your own
projects? Are there extra flags or configuration settings that would allow
me to configure how the paths are computed or prevent the browser from
erasing the ".." path components (so that writing my own source server
becomes, if not trivial, at least possible) ?
Thanks in advance for your help or advice!
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/emscripten-discuss/fb5432e8-bb0d-4fe4-8f36-206c6336b97an%40googlegroups.com.