From nobody Wed Nov 15 23:06:06 2023 X-Original-To: virtualization@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 4SVzLN0RY3z50rn4 for ; Wed, 15 Nov 2023 23:06:20 +0000 (UTC) (envelope-from bakul@iitbombay.org) Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) (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 4SVzLM5slfz3LMq 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-x42a.google.com with SMTP id d2e1a72fcca58-6bb4abb8100so160022b3a.2 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=hFXBypgeoo4NzDXTu2BA7ca/tx/XmoD/pnXPhimTejftGsxNtk45KEfYcemNNAWOH8 abAzQBK64CTyXpO5nFPjiimK4cn/oGdjLGiG1mQ43atCeUicPNRvt928TXnN3lBNBNMZ VRZd/CBZs1t/GKFp4t6Pc0JOtrds41pJydBsk6i7Th6ixC9HKZ+M8vvGY8wCWiTexDAn aX+Gx5CVOPIqayc+HRH0uFl801FlkDCOaPzzo/5XuuVtPe741njBX/KKjIw5jtOOIn68 /hKGe4P6ylS9oyCyuKR79UKMAQT0jQFGPXhKibV88zmZNuq+/8Qt/Bm2BqL2cCtI//mJ xBrw== X-Gm-Message-State: AOJu0YyJQSjJIIkjmGXGCA5Gj/bnRD++Nmuk/FFDKEhLsPu8/L6088Gn VDTyklB3mPlhraK+iokq5yFdQSZ72g6+HFEh6hs= 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: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@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: 4SVzLM5slfz3LMq > 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=