]> sourceware.org Git - libabigail.git/commitdiff
Spit and polish variables presentation in diff report
authorDodji Seketeli <dodji@redhat.com>
Sat, 1 Nov 2014 10:15:37 +0000 (11:15 +0100)
committerDodji Seketeli <dodji@redhat.com>
Sat, 1 Nov 2014 11:15:14 +0000 (12:15 +0100)
* src/abg-comparison.cc (corpus_diff::report): Show the full
representation of the variable, rather than just its name.  Also,
show the new representation of the variable only if it has
changed.
* tests/data/test-diff-dwarf/test9-report.txt: Adjust test.
* tests/data/test-diff-filter/test15-0-report.txt: Likewise.
* tests/data/test-diff-filter/test15-1-report.txt: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-comparison.cc
tests/data/test-diff-dwarf/test9-report.txt
tests/data/test-diff-filter/test15-0-report.txt
tests/data/test-diff-filter/test15-1-report.txt

index 0d76d3ba485988ab10d8b4b5a402e1a218c4b49a..c90255d75a6322c12a9f61f401bc6436b4a02a06 100644 (file)
@@ -9662,21 +9662,13 @@ corpus_diff::report(ostream& out, const string& indent) const
          if (!diff->to_be_reported())
            continue;
 
-         if (!f->get_linkage_name().empty())
-           n1 = demangle_cplus_mangled_name(f->get_linkage_name());
-         else
-           n1 = f->get_pretty_representation();
-
-         if (!s->get_linkage_name().empty())
-           n2 = demangle_cplus_mangled_name(s->get_linkage_name());
-         else
-           n2 = s->get_pretty_representation();
+         n1 = f->get_pretty_representation();
+         n2 = s->get_pretty_representation();
 
-         out << indent << "  '"
-             << n1
-             << "' was changed to '"
-             << n2
-             << "':\n";
+         out << indent << "  '" << n1 << "' was changed";
+         if (n1 != n2)
+           out << " to '" << n2 << "'";
+         out << ":\n";
          diff->report(out, indent + "    ");
        }
       if (num_changed)
index 0a234aaf2ed421a4a6d7719d6b56acf7fe964a01..8e04eabc38d78e833e47384031c7adb0de514051 100644 (file)
@@ -5,7 +5,7 @@ Variables changes summary: 0 Removed, 1 Changed, 1 Added variables
   'unsigned int global_var2'
 
 1 Changed variable:
-  'global_var0' was changed to 'global_var0':
+  'int global_var0' was changed to 'char global_var0':
     type of variable changed:
      name changed from 'int' to 'char'
      size changed from 32 to 8 bits
index 8ab3d2b26a399a306e778e9df002ccea44ad174e..783c9cf1c6c3bdc28388417141a5e1b49666d51c 100644 (file)
@@ -2,7 +2,7 @@ Functions changes summary: 0 Removed, 0 Changed, 0 Added function
 Variables changes summary: 0 Removed, 1 Changed (1 filtered out), 0 Added variable
 
 1 Changed variable:
-  'var1' was changed to 'var1':
+  'S* var1' was changed:
     type of variable changed:
      in pointed to type 'struct S':
        size changed from 64 to 96 bits
index 2586b238287e140bd40a5a7bf71be725aa0e156a..4c4cb6d238f42004ce244c0affd5d6049e951360 100644 (file)
@@ -3,13 +3,13 @@ Variables changes summary: 0 Removed, 2 Changed, 0 Added variables
 
 2 Changed variables:
 
-  'var1' was changed to 'var1':
+  'S* var1' was changed:
     type of variable changed:
      in pointed to type 'struct S':
        size changed from 64 to 96 bits
        1 data member insertion:
          'unsigned int S::m2', at offset 64 (in bits)
-  'var2' was changed to 'var2':
+  'S* var2' was changed:
     type of variable changed:
      pointed to type 'struct S' changed, as reported earlier
 
This page took 0.049284 seconds and 5 git commands to generate.