From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.6254.1624448390048615711 for ; Wed, 23 Jun 2021 04:39:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hD2FekXa; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624448389; 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=vVtO0zuw8ULU0VhJ8WqGvArg/Xo8l8CuoK7uluY1Ra0=; b=hD2FekXayW5qToIxTzPPtiR2Ts7MRnJqiffq+own07eYlP6Rr+j8qtBurfobdjQnHa1Q+M MQccq3ITQ1rr6/ZI2p1BKlmjqEQ93tWvIhoEz3oq3XW1Sckzi2FRk74bSiHyRtCeqL50Kv crBSTDvZ0FXbNbxn4Azzrd3q4tyl+oY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-541-eiPAwKOAPAqDYe-VSLjGww-1; Wed, 23 Jun 2021 07:39:46 -0400 X-MC-Unique: eiPAwKOAPAqDYe-VSLjGww-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 36F34800D55; Wed, 23 Jun 2021 11:39:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-200.ams2.redhat.com [10.36.112.200]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81B4E5D6D7; Wed, 23 Jun 2021 11:39:44 +0000 (UTC) Subject: Re: [edk2-devel] Help with debugging To: devel@edk2.groups.io, harlydavidsen@gmail.com References: From: "Laszlo Ersek" Message-ID: Date: Wed, 23 Jun 2021 13:39:42 +0200 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 06/11/21 19:06, Ethin Probst wrote: > Hey all, > > So Leif and I have discussed this at length but I thought I'd reach > out to all of you for more help. > > I'm having a lot of trouble debugging my UEFI app. Here's how I do things: > > - I load the app using uefi-run > (https://github.com/Richard-W/uefi-run) like this (from the main EDK > II directory): uefi-run -b Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd > Build/OvmfX64/DEBUG_GCC5/X64/Shell.efi -- -M q35 -m 24G -usb -device > qemu-xhci -device usb-audio,audiodev=audio -audiodev alsa,id=audio -s > -debugcon file:../debug.log -global isa-debugcon.iobase=0x402 > -nographic > Or: > uefi-run -b Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd > Build/OvmfX64/DEBUG_GCC5/X64/Shell.efi -- -M q35 -m 24G -usb -device > qemu-xhci -device usb-audio,audiodev=audio -audiodev alsa,id=audio -s > -debugcon stdio -global isa-debugcon.iobase=0x402 Side comment: OVMF supports virtio-fs, and using virtio-fs could speed up your develop/build/test cycle. Assuming your UEFI application does not crash or hang (i.e., assuming it exits cleanly and you can continue using the same UEFI shell session), virtio-fs could be a small productivity boost for you, as you wouldn't have to re-launch QEMU every time. The idea is to build your application through some platform DSC file as follows -- note that it need not be an OVMF DSC file, but it may be one, if you prefer that: build -a X64 -b NOOPT -p MyAppPkg/MyApp.dsc -t GCC5 \ -m MyAppPkg/MyApp/MyApp.inf You don't need an FDF file for this, just grab the resultant "MyApp.efi" binary from the Build directory. Then copy "MyApp.efi" (on the host side) under the virtio-fs root directory somewhere. When the copy operation completes (on the host side), just switch your focus to the guest UEFI shell window, and you can immediately execute the just-built application. I find using virtio-fs by far the easiest with libvirt, but you can use it from the bare QEMU command line, too. https://libvirt.org/kbase/virtiofs.html https://virtio-fs.gitlab.io/howto-qemu.html This assumes that your development environment is Linux-based, as the virtio-fs daemon (which runs in tandem with QEMU on the host) is Linux-only. Thanks, Laszlo