mirror of https://github.com/pwndbg/pwndbg.git
Add ability to load individual symbols (#208)
* add func to compile and load symbols from a file * break out add_symbol_file, fix ext splitting * Looks like for 2.7, file.flush invokes the native routine file_flush which invokes fflush. file.close invokes the native routine file_close --> close_the_file --> PyFileObject->f_close --> close(2). There is no call to any flush routine. file.__exit__ just invokes the close method on the file object. According to StackOverflow, file.close() implies file.flush(), but I don't see any code for it in the cpython source. Separately, flush() does not guarantee that the data is actually on disk. That requires calling fsync() or using O_SYNC. So it appears that the call to f.flush() is both unnecessary and incorrect. * We still need to call fsync to actually ensure the data hits the disk. However, the file descriptor is closed outside of the with block, and we can't guarantee the buffers are flushed in the with block without .flush().pull/216/head
parent
73d1cfd51f
commit
eff9f165f3
Loading…
Reference in new issue