crosire / blink

A tool which allows you to edit source code of any MSVC C++ project live at runtime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to start file system watcher

suVrik opened this issue · comments

Hello!

I have tried to run blink on a couple projects, but every time I get the same error:

Launching in target application ...
  Entry point was written to address 0123456789ABCDEF
Reading PE import directory ...
Reading PE debug info directory ...
  Found program debug database: C:\my_project\_build\my_project.pdb
  Found source file: c:\my_project\foo.cpp
  Found source file: c:\my_project\bar.cpp
  Found source file: c:\my_project\main.cpp
Starting compiler process ...
  Started process with PID 123
Starting file system watcher for '' ...
  Error: Could not open directory handle.
The target application has exited with code 259.

I debugged blink for a couple minutes and found out that in method blink::pdb_reader::read_link_info variable stream has size of 0. The item pdb_reader::_named_streams["/LinkInfo"] exists and is equal to 5. msf_reader::_streams[5].page_indices is an empty vector.

Is there some compilation/linkage flag I'm missing?

I'm using MSVC 2017, version 15.7.5.

I haven't come across a MSVC 2017 PDB without the link info stream yet, so not sure what would cause that to be missing. But I'll add some fallback code that extracts the project directory from the source code file names again if it isn't found.

When I open the PDB file in hex editor I can see /LinkInfo there.

1

Now the file system watcher works well, but obj file is not created and Failed to open input file. message is printed.

build_compile_command_line returns "c:\my_project\foo.cpp" /Fo"c:\my_project\foo.obj" when I change foo.cpp. Condition tag != 0x113d is never false in parse_code_view_records's lambda.

I will create a minimal working sample in a couple hours if it can help.

I solved my problem. The /ZI flag is required for blink to work. Otherwise .obj files don't contain required tag.

Your tool works like a charm! Thank you!