crosire / blink

A tool which allows you to edit source code of any MSVC C++ project live at runtime
BSD 2-Clause "Simplified" License
1.09k stars 81 forks source link

Make Blink compatible with object files built with `/bigobj` #25

Closed Ybalrid closed 5 years ago

Ybalrid commented 5 years ago

See discussion in issue #23

Do not merge yet :

If things are going to get built with /bigobj too. The code that does the "linking and patching" needs a similar modification.

Probably around here : https://github.com/crosire/blink/blob/master/source/blink_linker.cpp#L136

Ybalrid commented 5 years ago

update : So, the changes mentioned in the first message are done, but there's still a crash occuring here: https://github.com/crosire/blink/blob/master/source/blink_linker.cpp#L349

(the section referenced by the symbol has a number way higher than the number of section in the object file - causing to be out of the range in side the vector)

I need to dig a bit more about what's going on right there.

Ybalrid commented 5 years ago

@crosire This thing is ready for you to checkout ;-)

Ybalrid commented 5 years ago

Fix #23

crosire commented 5 years ago

Thank you. Great job figuring this out! =)

I'm not a big fan of virtual functions/dynamic casting/exceptions though, so decided to implement this slightly differently with templates only. Hope you don't mind. Commit is below:

Ybalrid commented 5 years ago

@crosire I think I said it was a quick and dirty one, and I'm pretty happy that you used that as the basis for fixing what happens with "bigobj" coff files. I'm going to check if everything works on my end with the commit in question :wink: