Re: [edk2] Formatted Print issues...

Subject: Re: [edk2] Formatted Print issues...

From: Andrew Fish <afish@apple.com>

To: edk2-devel@lists.sourceforge.net

Date: 2010-10-22 16:08:43

On the %d or %x front try casting the numbers to UINTN as in EFI %d and %x =
mean UINTN.  When I ported to gcc I noticed some places where prints are br=
oken in the shell due to not casting to UINTN. =


UINT32 Reg;

Print (L"Reg =3D 0x%x\n", (UINTN)Reg); =



On the ASSERT front I've never seen that. Prior to porting to gcc there was=
 an issue in the code base where there was code that casted to a VA_LIST. P=
er ANSI C a VA_LIST does not have to be a pointer and can be a structure. F=
or example on ARM and gcc X64 a VA_LIST is a structure. So it could be you =
have a miss match with you target? =


Andrew Fish





On Oct 22, 2010, at 7:46 AM, Will Marone wrote:

>  All,
> =

> I'm working my way into understanding UEFI in the process of creating a d=
river, =

> and I've run into a bit of a stumbling block. I'm trying to print some va=
lues for =

> debugging purposes (output of PCI registers) and whenever I attempt a bas=
ic =

> Print() call, any % formatting entries get garbled.
> =

> This is true for my own code, as well as unmodified EDK II code that I ha=
ve =

> compiled (such as  output from ASSERT statements, that list status codes =
and line =

> numbers but fail to print readable codes and line numbers.)
> =

> For instance:
> =

> ASSERT_EFI_ERROR (Status =3D =FF=F3=EE)
> ASSERT /home/wmarone/uefi/edk2/MdeModulePkg/Library/DxeDpcLib/DpcLib.c(=
=FF=FF): =

> !EFI_ERROR (Status)
> =

> This happens to numbers I attempt to print via %d or %x, but not to strin=
gs.
> =

> Does anyone have an idea as to why my prints would be munged so badly?
> =

> My build environment is as follows:
> =

> Host:
> VirtualBox 3.2.4
> Ubuntu 9.10 x86
> GCC 4.4.1 (Ubuntu 4.4.1-4ubuntu9)
> =

> Target:
> X64 Intel Xeon 5504
> Intel S5500HCVR
> =

> Thanks,
> Will
> =

> -------------------------------------------------------------------------=
-----
> Nokia and AT&T present the 2010 Calling All Innovators-North America cont=
est
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in market=
ing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store =

> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel


---------------------------------------------------------------------------=
---
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store =

http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel