gdbgui
gdbgui copied to clipboard
GDBGUI on windows incorrect path for loading source file
Hello,
Steps to reproduce:
- Specify exe file and press "Load binary"
- Press "Fetch source files"
- Click on any source file
You will get and error "expected to find source file" in the following JS code
get_body() {
const states = constants.source_code_states;
switch (this.state.source_code_state) {
case states.ASSM_AND_SOURCE_CACHED: // fallthrough
case states.SOURCE_CACHED: {
let obj = FileOps.get_source_file_obj_from_cache(this.state.fullname_to_render);
if (!obj) {
console.error("expected to find source file");
where this.state.fullname_to_render will contains "/C:\Folder\Filename.cpp" instead of "C:\Folder\Filename.cpp"
I believe you may be able to remap the sources to make this work. Something like
gdbgui --remap-sources='{"/": ""}'
Hi,
I am getting this too. I am having to map file paths from unix to windows, eg:
gdbgui -r --remap-sources='{"/home/dev/blah/develop":"c:/dev/develop"}'
I have tried all sorts of combinations but it always sticks a '/' in front of the windows file path. I tried mapping to "dev/nos-develop" which produced filenames like "/dev/blah/develop/app/builds/../main.cpp" etc which also didn't work, but I'm not sure if it was the lack of "c:/" that was the problem or the parent dir "/../" bit.
Great piece of software though!
I'm having the same problem using Mingw where the linux style root slash added before the drive letter prevents source files from loading. I tried the remapping option from "/" to "" but It doen't seem to change anything. If there is anywhere in the source I could try contributing to, I would be glad to help.
Thanks for the offer. If you open the chrome developer tools and monitor the network communication, you can see the urls and parameters being requested. Assuming the requested file path has the "/" prefix, you can look at the url and grep for it in the codebase (is it possible gdbgui is requesting a normal path and Mingw is adding the prefix?).
From there, you can find where the request was made and put a breakpoint in. After the breakpoint is there, you can run again and hit the breakpoint. At that point you can walk back up the stack and see if/how the original url is transformed into a url with the '/' prefix.
I'm having the same issue on my Windows 10 machine. Paths get '/' prefixed in front of them for some reason and cannot open files with following error file not found: /C:\dev\....