diff mbox series

[abisym] Remove leading space in output.

Message ID 20200310103113.54010-1-gprocida@google.com
State Committed
Headers show
Series [abisym] Remove leading space in output. | expand

Commit Message

Giuliano Procida March 10, 2020, 10:31 a.m. UTC
When abisym reports a symbol as found, it currently emits a leading
space. It does not do this when reporting a symbol as not found.

This patch removes the leading space.

	* tools/abisym.cc (main): Remove leading space from output.
	* tests/data/test-lookup-syms/test0-report.txt: Remove leading
	space from expected output.
	* tests/data/test-lookup-syms/test01-report.txt: Ditto.
	* tests/data/test-lookup-syms/test02-report.txt: Ditto.
	* tests/data/test-lookup-syms/test1-1-report.txt: Ditto.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 tests/data/test-lookup-syms/test0-report.txt   | 2 +-
 tests/data/test-lookup-syms/test01-report.txt  | 2 +-
 tests/data/test-lookup-syms/test02-report.txt  | 2 +-
 tests/data/test-lookup-syms/test1-1-report.txt | 2 +-
 tools/abisym.cc                                | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

Comments

Matthias Maennich March 10, 2020, 12:50 p.m. UTC | #1
On Tue, Mar 10, 2020 at 10:31:13AM +0000, Android Kernel Team wrote:
>When abisym reports a symbol as found, it currently emits a leading
>space. It does not do this when reporting a symbol as not found.
>
>This patch removes the leading space.
>
>	* tools/abisym.cc (main): Remove leading space from output.
>	* tests/data/test-lookup-syms/test0-report.txt: Remove leading
>	space from expected output.
>	* tests/data/test-lookup-syms/test01-report.txt: Ditto.
>	* tests/data/test-lookup-syms/test02-report.txt: Ditto.
>	* tests/data/test-lookup-syms/test1-1-report.txt: Ditto.
>
>Signed-off-by: Giuliano Procida <gprocida@google.com>

Reviewed-by: Matthias Maennich <maennich@google.com>

Cheers,
Matthias
>---
> tests/data/test-lookup-syms/test0-report.txt   | 2 +-
> tests/data/test-lookup-syms/test01-report.txt  | 2 +-
> tests/data/test-lookup-syms/test02-report.txt  | 2 +-
> tests/data/test-lookup-syms/test1-1-report.txt | 2 +-
> tools/abisym.cc                                | 2 +-
> 5 files changed, 5 insertions(+), 5 deletions(-)
>
>diff --git a/tests/data/test-lookup-syms/test0-report.txt b/tests/data/test-lookup-syms/test0-report.txt
>index 51042d4a..2806123f 100644
>--- a/tests/data/test-lookup-syms/test0-report.txt
>+++ b/tests/data/test-lookup-syms/test0-report.txt
>@@ -1 +1 @@
>- found symbol 'main', an instance of function symbol type of global binding
>+found symbol 'main', an instance of function symbol type of global binding
>diff --git a/tests/data/test-lookup-syms/test01-report.txt b/tests/data/test-lookup-syms/test01-report.txt
>index ba8f909e..ce80129e 100644
>--- a/tests/data/test-lookup-syms/test01-report.txt
>+++ b/tests/data/test-lookup-syms/test01-report.txt
>@@ -1 +1 @@
>- found symbol 'foo', an instance of function symbol type of global binding
>+found symbol 'foo', an instance of function symbol type of global binding
>diff --git a/tests/data/test-lookup-syms/test02-report.txt b/tests/data/test-lookup-syms/test02-report.txt
>index b374d17e..d5e29945 100644
>--- a/tests/data/test-lookup-syms/test02-report.txt
>+++ b/tests/data/test-lookup-syms/test02-report.txt
>@@ -1 +1 @@
>- found symbol 'bar(char)' (_Z3barc), an instance of function symbol type of global binding
>+found symbol 'bar(char)' (_Z3barc), an instance of function symbol type of global binding
>diff --git a/tests/data/test-lookup-syms/test1-1-report.txt b/tests/data/test-lookup-syms/test1-1-report.txt
>index 15a3d416..2904c6d2 100644
>--- a/tests/data/test-lookup-syms/test1-1-report.txt
>+++ b/tests/data/test-lookup-syms/test1-1-report.txt
>@@ -1 +1 @@
>- found symbol 'foo', an instance of function symbol type of global binding, of versions 'VERSION_2.0', 'VERSION_1.0'
>+found symbol 'foo', an instance of function symbol type of global binding, of versions 'VERSION_2.0', 'VERSION_1.0'
>diff --git a/tools/abisym.cc b/tools/abisym.cc
>index da24f72a..2da45b41 100644
>--- a/tools/abisym.cc
>+++ b/tools/abisym.cc
>@@ -159,7 +159,7 @@ main(int argc, char* argv[])
>     }
>
>   elf_symbol_sptr sym = syms[0];
>-  cout << " found symbol '" << n << "'";
>+  cout << "found symbol '" << n << "'";
>   if (n != sym->get_name())
>     cout << " (" << sym->get_name() << ")";
>   cout << ", an instance of "
>-- 
>2.25.1.481.gfbce0eb801-goog
>
>
Dodji Seketeli March 11, 2020, 8:18 a.m. UTC | #2
Hello Giuliano,

Giuliano Procida <gprocida@google.com> a ?crit:

> When abisym reports a symbol as found, it currently emits a leading
> space. It does not do this when reporting a symbol as not found.
>
> This patch removes the leading space.
>
> 	* tools/abisym.cc (main): Remove leading space from output.
> 	* tests/data/test-lookup-syms/test0-report.txt: Remove leading
> 	space from expected output.
> 	* tests/data/test-lookup-syms/test01-report.txt: Ditto.
> 	* tests/data/test-lookup-syms/test02-report.txt: Ditto.
> 	* tests/data/test-lookup-syms/test1-1-report.txt: Ditto.

This looks good to me and I have applied it to master.

I have just edited the short line of the commit log to prefix it with
"abysym:".

Thanks!

Cheers,
diff mbox series

Patch

diff --git a/tests/data/test-lookup-syms/test0-report.txt b/tests/data/test-lookup-syms/test0-report.txt
index 51042d4a..2806123f 100644
--- a/tests/data/test-lookup-syms/test0-report.txt
+++ b/tests/data/test-lookup-syms/test0-report.txt
@@ -1 +1 @@ 
- found symbol 'main', an instance of function symbol type of global binding
+found symbol 'main', an instance of function symbol type of global binding
diff --git a/tests/data/test-lookup-syms/test01-report.txt b/tests/data/test-lookup-syms/test01-report.txt
index ba8f909e..ce80129e 100644
--- a/tests/data/test-lookup-syms/test01-report.txt
+++ b/tests/data/test-lookup-syms/test01-report.txt
@@ -1 +1 @@ 
- found symbol 'foo', an instance of function symbol type of global binding
+found symbol 'foo', an instance of function symbol type of global binding
diff --git a/tests/data/test-lookup-syms/test02-report.txt b/tests/data/test-lookup-syms/test02-report.txt
index b374d17e..d5e29945 100644
--- a/tests/data/test-lookup-syms/test02-report.txt
+++ b/tests/data/test-lookup-syms/test02-report.txt
@@ -1 +1 @@ 
- found symbol 'bar(char)' (_Z3barc), an instance of function symbol type of global binding
+found symbol 'bar(char)' (_Z3barc), an instance of function symbol type of global binding
diff --git a/tests/data/test-lookup-syms/test1-1-report.txt b/tests/data/test-lookup-syms/test1-1-report.txt
index 15a3d416..2904c6d2 100644
--- a/tests/data/test-lookup-syms/test1-1-report.txt
+++ b/tests/data/test-lookup-syms/test1-1-report.txt
@@ -1 +1 @@ 
- found symbol 'foo', an instance of function symbol type of global binding, of versions 'VERSION_2.0', 'VERSION_1.0'
+found symbol 'foo', an instance of function symbol type of global binding, of versions 'VERSION_2.0', 'VERSION_1.0'
diff --git a/tools/abisym.cc b/tools/abisym.cc
index da24f72a..2da45b41 100644
--- a/tools/abisym.cc
+++ b/tools/abisym.cc
@@ -159,7 +159,7 @@  main(int argc, char* argv[])
     }
 
   elf_symbol_sptr sym = syms[0];
-  cout << " found symbol '" << n << "'";
+  cout << "found symbol '" << n << "'";
   if (n != sym->get_name())
     cout << " (" << sym->get_name() << ")";
   cout << ", an instance of "