qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mihail Abakumov <mikhail.abakumov@ispras.ru>
To: Ladi Prosek <lprosek@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	sw@weilnetz.de, Pavel Dovgalyuk <dovgaluk@ispras.ru>,
	Roman Kagan <rkagan@virtuozzo.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Denis V. Lunev" <den@openvz.org>
Subject: Re: [Qemu-devel] [PATCH v3 00/45] Windbg supporting
Date: Wed, 06 Dec 2017 12:14:46 +0300	[thread overview]
Message-ID: <bcb83e92ef84c5fdeb929872033af3d3@ispras.ru> (raw)
In-Reply-To: <CABdb736ZwzjKDTZsKYqRtiqCVzKG8qEQKOubv6=oNDCwCDUe_A@mail.gmail.com>

Ladi Prosek писал 2017-11-29 11:23:
> On Tue, Nov 21, 2017 at 3:07 PM, Mihail Abakumov
> <mikhail.abakumov@ispras.ru> wrote:
>> 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 v3:
>> 
>>  - Add a support of the new api functions from the WinDbg v10.
>> 
>> 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)
> 
> 
> Thanks, v3 is working with a Win10 windbg for me!
> 
> A few things I noticed during my testing (Win7 32-bit guest):
> 
> * Windbg prints:
> 
>   ReadVirtual: 827403d0 not properly sign extended
> 
> after connecting. That's likely a bug hiding somewhere.
> 

This is due to the fact that the cpu_memory_rw_debug function cannot
return the required memory region. No physical page mapped.

> * lm prints only nt and a bunch of unloaded crash dump modules. This
> doesn't look expected and blocks what I believe is the most common way
> of initiating debugging which is setting a breakpoint on a specific
> driver function. Additionally, after rebooting the guest, lm prints
> only nt, nothing else. Do you see the same thing?

Yes, the same.

> 
>   kd> lm
>   start    end        module name
>   8260b000 82a1d000   nt         (pdb symbols)          C:\Program
> Files (x86)\Windows
> Kits\10\Debuggers\x64\sym\ntkrpamp.pdb\684DA42A30CC450F81C535B4D18944B12\ntkrpamp.pdb
> 
>   Unloaded modules:
>   869da000 869e7000   crashdmp.sys
>   869e7000 869f2000   dump_ataport.sys
>   869f2000 869fb000   dump_atapi.sys
>   86800000 86811000   dump_dumpfve.sys
> 
> * It seems to work on a Linux host as well! Still ok to keep it
> limited to pipe: for now, especially if you don't test on Linux.
> 
> * Wondering about the legal aspects of copying code from winnt.h. I'll
> let others confirm that it's ok.
> 
> I have replied to some of the patches with comments.
> 
> Thank you!
> Ladi

-- 
Thanks,
Mihail

      reply	other threads:[~2017-12-06  9:14 UTC|newest]

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bcb83e92ef84c5fdeb929872033af3d3@ispras.ru \
    --to=mikhail.abakumov@ispras.ru \
    --cc=den@openvz.org \
    --cc=dovgaluk@ispras.ru \
    --cc=lprosek@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkagan@virtuozzo.com \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).