From nobody Wed Nov 15 23:55:37 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SW0RH614jz50tqb for ; Wed, 15 Nov 2023 23:55:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SW0RH5XBQz3Yfx for ; Wed, 15 Nov 2023 23:55:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700092539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MtFyzTAuEnYyEJiboap03y8hiOyGqPn8jiUinO9prHs=; b=xU+k/CdXbbo35rs1i9f2hnP4BqfkxpuYklOEkGp6Bqjk+m6yf3IObE02rgYTWfrdHm3J5e bR1QnQlzpx+vTkyaJftNonxiKa2xHCpdswOUo7VDzm2D/NBWAOIt2BSIG0zxekxJWZ4Avp a4C/y7pEnym+dFsa+68A5RDih8th9JLTEU7KM7FZyMZhvHiaGJuWX9Ele5JpbiXNBYUJNp kq+NvmtNt9opQ70dRzeyLVcog/nhku9YLnLWaj2TtOwlOKfNX64WEq1NwKiZ3YFUonyOly bXjsuSKq6j7uGHmidSwkSrIqQNymFBJOBVNVIyoKWpPQBQ30UHJL+ih9r+nDMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700092539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MtFyzTAuEnYyEJiboap03y8hiOyGqPn8jiUinO9prHs=; b=wquzM15UXQpc2/BVLd+VPCM3xCUa23yGPgrwP14vqfET7N+Epyo+yejss54Ho/jwBQRp4C lrdqEeCrhjJNqwx8wSOJfJCD++C3RDijbdiwLn6gmi5mc8eyMVH40SzxdI5nolvOyqFv0d k4IP/flpWLZNBhm7qVM4TLPrT4NEPPs9/vfCokSEcvGazQsQ5h6qP7ZTCoLUO/ClVl5Sdp cOtGOFu/z7vs9bSvzliLTtc4gXlFOfEB7Wn74XK8eDInMGbDsSK6Eq03l65vvrijRXWKsf 5e0UCBsMJTgDu/NkW/05tIAgIyJJdW1u4WPeFN/isD5Ve5KH2EQyGWNfn22syw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700092539; a=rsa-sha256; cv=none; b=Wi5WxQMWezON0SH7kXHmtdJOzmVnjysj2g9Hw5elU4AZVBloNfOdgiIw6Xw0KlhQfUtjUg rWn/QHiAR19PLc372MQVNgFeXGP1osl3oVWYXdiZnTzVrE7v0MvHfEcRJMw0dktH4RsV2s mHHurygwrXB48GJQCPY5A8Y0tCmRtlfb0T8eVfOjXIoFgFYqU5d9NChjanmyn64Akts2i+ dDg9qPGzg5bqft7Qw587c6yfnyNPolaKp3NcPektBV/S6tqoBI2erFrAnyzQOZX0EF/APg gCT5hD6yQsS+Lonm8rkeE0Q0sTwP4BOBj8d0rJ0ta/jAqaySz3ogx41oF2OYFg== Received: from [IPV6:2601:648:8384:fd00:7c48:55a7:81e0:3a0a] (unknown [IPv6:2601:648:8384:fd00:7c48:55a7:81e0:3a0a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4SW0RH3BF8zCGt for ; Wed, 15 Nov 2023 23:55:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <56b1a46c-db8c-4c0f-8d3e-2cbae7e8015c@FreeBSD.org> Date: Wed, 15 Nov 2023 15:55:37 -0800 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bhyve -G Content-Language: en-US To: freebsd-current@freebsd.org References: <234F558A-FB6A-4DE2-A99F-4B4F96C86EF0@iitbombay.org> From: John Baldwin In-Reply-To: <234F558A-FB6A-4DE2-A99F-4B4F96C86EF0@iitbombay.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11/15/23 3:06 PM, Bakul Shah wrote: > > >> On Nov 15, 2023, at 7:57 AM, John Baldwin wrote: >> >> On 10/9/23 5:21 PM, Bakul Shah wrote: >>> Any hints on how to use bhyve's -G option to debug a VM >>> kernel? I can connect to it from gdb with "target remote :" >>> & bhyve stops the VM initially but beyond that I am not sure. >>> Ideally this should work just like an in-circuit-emulator, not >>> requiring anything special in the VM or kernel itself. >> >> step only works on Intel CPUs currently (and is a bit fragile >> anyway due to interrupts firing while you try to step, but that >> happens for me in QEMU as well). Breakpoints should work fine. >> I tend to use 'until' to do stepping (basically stepping via >> temporary breakpoints) when debugging the kernel this way. > > Thanks for your response! > > I can ^C to stop the VM, examine the stack, set breakpoints, > continue etc. but when the breakpoint is hit, kgdb doesn't > regain control -- instead I get the usual > > db> ... > > prompt on the console. I guess I have to set some sysctl for > this? Hmm, no, it shouldn't be breaking into DDB in the guest as the breakpoint exception should be intercepted by the stub and never made visible to the guest. -- John Baldwin