All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 00/43] Windbg supporting
@ 2017-10-17 13:08 Mihail Abakumov
  2017-10-17 13:08 ` [Qemu-devel] [PATCH v2 01/43] windbg: added empty windbgstub files Mihail Abakumov
                   ` (45 more replies)
  0 siblings, 46 replies; 56+ messages in thread
From: Mihail Abakumov @ 2017-10-17 13:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: sw, lprosek, dovgaluk, rkagan, pbonzini, den

An update of:

	v1: https://lists.nongnu.org/archive/html/qemu-devel/2017-09/msg07092.html

We made the debugger module WinDbg (like GDB) for QEMU. This is the replacement of the remote stub in Windows kernel. Used for remote Windows kernel debugging without debugging mode.

WinDbg is a multipurpose debugger for the Microsoft Windows computer operating system, distributed by Microsoft. Recent versions of WinDbg have been and are being distributed as part of the free Debugging Tools for Windows suite.

How to start debugging QEMU using WinDbg:
  Run QEMU with next option:
    -windbg pipe:<name>
  QEMU will start and pause for waiting WinDbg connection.
  Run WinDbg with next options:
    -b -k com:pipe,baud=115200,port=\\.\pipe\<name>,resets=0
  Wait for debugger connect to kernel.

Note: You can add Symbol Search Path in WinDbg such as srv*c:\tmp*http://msdl.microsoft.com/download/symbols.

How it works:
The WinDbg debugger has the possibility of connecting to a remote debug service (Kdsrv.exe) in the Windows kernel. Therefore, it is possible to connect to the guest system running in the QEMU emulator. Kernel debugging is possible only with the enabled debugging mode, may change at the same time. Our module of WinDbg debugger for QEMU is an alternative of the remote debugging service in the kernel. Thus, the debugger connects to the debugging module, not to the kernel of the operating system. The module obtains all the necessary information answering debugger requests from the QEMU emulator. At the same time for debugging there is no need to enable debugging mode in the kernel. This leads to hidden debugging. Our module supports all features of WinDbg regarding remote debugging, besides interception of events and exceptions. Only i386 is supported now.

Changed in v2:

 - Move target specific code in the 'target/' directory. (Alistair Francis)
 - Change 'kd_api_fill_memory'. Made a fill of memory by line segments. Before that, a full array was immediately collected and written in RAM. (Ladi Prosek)
 - Change 'kd_api_search_memory'. Made a search for memory by line segments. (Ladi Prosek)
 - Change ld* to st* where it needs. (Ladi Prosek)
 - Add a additional check of input arguments in 'windbg_read_context' and 'windbg_read_ks_regs'. (Ladi Prosek)
 - Fix typos. (Ladi Prosek)
 - Add a fliping back 'windbg_state->is_loaded' after reset VM.
 - Add a check to disabled kvm. It is supported yet. (Ladi Prosek)
 - Add a check to device in windbg option. Only pipe is supporting now. (Alistair Francis)
 - Add a check to 'ifdef' WINDBG_DEBUG_ON before define it. (Alistair Francis)
 - Replace printf to qemu_log. (Alistair Francis)
 - Fix build on s390x host. (patchew)
 - Fix code style error. (patchew)

---

Mihail Abakumov (43):
      windbg: added empty windbgstub files
      windbg: added windbg's KD header file
      windbg: modified windbgkd.h
      windbg: added '-windbg' option
      windbg: added helper features
      windbg: added WindbgState
      windbg: added chardev
      windbg: hook to wrmsr operation
      windbg: handler of fs/gs register
      windbg: structures for parsing data stream
      windbg: parsing data stream
      windbg: send data and control packets
      windbg: handler of parsing context
      windbg: init DBGKD_ANY_WAIT_STATE_CHANGE
      windbg: sized data buffer
      windbg: generate ExceptionStateChange
      windbg: generate LoadSymbolsStateChange
      windbg: windbg_vm_stop
      windbg: implemented windbg_process_control_packet
      windbg: implemented windbg_process_data_packet
      windbg: implemented windbg_process_manipulate_packet
      windbg: implemented kd_api_read_virtual_memory and kd_api_write_virtual_memory
      windbg: kernel's structures
      windbg: implemented kd_api_get_context and kd_api_set_context
      windbg: implemented kd_api_read_control_space and kd_api_write_control_space
      windbg: implemented windbg_read_context
      windbg: implemented windbg_write_context
      windbg: implemented windbg_read_ks_regs
      windbg: implemented windbg_write_ks_regs
      windbg: implemented windbg_set_sr
      windbg: implemented windbg_set_dr
      windbg: implemented windbg_set_dr7
      windbg: implemented windbg_hw_breakpoint_insert and windbg_hw_breakpoint_remove
      windbg: implemented kd_api_write_breakpoint and kd_api_restore_breakpoint
      windbg: debug exception subscribing
      windbg: implemented kd_api_continue
      windbg: implemented kd_api_read_io_space and kd_api_write_io_space
      windbg: implemented kd_api_read_physical_memory and kd_api_write_physical_memory
      windbg: implemented kd_api_get_version
      windbg: implemented kd_api_read_msr and kd_api_write_msr
      windbg: implemented kd_api_search_memory
      windbg: implemented kd_api_fill_memory
      windbg: implemented kd_api_query_memory


 Makefile.target                 |    5 
 cpus.c                          |   18 
 gdbstub.c                       |    4 
 include/exec/windbgkd.h         |  948 ++++++++++++++++++++++++++
 include/exec/windbgstub-utils.h |  122 +++
 include/exec/windbgstub.h       |   24 +
 include/sysemu/sysemu.h         |    2 
 qemu-options.hx                 |    8 
 stubs/Makefile.objs             |    1 
 stubs/windbgstub.c              |   21 +
 target/i386/Makefile.objs       |    2 
 target/i386/misc_helper.c       |    3 
 target/i386/windbgstub.c        | 1443 +++++++++++++++++++++++++++++++++++++++
 vl.c                            |    8 
 windbgstub-utils.c              |  358 ++++++++++
 windbgstub.c                    |  490 +++++++++++++
 16 files changed, 3455 insertions(+), 2 deletions(-)
 create mode 100755 include/exec/windbgkd.h
 create mode 100755 include/exec/windbgstub-utils.h
 create mode 100755 include/exec/windbgstub.h
 create mode 100755 stubs/windbgstub.c
 create mode 100755 target/i386/windbgstub.c
 create mode 100755 windbgstub-utils.c
 create mode 100755 windbgstub.c

--
Thanks,
Mihail Abakumov

^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2017-11-14 11:37 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-17 13:08 [Qemu-devel] [PATCH v2 00/43] Windbg supporting Mihail Abakumov
2017-10-17 13:08 ` [Qemu-devel] [PATCH v2 01/43] windbg: added empty windbgstub files Mihail Abakumov
2017-10-17 13:09 ` [Qemu-devel] [PATCH v2 02/43] windbg: added windbg's KD header file Mihail Abakumov
2017-10-17 13:09 ` [Qemu-devel] [PATCH v2 03/43] windbg: modified windbgkd.h Mihail Abakumov
2017-10-17 13:09 ` [Qemu-devel] [PATCH v2 04/43] windbg: added '-windbg' option Mihail Abakumov
2017-10-17 13:09 ` [Qemu-devel] [PATCH v2 05/43] windbg: added helper features Mihail Abakumov
2017-10-17 13:09 ` [Qemu-devel] [PATCH v2 06/43] windbg: added WindbgState Mihail Abakumov
2017-10-17 13:09 ` [Qemu-devel] [PATCH v2 07/43] windbg: added chardev Mihail Abakumov
2017-10-17 13:09 ` [Qemu-devel] [PATCH v2 08/43] windbg: hook to wrmsr operation Mihail Abakumov
2017-10-17 13:09 ` [Qemu-devel] [PATCH v2 09/43] windbg: handler of fs/gs register Mihail Abakumov
2017-10-17 13:09 ` [Qemu-devel] [PATCH v2 10/43] windbg: structures for parsing data stream Mihail Abakumov
2017-10-17 13:09 ` [Qemu-devel] [PATCH v2 11/43] windbg: " Mihail Abakumov
2017-10-17 13:09 ` [Qemu-devel] [PATCH v2 12/43] windbg: send data and control packets Mihail Abakumov
2017-10-17 13:10 ` [Qemu-devel] [PATCH v2 13/43] windbg: handler of parsing context Mihail Abakumov
2017-10-17 13:10 ` [Qemu-devel] [PATCH v2 14/43] windbg: init DBGKD_ANY_WAIT_STATE_CHANGE Mihail Abakumov
2017-10-17 13:10 ` [Qemu-devel] [PATCH v2 15/43] windbg: sized data buffer Mihail Abakumov
2017-10-17 13:10 ` [Qemu-devel] [PATCH v2 16/43] windbg: generate ExceptionStateChange Mihail Abakumov
2017-10-17 13:10 ` [Qemu-devel] [PATCH v2 17/43] windbg: generate LoadSymbolsStateChange Mihail Abakumov
2017-10-17 13:10 ` [Qemu-devel] [PATCH v2 18/43] windbg: windbg_vm_stop Mihail Abakumov
2017-10-17 13:10 ` [Qemu-devel] [PATCH v2 19/43] windbg: implemented windbg_process_control_packet Mihail Abakumov
2017-10-17 13:10 ` [Qemu-devel] [PATCH v2 20/43] windbg: implemented windbg_process_data_packet Mihail Abakumov
2017-10-17 13:10 ` [Qemu-devel] [PATCH v2 21/43] windbg: implemented windbg_process_manipulate_packet Mihail Abakumov
2017-10-17 13:10 ` [Qemu-devel] [PATCH v2 22/43] windbg: implemented kd_api_read_virtual_memory and kd_api_write_virtual_memory Mihail Abakumov
2017-10-17 13:11 ` [Qemu-devel] [PATCH v2 23/43] windbg: kernel's structures Mihail Abakumov
2017-10-17 13:11 ` [Qemu-devel] [PATCH v2 24/43] windbg: implemented kd_api_get_context and kd_api_set_context Mihail Abakumov
2017-10-17 13:11 ` [Qemu-devel] [PATCH v2 25/43] windbg: implemented kd_api_read_control_space and kd_api_write_control_space Mihail Abakumov
2017-10-17 13:11 ` [Qemu-devel] [PATCH v2 26/43] windbg: implemented windbg_read_context Mihail Abakumov
2017-10-17 13:11 ` [Qemu-devel] [PATCH v2 27/43] windbg: implemented windbg_write_context Mihail Abakumov
2017-10-17 13:11 ` [Qemu-devel] [PATCH v2 28/43] windbg: implemented windbg_read_ks_regs Mihail Abakumov
2017-10-17 13:11 ` [Qemu-devel] [PATCH v2 29/43] windbg: implemented windbg_write_ks_regs Mihail Abakumov
2017-10-17 13:11 ` [Qemu-devel] [PATCH v2 30/43] windbg: implemented windbg_set_sr Mihail Abakumov
2017-10-17 13:11 ` [Qemu-devel] [PATCH v2 31/43] windbg: implemented windbg_set_dr Mihail Abakumov
2017-10-17 13:11 ` [Qemu-devel] [PATCH v2 32/43] windbg: implemented windbg_set_dr7 Mihail Abakumov
2017-10-17 13:11 ` [Qemu-devel] [PATCH v2 33/43] windbg: implemented windbg_hw_breakpoint_insert and windbg_hw_breakpoint_remove Mihail Abakumov
2017-10-17 13:12 ` [Qemu-devel] [PATCH v2 34/43] windbg: implemented kd_api_write_breakpoint and kd_api_restore_breakpoint Mihail Abakumov
2017-10-17 13:12 ` [Qemu-devel] [PATCH v2 35/43] windbg: debug exception subscribing Mihail Abakumov
2017-10-17 13:12 ` [Qemu-devel] [PATCH v2 36/43] windbg: implemented kd_api_continue Mihail Abakumov
2017-10-17 13:12 ` [Qemu-devel] [PATCH v2 37/43] windbg: implemented kd_api_read_io_space and kd_api_write_io_space Mihail Abakumov
2017-10-17 13:12 ` [Qemu-devel] [PATCH v2 38/43] windbg: implemented kd_api_read_physical_memory and kd_api_write_physical_memory Mihail Abakumov
2017-10-17 13:12 ` [Qemu-devel] [PATCH v2 39/43] windbg: implemented kd_api_get_version Mihail Abakumov
2017-10-17 13:12 ` [Qemu-devel] [PATCH v2 40/43] windbg: implemented kd_api_read_msr and kd_api_write_msr Mihail Abakumov
2017-10-17 13:12 ` [Qemu-devel] [PATCH v2 41/43] windbg: implemented kd_api_search_memory Mihail Abakumov
2017-10-17 13:12 ` [Qemu-devel] [PATCH v2 42/43] windbg: implemented kd_api_fill_memory Mihail Abakumov
2017-10-17 13:12 ` [Qemu-devel] [PATCH v2 43/43] windbg: implemented kd_api_query_memory Mihail Abakumov
2017-10-17 14:11 ` [Qemu-devel] [PATCH v2 00/43] Windbg supporting no-reply
2017-10-17 15:04 ` no-reply
2017-10-23  8:31 ` Ladi Prosek
2017-11-06 15:15   ` Ladi Prosek
2017-11-06 18:41     ` Andrew Baumann
2017-11-07  8:10       ` Ladi Prosek
2017-11-07 17:23         ` Andrew Baumann
2017-11-08 11:54     ` Mihail Abakumov
2017-11-08 13:43       ` Ladi Prosek
2017-11-08 14:28         ` Mihail Abakumov
2017-11-13 12:23           ` Ladi Prosek
2017-11-14 11:37             ` Mihail Abakumov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.