-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependent libraries and static storage duration data #12
Comments
On 1: Jup (see also #8). This would require going through the import address table (which blink already does anyway) and load all the PDBs for imported libraries too, instead of just the application one (to extend the symbol list and source/object file name lists to contain information about the libraries too). The rest should work as it is. On 2: The relevant code is here: Line 360 in 171d683
This is where blink connects addresses of old static variables with the new code. The .bss section contains zero-initialized variables and the .data section should contain all other global variables. So technically blink should already keep the old addresses and I remember this working in the past. Could you give an example of where the address is no longer the same after reloading?
On 3: This is when Line 125 in 171d683
Depending on how long that takes, this will be noticeable with a hang. Adding some performance timers in application::link should help narrowing down which part takes the longest time. My guess is symbol resolving, but could also be file IO while the object file is read into memory.
|
Once I change the message I see:
|
So yea, 2 happens only the very first time because |
My guess for 3. is that up to 12 bytes are changed at the beginning of a function call. This is enough to cause issues if the program happened to be inside that region OR if another function is returning into that region. It could be possible to check if this the issue by having a sleep at the start of the function, and as soon as this is entered, make a change to the source code. Chances are, the sleep will return into the overwritten code and cause chaos. |
Blink is amazing, but I can see a couple issues right now:
Linked libraries. Many projects are designed in a modular way: executable and a bunch of libraries linked to it. Currently blink works only with compilation units linked directly to the executable;
Static storage duration data. After the first hot reload addresses of static variables are changed, and these variables seem contain zero-initialized data. Would be nice if these variables keep the old addresses. Currently I have no idea how to resolve this issue;
Sometimes blink and executable, blink is connected to, hang with the following message in terminal:
Finished compiling "c:\my_project\source\foo.obj" with code 0.
I'm trying to find the cause, but no success yet.
I'm working on these when I have some free time, so if you have any ideas, please, let me know.
The text was updated successfully, but these errors were encountered: