public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v3] ShellPkg/ShellCommandLib: Update DumpHex to print {|}~
@ 2017-04-26 19:59 Jeff Westfahl
  2017-04-26 21:11 ` Carsey, Jaben
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Westfahl @ 2017-04-26 19:59 UTC (permalink / raw)
  To: edk2-devel; +Cc: Jeff Westfahl, Ruiyu Ni, Jaben Carsey

ASCII characters {|}~ should be printed by DumpHex. The problem is that
if you have a string like

    {xizzy}~{foo|bar}~{quux}

in the dumped data, it will not appear as such in the *-delimited ASCII
column to the right, but as

    .xizzy...foo.bar...quux.

which is less than ideal.

Most of the commit message was inspired by/shamelessly stolen from
Laszlo's example:

    https://lists.01.org/pipermail/edk2-devel/2017-April/010266.html

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
---
 ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
index a2ebc8f..bd14878 100644
--- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
+++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
@@ -1745,7 +1745,7 @@ DumpHex (
       Val[Index * 3 + 0]  = Hex[TempByte >> 4];
       Val[Index * 3 + 1]  = Hex[TempByte & 0xF];
       Val[Index * 3 + 2]  = (CHAR8) ((Index == 7) ? '-' : ' ');
-      Str[Index]          = (CHAR8) ((TempByte < ' ' || TempByte > 'z') ? '.' : TempByte);
+      Str[Index]          = (CHAR8) ((TempByte < ' ' || TempByte > '~') ? '.' : TempByte);
     }
 
     Val[Index * 3]  = 0;
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] ShellPkg/ShellCommandLib: Update DumpHex to print {|}~
  2017-04-26 19:59 [PATCH v3] ShellPkg/ShellCommandLib: Update DumpHex to print {|}~ Jeff Westfahl
@ 2017-04-26 21:11 ` Carsey, Jaben
  2017-05-03 13:34   ` Jeff Westfahl
  0 siblings, 1 reply; 3+ messages in thread
From: Carsey, Jaben @ 2017-04-26 21:11 UTC (permalink / raw)
  To: Jeff Westfahl, edk2-devel@lists.01.org; +Cc: Ni, Ruiyu

That makes sense. When I wrote that I was unsure where to draw the line between which characters to print and which to replace.

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----Original Message-----
> From: Jeff Westfahl [mailto:jeff.westfahl@ni.com]
> Sent: Wednesday, April 26, 2017 12:59 PM
> To: edk2-devel@lists.01.org
> Cc: Jeff Westfahl <jeff.westfahl@ni.com>; Ni, Ruiyu <ruiyu.ni@intel.com>;
> Carsey, Jaben <jaben.carsey@intel.com>
> Subject: [edk2][PATCH v3] ShellPkg/ShellCommandLib: Update DumpHex to
> print {|}~
> Importance: High
> 
> ASCII characters {|}~ should be printed by DumpHex. The problem is that
> if you have a string like
> 
>     {xizzy}~{foo|bar}~{quux}
> 
> in the dumped data, it will not appear as such in the *-delimited ASCII
> column to the right, but as
> 
>     .xizzy...foo.bar...quux.
> 
> which is less than ideal.
> 
> Most of the commit message was inspired by/shamelessly stolen from
> Laszlo's example:
> 
>     https://lists.01.org/pipermail/edk2-devel/2017-April/010266.html
> 
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jaben Carsey <jaben.carsey@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
> b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
> index a2ebc8f..bd14878 100644
> --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
> +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
> @@ -1745,7 +1745,7 @@ DumpHex (
>        Val[Index * 3 + 0]  = Hex[TempByte >> 4];
>        Val[Index * 3 + 1]  = Hex[TempByte & 0xF];
>        Val[Index * 3 + 2]  = (CHAR8) ((Index == 7) ? '-' : ' ');
> -      Str[Index]          = (CHAR8) ((TempByte < ' ' || TempByte > 'z') ? '.' :
> TempByte);
> +      Str[Index]          = (CHAR8) ((TempByte < ' ' || TempByte > '~') ? '.' :
> TempByte);
>      }
> 
>      Val[Index * 3]  = 0;
> --
> 2.7.4



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] ShellPkg/ShellCommandLib: Update DumpHex to print {|}~
  2017-04-26 21:11 ` Carsey, Jaben
@ 2017-05-03 13:34   ` Jeff Westfahl
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Westfahl @ 2017-05-03 13:34 UTC (permalink / raw)
  To: Carsey, Jaben; +Cc: Jeff Westfahl, edk2-devel@lists.01.org, Ni, Ruiyu

Ray, do you agree? If so, can you please push this?

Thank you,
Jeff

On Wed, 26 Apr 2017, Carsey, Jaben wrote:

> That makes sense. When I wrote that I was unsure where to draw the line between which characters to print and which to replace.
>
> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
>
>> -----Original Message-----
>> From: Jeff Westfahl [mailto:jeff.westfahl@ni.com]
>> Sent: Wednesday, April 26, 2017 12:59 PM
>> To: edk2-devel@lists.01.org
>> Cc: Jeff Westfahl <jeff.westfahl@ni.com>; Ni, Ruiyu <ruiyu.ni@intel.com>;
>> Carsey, Jaben <jaben.carsey@intel.com>
>> Subject: [edk2][PATCH v3] ShellPkg/ShellCommandLib: Update DumpHex to
>> print {|}~
>> Importance: High
>>
>> ASCII characters {|}~ should be printed by DumpHex. The problem is that
>> if you have a string like
>>
>>     {xizzy}~{foo|bar}~{quux}
>>
>> in the dumped data, it will not appear as such in the *-delimited ASCII
>> column to the right, but as
>>
>>     .xizzy...foo.bar...quux.
>>
>> which is less than ideal.
>>
>> Most of the commit message was inspired by/shamelessly stolen from
>> Laszlo's example:
>>
>>     https://lists.01.org/pipermail/edk2-devel/2017-April/010266.html
>>
>> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
>> Cc: Jaben Carsey <jaben.carsey@intel.com>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
>> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
>> b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
>> index a2ebc8f..bd14878 100644
>> --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
>> +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
>> @@ -1745,7 +1745,7 @@ DumpHex (
>>        Val[Index * 3 + 0]  = Hex[TempByte >> 4];
>>        Val[Index * 3 + 1]  = Hex[TempByte & 0xF];
>>        Val[Index * 3 + 2]  = (CHAR8) ((Index == 7) ? '-' : ' ');
>> -      Str[Index]          = (CHAR8) ((TempByte < ' ' || TempByte > 'z') ? '.' :
>> TempByte);
>> +      Str[Index]          = (CHAR8) ((TempByte < ' ' || TempByte > '~') ? '.' :
>> TempByte);
>>      }
>>
>>      Val[Index * 3]  = 0;
>> --
>> 2.7.4
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-03 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-26 19:59 [PATCH v3] ShellPkg/ShellCommandLib: Update DumpHex to print {|}~ Jeff Westfahl
2017-04-26 21:11 ` Carsey, Jaben
2017-05-03 13:34   ` Jeff Westfahl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox