<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Zhe,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 25, 2019 at 2:58 PM <<a href="mailto:zhe.he@windriver.com">zhe.he@windriver.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: He Zhe <<a href="mailto:zhe.he@windriver.com" target="_blank">zhe.he@windriver.com</a>><br>
<br>
The latest nm v2.33.1.20191208 outputs symbols addresses without prefix zeros<br>
for "nm -f posix", which causes the following error.<br>
nm01 5 TFAIL: Got wrong format with -f bsd<br>
<br>
Let's remove the prefix zeros before comparing.<br>
<br>
Signed-off-by: He Zhe <<a href="mailto:zhe.he@windriver.com" target="_blank">zhe.he@windriver.com</a>><br>
---<br>
testcases/commands/nm/nm01.sh | 3 +++<br>
1 file changed, 3 insertions(+)<br>
<br>
diff --git a/testcases/commands/nm/nm01.sh b/testcases/commands/nm/nm01.sh<br>
index 30c41bd..29b6bd7 100755<br>
--- a/testcases/commands/nm/nm01.sh<br>
+++ b/testcases/commands/nm/nm01.sh<br>
@@ -84,6 +84,9 @@ test5()<br>
EXPECT_PASS $NM -f bsd $TST_DATAROOT/f1 \> nm_bsd.out<br>
EXPECT_PASS $NM -f posix $TST_DATAROOT/f1 \> nm_posix.out<br>
<br>
+ ROD awk '{print gensub(/(0+)([0-9a-fA-F]+)/, "\\2", "g")}' nm_bsd.out \> nm_bsd.out<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">AWK is base on stream editing, maybe we need the output to a new log file.</div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+ ROD awk '{print gensub(/(0+)([0-9a-fA-F]+)/, "\\2", "g")}' nm_posix.out \> nm_posix.out<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">The regex is not fit for nm_posix.out since this format of address does not start with 0000000000, e.g.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"># cat nm_posix.out | grep 40108f<br>.annobin_init.c t 40108f <br>.annobin_init.c_end t 40108f <br></div><div class="gmail_default" style="font-size:small"><br></div># echo 40108f |<span class="gmail_default" style="font-size:small"> </span>awk '{print gensub(/(0+)([0-9a-fA-F]+)/, "\\2", "g")}'<br>4108f<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
ROD awk '{print $3 $2 $1}' nm_bsd.out \> nm1.out<br>
ROD awk '{print $1 $2 $3}' nm_posix.out \> nm2.out<br>
<br>
-- <br>
2.7.4<br>
<br>
<br>
-- <br>
Mailing list info: <a href="https://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">https://lists.linux.it/listinfo/ltp</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>