From: Andrew Fish <afish@apple.com>
To: "David A. Van Arnem" <dvanarnem@cmlab.biz>
Cc: "edk2-devel@lists.01.org" <edk2-devel@ml01.01.org>,
Laszlo Ersek <lersek@redhat.com>
Subject: Re: DEBUG() macros in DXE driver: can’t make it work in QEMU
Date: Thu, 16 Feb 2017 10:05:43 -0800 [thread overview]
Message-ID: <F0DA204C-55AE-4B74-87DF-3A5C8B42FC3B@apple.com> (raw)
In-Reply-To: <e57a9cc0-81a5-7e74-b476-923993d8ee7e@redhat.com>
> On Feb 15, 2017, at 4:39 AM, Laszlo Ersek <lersek@redhat.com> wrote:
>
> On 02/15/17 01:00, David A. Van Arnem wrote:
>>
>>
>> On 02/14/2017 04:46 PM, Nikolay Bodunov wrote:
>>> Hi
>>>
>>> I red this topic before asking the question in the maillist. Unfortunately,
>>> it's not for DXE phase.
>>> I even tried to use it and recieved expected compiler error:
>>>
>>> error 1001: Module type [PEIM] is not supported by library instance
>>> [/home/nick/src/edk2/MdePkg/Library/UefiDebugLibConOut/
>>> UefiDebugLibConOut.inf]
>>> consumed by [/home/nick/src/edk2/MdeModulePkg/Bus/Pci/
>>> SdMmcPciHcPei/SdMmcPciHcPei.inf]
>>
>> Hi,
>>
>> MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf lists
>> DXE_DRIVER in its [Defines] section under LIBRARY_CLASS, so it is
>> compatible with DXE_DRIVER module types (I have used it this way).
>> However, if I'm reading your output correctly, you are trying to build a
>> PEI module which is why you are getting the error. PEI is outside of my
>> knowledge.
>
> In the PEI phase, no such thing exists as "system console" (that's a
> UEFI construct), hence the fact that UefiDebugLibConOut (which prints to
> said console) rejects being linked into PEIMs (PEI modules) is justified.
>
> Again, a suitable DebugLib instance should be chosen (in the DSC file
> where the PEIM in question is listed too, resolving the DebugLib class
> for PEIMs), and DEBUG() macros should be used for logging.
>
The build system is very flexible and can be a bit confusing. I find it useful to generate a report by passing --report-file=REPORTFILE to the build command. This will generate a report that will tell you per driver what libraries actually got linked (include libraries that libraries depend on). it will show all the fixed PCD settings as visible to the driver. If an FV was constructed it will also show the Depex that determines dispatch order, and again this can be changed by the libraries that get used.
The idea behind the flexibility was that a chip or card vendor could write code using #include <Library/DebugLib.h> and link against DebugLib and it would work for any platform. Actually you could have multiple platforms in a single repository that share that code that all use different debug strategies, without the need to change chip or card vendor code. Thus we kind of had a push the configuration choices into the platform build kind of mind set.
Well the problem with flexibility is complexity, and that is what the build logs help with.
Thanks,
Andrew Fish
> Thanks
> Laszlo
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org <mailto:edk2-devel@lists.01.org>
> https://lists.01.org/mailman/listinfo/edk2-devel <https://lists.01.org/mailman/listinfo/edk2-devel>
next prev parent reply other threads:[~2017-02-16 18:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 17:55 DEBUG() macros in DXE driver: can’t make it work in QEMU Nikolay Bodunov
2017-02-14 18:16 ` Laszlo Ersek
2017-02-14 18:28 ` Kinney, Michael D
2017-02-14 22:06 ` Nikolay Bodunov
2017-02-14 22:17 ` David A. Van Arnem
2017-02-14 22:36 ` Nikolay Bodunov
2017-02-14 23:14 ` David A. Van Arnem
2017-02-14 23:46 ` Nikolay Bodunov
2017-02-15 0:00 ` David A. Van Arnem
2017-02-15 12:39 ` Laszlo Ersek
2017-02-16 18:05 ` Andrew Fish [this message]
2017-02-16 18:59 ` Laszlo Ersek
2017-02-15 10:13 ` Laszlo Ersek
2017-02-15 17:19 ` Nikolay Bodunov
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-list 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=F0DA204C-55AE-4B74-87DF-3A5C8B42FC3B@apple.com \
--to=devel@edk2.groups.io \
/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