eteran / edb-debugger

edb is a cross-platform AArch32/x86/x86-64 debugger.
GNU General Public License v2.0
2.7k stars 326 forks source link

Don't rely on /proc to get thread's instruction pointer #709

Closed bet4it closed 5 years ago

bet4it commented 5 years ago

Linux after v4.9 has stopped reporting eip and esp in /proc/PID/stat Refer: torvalds/linux@0a1eb2d474edfe75466be6b4677ad84e5e8ca3f5

Things need to do before merge this PR: Implement this TODO in get_state: https://github.com/eteran/edb-debugger/blob/fb7643f65927b769668e41ea20f008cdb82f7a19/plugins/DebuggerCore/unix/linux/arch/x86-generic/PlatformThread.cpp#L164-L165

eteran commented 5 years ago

I think we can do things more efficiently than this PR. I appreciate the effort and apologize for letting it linger for so long. I'd rather alter the state API to be able to fetch specific classes of registers (or even specific important registers) without the need fetch the whole state unnecessarily.