Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix gdb_interface: restore gdb's output streams at end of gdb_interface
Currently for most gdb_interface call, in which a non-null file pointer is passed, GDB's output stream is replaced with the passed file pointer Due to this, 'info threads', which is a gdb passthrough, doesn't print any thread, after support was added to get registers from crash_target: crash> info threads Id Target Id Frame This empty output of 'info threads' was due to a subtle bug in gdb_interface. After this gdb passthrough is run, 'datatype_info' is called, with file pointer set to null_fp (pointing to /dev/null). And after 'datatype_info' returns, any output by gdb goes to /dev/null, and hence the output is lost. Fix this by restoring the original output streams, after gdb_interface has handled the output After this patch: crash> info threads Id Target Id Frame * 1 2131 bash 0xc000000000051e40 in crash_fadump (regs=0x0, str=0xc000000002c60510 <buf> "sysrq triggered crash") at arch/powerpc/kernel/fadump.c:735 Cc: Sourabh Jain <[email protected]> Cc: Hari Bathini <[email protected]> Cc: Mahesh J Salgaonkar <[email protected]> Cc: Naveen N. Rao <[email protected]> Cc: Lianbo Jiang <[email protected]> Cc: HAGIO KAZUHITO(萩尾 一仁) <[email protected]> Cc: Tao Liu <[email protected]> Cc: Alexey Makhalov <[email protected]> Signed-off-by: Aditya Gupta <[email protected]> Signed-off-by: Tao Liu <[email protected]>
- Loading branch information