From nobody Wed Nov 15 23:06:06 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 4SVzLN0P3kz50rTF for ; Wed, 15 Nov 2023 23:06:20 +0000 (UTC) (envelope-from bakul@iitbombay.org) Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SVzLM53dwz3LBG for ; Wed, 15 Nov 2023 23:06:19 +0000 (UTC) (envelope-from bakul@iitbombay.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6c34e87b571so158495b3a.3 for ; Wed, 15 Nov 2023 15:06:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20230601.gappssmtp.com; s=20230601; t=1700089578; x=1700694378; darn=freebsd.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6FN7Ng6ZbdaYJJ/x6VeGgtvxVTHDF4I3JujhNUyTdA4=; b=RwXIDcI9tK1QfcE7XsdXJcPkJqX2hj3LWxkMtcYSl+zYSp4HsaPZsCaMZtBGtkTZFX 9P7OxLY122l3whQZyuSmPydmHIWooRtYtIW3DieBXCUTKye8bThKXKrAVzh7uzj/R0Dh Ow31vcJN18RiOK54GpfwpijV3e/0ggBxTBU63ZuE+k7E6nLL0OOWJB5q9GTnc1HmGqlu eFVvqYr592PUq0AsUYa3XZnrgMgXrypxANkYYDxYyYucWqmaAEe830qJG8HEgary9f47 h7hhAIvVtZfDBiRMsDJqv1JoyPGcC9FJUIi1yX70IYdAb0G/5BGtEQfneP8HBmncYd5x /X+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700089578; x=1700694378; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6FN7Ng6ZbdaYJJ/x6VeGgtvxVTHDF4I3JujhNUyTdA4=; b=MawMz3VWnqR7GrMVUckg61AivAvg75wtyL/9Q5O6FnNbswlmybSy4425jX9qtxV1NT C5a82rd48LD37xWvFpGr7le/eISaRzb+EfbcmL5ZDbXWxotJuVov6rX76nVkI70t7oS2 lA2lGs9qwsWBXtJC5VkV3nkV2KjtZh+nLn4SU1O9IvthmZPu4tDbQk7AMCYrojQsaYmb M6AF/aEoQDyODYUPfywKzEhGTkMyRAUl/7i0wGvmTDxRhsq2vOZtJnsVlZa+I5ZIHz/5 6fZ2XfcrS9gFEIGzTrYuBaAgVGOTAckS5NN5Ma3/398n2UbwMTe+Hmdl3xD9QeXtNPQG AU6A== X-Gm-Message-State: AOJu0YzYLdnl5B6X7YdGnZXVsh0KkSdg0qSawqbSCzYxQ1QT5EOj/hqv xb6iA1oaa7VTBdFsXtyLwb3IFw== X-Google-Smtp-Source: AGHT+IHd9vUTenDNbrghIm71SVtsqUeH2/cGvB/N7cCDfcfnfEA0tNkl0LYI1FQ1g7/3UIQnm3v+bg== X-Received: by 2002:a05:6a20:7353:b0:186:c0fe:b842 with SMTP id v19-20020a056a20735300b00186c0feb842mr9064057pzc.2.1700089578377; Wed, 15 Nov 2023 15:06:18 -0800 (PST) Received: from smtpclient.apple (107-215-223-229.lightspeed.sntcca.sbcglobal.net. [107.215.223.229]) by smtp.gmail.com with ESMTPSA id jd7-20020a170903260700b001ca222edc16sm7853803plb.135.2023.11.15.15.06.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2023 15:06:17 -0800 (PST) Content-Type: text/plain; charset=utf-8 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 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Subject: Re: bhyve -G From: Bakul Shah In-Reply-To: Date: Wed, 15 Nov 2023 15:06:06 -0800 Cc: FreeBSD CURRENT , virtualization@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <234F558A-FB6A-4DE2-A99F-4B4F96C86EF0@iitbombay.org> References: To: John Baldwin X-Mailer: Apple Mail (2.3774.200.91.1.1) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4SVzLM53dwz3LBG > On Nov 15, 2023, at 7:57=E2=80=AFAM, John Baldwin = wrote: >=20 > 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. >=20 > 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? Thanks, Bakul=