From 425f8a4ec4fd5a1b2784927d0edc06e6384d5d2e Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Sat, 29 Aug 2015 15:59:14 +0200 Subject: [PATCH] Detect vtable changes from member function changes This patch adds vtable changes detection based on the detection of virtual member function changes. That is, when a member function changes, if that member function is virtual, then infer if the change implies changes to the vtable of the containing class. Before that patch, we were doing the vtable change detection when we were comparing two classes; we were then comparing their virtual member functions. But as for a given class all its virtual member functions are not necessarily emitted in the DWARF debug info (only the virtual member functions that are used in a given translation unit are emitted in that translation unit) it's not reliable to compare virtual member functions as part of comparing a given class. We thus decided some patches ago to stop comparing virtual member functions when we compare two classes. So with this patch now, we still detect changes to the vtable and emit an appropriate message to the user. * include/abg-ir.h (class_decl::{has_virtual_base, has_vtable}): Declare new member functions. * src/abg-comp-filter.cc (has_virtual_mem_fn_change): New overload for function_decl_diff. (has_virtual_mem_fn_change): In the overload for diff*, support virtual member function changes detection for function_decl_diff*. * src/abg-comparison.cc (function_decl_diff::report): Detect and report changes to a vtable by looking a changes that can happen to a given member function. (corpus_diff::report): Detect and report changes to vtables by looking at changes change to member functions. * tests/data/test-diff-dwarf/test29-vtable-changes-report-0.txt: New text input. * tests/data/test-diff-dwarf/test29-vtable-changes-v{0,1}.cc: Source code of new test input binaries. * tests/data/test-diff-dwarf/test29-vtable-changes-v{0,1}.o: New test input binaries. * tests/data/test-diff-dwarf/test30-vtable-changes-report-0.txt: New text input. * tests/data/test-diff-dwarf/test30-vtable-changes-v{0,1}.cc: New test input. * tests/data/test-diff-dwarf/test30-vtable-changes-v{0,1}.o: New test input binaries. * tests/data/test-diff-dwarf/test31-vtable-changes-report-0.txt: New test input. * tests/data/test-diff-dwarf/test31-vtable-changes-v{0,1}.cc: Source code of new test input binary. * tests/data/test-diff-dwarf/test31-vtable-changes-v{0,1}.o: New test input binary. * tests/data/Makefile.am: Add the new test input files above to source distribution. * tests/test-diff-dwarf.cc (in_out_specs): Consume the new test inputs above. Signed-off-by: Dodji Seketeli --- include/abg-ir.h | 6 ++ src/abg-comp-filter.cc | 43 +++++++++++++- src/abg-comparison.cc | 55 ++++++++++++++++++ src/abg-ir.cc | 37 +++++++++++- tests/data/Makefile.am | 15 +++++ .../test28-vtable-changes-report-0.txt | 3 + .../test29-vtable-changes-report-0.txt | 8 +++ .../test29-vtable-changes-v0.cc | 15 +++++ .../test29-vtable-changes-v0.o | Bin 0 -> 5048 bytes .../test29-vtable-changes-v1.cc | 20 +++++++ .../test29-vtable-changes-v1.o | Bin 0 -> 5368 bytes .../test30-vtable-changes-report-0.txt | 15 +++++ .../test30-vtable-changes-v0.cc | 20 +++++++ .../test30-vtable-changes-v0.o | Bin 0 -> 5368 bytes .../test30-vtable-changes-v1.cc | 25 ++++++++ .../test30-vtable-changes-v1.o | Bin 0 -> 5784 bytes .../test31-vtable-changes-report-0.txt | 16 +++++ .../test31-vtable-changes-v0.cc | 20 +++++++ .../test31-vtable-changes-v0.o | Bin 0 -> 5368 bytes .../test31-vtable-changes-v1.cc | 15 +++++ .../test31-vtable-changes-v1.o | Bin 0 -> 5048 bytes tests/test-diff-dwarf.cc | 18 ++++++ 22 files changed, 328 insertions(+), 3 deletions(-) create mode 100644 tests/data/test-diff-dwarf/test29-vtable-changes-report-0.txt create mode 100644 tests/data/test-diff-dwarf/test29-vtable-changes-v0.cc create mode 100644 tests/data/test-diff-dwarf/test29-vtable-changes-v0.o create mode 100644 tests/data/test-diff-dwarf/test29-vtable-changes-v1.cc create mode 100644 tests/data/test-diff-dwarf/test29-vtable-changes-v1.o create mode 100644 tests/data/test-diff-dwarf/test30-vtable-changes-report-0.txt create mode 100644 tests/data/test-diff-dwarf/test30-vtable-changes-v0.cc create mode 100644 tests/data/test-diff-dwarf/test30-vtable-changes-v0.o create mode 100644 tests/data/test-diff-dwarf/test30-vtable-changes-v1.cc create mode 100644 tests/data/test-diff-dwarf/test30-vtable-changes-v1.o create mode 100644 tests/data/test-diff-dwarf/test31-vtable-changes-report-0.txt create mode 100644 tests/data/test-diff-dwarf/test31-vtable-changes-v0.cc create mode 100644 tests/data/test-diff-dwarf/test31-vtable-changes-v0.o create mode 100644 tests/data/test-diff-dwarf/test31-vtable-changes-v1.cc create mode 100644 tests/data/test-diff-dwarf/test31-vtable-changes-v1.o diff --git a/include/abg-ir.h b/include/abg-ir.h index 9ed9fc84..cf0c265b 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -2757,6 +2757,12 @@ public: bool has_virtual_member_functions() const; + bool + has_virtual_bases() const; + + bool + has_vtable() const; + virtual size_t get_hash() const; diff --git a/src/abg-comp-filter.cc b/src/abg-comp-filter.cc index 7c49a961..0a06a339 100644 --- a/src/abg-comp-filter.cc +++ b/src/abg-comp-filter.cc @@ -544,6 +544,44 @@ has_virtual_mem_fn_change(const class_diff* diff) return false; } +/// Test if the function_decl_diff node has a change involving virtual +/// member functions. +/// +/// That means whether there is an added, removed or changed virtual +/// member function. +/// +/// @param diff the function_decl_diff node to consider. +/// +/// @return true iff the function_decl_diff node contains changes +/// involving virtual member functions. +static bool +has_virtual_mem_fn_change(const function_decl_diff* diff) +{ + if (!diff) + return false; + + function_decl_sptr ff = diff->first_function_decl(), + sf = diff->second_function_decl(); + + if (!is_member_function(ff) + || !is_member_function(sf)) + return false; + + bool ff_is_virtual = get_member_function_is_virtual(ff), + sf_is_virtual = get_member_function_is_virtual(sf); + + if (ff_is_virtual != sf_is_virtual) + return true; + + size_t ff_vtable_offset = get_member_function_vtable_offset(ff), + sf_vtable_offset = get_member_function_vtable_offset(sf); + + if (ff_vtable_offset != sf_vtable_offset) + return true; + + return false; +} + /// Test if the class_diff node has a change involving virtual member /// functions. /// @@ -556,7 +594,10 @@ has_virtual_mem_fn_change(const class_diff* diff) /// virtual member functions. static bool has_virtual_mem_fn_change(const diff* diff) -{return has_virtual_mem_fn_change(dynamic_cast(diff));} +{ + return (has_virtual_mem_fn_change(dynamic_cast(diff)) + || has_virtual_mem_fn_change(dynamic_cast(diff))); +} /// Test if the class_diff has changes to non virtual member /// functions. diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc index 124c0222..53f2e8ec 100644 --- a/src/abg-comparison.cc +++ b/src/abg-comparison.cc @@ -11608,6 +11608,41 @@ function_decl_diff::report(ostream& out, const string& indent) const << " changed from " << ff_vtable_offset << " to " << sf_vtable_offset << "\n"; } + + // the classes of the two member functions. + class_decl_sptr fc = is_method_type(ff->get_type())->get_class_type(), + sc = is_method_type(sf->get_type())->get_class_type(); + + // Detect if the virtual member function changes above + // introduced a vtable change or not. + bool vtable_added = !fc->has_vtable() && sc->has_vtable(); + bool vtable_removed = fc->has_vtable() && !sc->has_vtable(); + bool vtable_changed = ((ff_is_virtual != sf_is_virtual) + || (ff_vtable_offset != sf_vtable_offset)); + bool incompatible_change = (ff_vtable_offset != sf_vtable_offset); + + if (vtable_added) + out << indent + << " note that a vtable was added to " + << fc->get_pretty_representation() + << "\n"; + else if (vtable_removed) + out << indent + << " note that the vtable was removed from " + << fc->get_pretty_representation() + << "\n"; + else if (vtable_changed) + { + out << indent; + if (incompatible_change) + out << " note that this is an ABI incompatible " + "change to the vtable of "; + else + out << " note that this induces a change to the vtable of "; + out << fc->get_pretty_representation() + << "\n"; + } + } // Report about function type differences. @@ -14392,6 +14427,16 @@ corpus_diff::report(ostream& out, const string& indent) const out << "}"; } out << "\n"; + if (is_member_function(*i) && get_member_function_is_virtual(*i)) + { + class_decl_sptr c = + is_method_type((*i)->get_type())->get_class_type(); + out << indent + << " " + << "note that this removes an entry from the vtable of " + << c->get_pretty_representation() + << "\n"; + } ++removed; } if (removed) @@ -14431,6 +14476,16 @@ corpus_diff::report(ostream& out, const string& indent) const out << "}"; } out << "\n"; + if (is_member_function(*i) && get_member_function_is_virtual(*i)) + { + class_decl_sptr c = + is_method_type((*i)->get_type())->get_class_type(); + out << indent + << " " + << "note that this adds a new entry to the vtable of " + << c->get_pretty_representation() + << "\n"; + } ++added; } if (added) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index d83fce5c..34b2340c 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -10217,12 +10217,45 @@ class_decl::has_no_base_nor_member() const /// Test if the current instance of @ref class_decl has virtual member /// functions. /// -/// @return true the current instance of @ref class_decl has virtual -/// member functions. +/// @return true iff the current instance of @ref class_decl has +/// virtual member functions. bool class_decl::has_virtual_member_functions() const {return !get_virtual_mem_fns().empty();} +/// Test if the current instance of @ref class_decl has at least one +/// virtual base. +/// +/// @return true iff the current instance of @ref class_decl has a +/// virtual member function. +bool +class_decl::has_virtual_bases() const +{ + for (base_specs::const_iterator b = get_base_specifiers().begin(); + b != get_base_specifiers().end(); + ++b) + if ((*b)->get_is_virtual() + || (*b)->get_base_class()->has_virtual_bases()) + return true; + + return false; +} + +/// Test if the current instance has a vtable. +/// +/// This is only valid for a C++ program. +/// +/// Basically this function checks if the class has either virtual +/// functions, or virtual bases. +bool +class_decl::has_vtable() const +{ + if (has_virtual_member_functions() + || has_virtual_bases()) + return true; + return false; +} + /// Return the hash value for the current instance. /// /// @return the hash value. diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 65655e09..98ef3af1 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -220,6 +220,21 @@ test-diff-dwarf/test28-vtable-changes-v0.o \ test-diff-dwarf/test28-vtable-changes-v1.o \ test-diff-dwarf/test28-vtable-changes-v0.cc \ test-diff-dwarf/test28-vtable-changes-v1.cc \ +test-diff-dwarf/test29-vtable-changes-report-0.txt \ +test-diff-dwarf/test29-vtable-changes-v0.cc \ +test-diff-dwarf/test29-vtable-changes-v0.o \ +test-diff-dwarf/test29-vtable-changes-v1.cc \ +test-diff-dwarf/test29-vtable-changes-v1.o \ +test-diff-dwarf/test30-vtable-changes-report-0.txt \ +test-diff-dwarf/test30-vtable-changes-v0.cc \ +test-diff-dwarf/test30-vtable-changes-v0.o \ +test-diff-dwarf/test30-vtable-changes-v1.cc \ +test-diff-dwarf/test30-vtable-changes-v1.o \ +test-diff-dwarf/test31-vtable-changes-report-0.txt \ +test-diff-dwarf/test31-vtable-changes-v0.cc \ +test-diff-dwarf/test31-vtable-changes-v0.o \ +test-diff-dwarf/test31-vtable-changes-v1.cc \ +test-diff-dwarf/test31-vtable-changes-v1.o \ \ test-read-dwarf/test0 \ test-read-dwarf/test0.abi \ diff --git a/tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt b/tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt index b568427f..e324ff45 100644 --- a/tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt +++ b/tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt @@ -6,12 +6,15 @@ Variable symbols changes summary: 0 Removed, 3 Added variable symbols not refere 2 Added functions: 'method virtual S::~S(int)' + note that this adds a new entry to the vtable of struct S 'method virtual S::~S(int)' + note that this adds a new entry to the vtable of struct S 1 function with some indirect sub-type change: [C]'method void S::bar()' has some indirect sub-type changes: method void S::bar() is now declared virtual + note that a vtable was added to struct S 3 Added variable symbols not referenced by debug info: diff --git a/tests/data/test-diff-dwarf/test29-vtable-changes-report-0.txt b/tests/data/test-diff-dwarf/test29-vtable-changes-report-0.txt new file mode 100644 index 00000000..fc80348a --- /dev/null +++ b/tests/data/test-diff-dwarf/test29-vtable-changes-report-0.txt @@ -0,0 +1,8 @@ +Functions changes summary: 0 Removed, 0 Changed, 1 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +1 Added function: + + 'method virtual void S::fn1()' + note that this adds a new entry to the vtable of struct S + diff --git a/tests/data/test-diff-dwarf/test29-vtable-changes-v0.cc b/tests/data/test-diff-dwarf/test29-vtable-changes-v0.cc new file mode 100644 index 00000000..5f1c12cc --- /dev/null +++ b/tests/data/test-diff-dwarf/test29-vtable-changes-v0.cc @@ -0,0 +1,15 @@ +// Compile this with : +// gcc -g -Wall -c test29-vtable-changes-v0.cc + +struct S +{ + virtual ~S(); + virtual void fn0(); +}; + +S::~S() +{} + +void +S::fn0() +{} diff --git a/tests/data/test-diff-dwarf/test29-vtable-changes-v0.o b/tests/data/test-diff-dwarf/test29-vtable-changes-v0.o new file mode 100644 index 0000000000000000000000000000000000000000..4f50dd102debd56f331fc325f38d9c9366d8b6fe GIT binary patch literal 5048 zcmb_fTWl0n7(TPp%eLDt+pZ`TOqQrv0z2)N%1thnTDvvSAf*Nyb-R~ocVREh?obK| z8ZllPjlpQV@<5_5B>F7D7Yq+XU-ZQXW7H>&4?f6)5u*wI-JhQ5PQUm#HbJpZ7ckUWJkn0(I;(#B*UjuwO!OsCzpRnKKFAZxqSM1 z^5wDX$*TkkaS^ZQFFRclTfX`eqgbOzzlH3s=(dOoM88$zA=0#X2E`DWVn>lS8sBDy^^+(!dw8GHN8Ahi2QzpF1NZCYE!L=^hA6@59p zKXhP?YeS>A+L(~0!8Me;;~o(T?FpGQbe*e+ouE7+FvvthXc^kuF|xj+gD-^LE*;7P2I!tJ(bS zrR`heTZd!uc_FLWLi+&q$jZPu`9e($A`U1g}`WcTY(G+gKig;L~{SIKE0xU z!d1(2Qm}r^)eEb3vP5%Dty6W|JabjMn6?~y$q^R%Ev!tfCM=0oD?qH&%;CrAB-618 ziPcS}>Lximb9|mgX|6&cC7;e@s`jFaprEQ;a}8LrP`25H$`e+$QYzVWVp-*iV_P)P z@tTv)9#c+sJ~dZOm&j$lS~r5%+yQ;{}ICc^8cdz z)G#WE&i*>*GWZ1h<)2mg2bDeYHR-&PK&A2$rW{*#31F$oe!)O`L5!9%(&E+;w$^8>2mJboNPw|$Wme)ad$cN)b0 zs2_8u*MFWcJtjfow92pVKi&2{vh~YG?k-3^BP*VkLc}^7A}0&iT2; zrOnU(J5?0!iC$tqZZDIPd9Pil)hn&=y6soWU)#R8BS~6Xag`kRpW!cw@f*JdHGWBD zi1DL4W7GIynd*B4E-$J4KSJ=3UO!~Lc9<{7>$DK(l@jMHO5*x?UONc$%OAmFBU*Nw z`diOmS7;3ETEw**8Z1TAcf?SK{uOb(P0{WbhU~dFjcU`qku-uNnWC!+17N!U9!)w^ ztZKq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b%?(F@EEBL5<&pGQ{}N zb+l&uu+8;70+(KOp#BWOLwf#@_1t0JC2#fgkWxyVvvhT=X}^guzxJ*wu+YZfUR-P2Uki9{OLz^)`j)QRxY2R(j(Bi8b9D%VJRCEj1VbQ=Sa9DpSap zSdGH0IaOT~Q|^!&bBeDPgQhaYJsQGsuu^Kt6iaJCLd=>~?V6dsD+BhmGrodcIz98k z&%6f+U+EcV-sjM(CE_-wz7JFF7iYV|IWGR&pb;vt-zO#a9|Ly3!k^LbB*`m1^UFD8 z2xnfo$m(@zU!C_#&+l~0ci#f?V(wl<6XWUJ9)2UpmrCWeQ1gc1x6JrHTvu_E9gX)U z5~;a4dKk>c;~R<3CCg>`#F2N_Az0xuON2cN3Q@tT;XbVaNQCW-Rq*#MmmUX51RSf0 z@lk+8x;>v?*q=C)n7AF_-c`xxKXC7=j4DUqYy*h%1WxbR8Ul{9h}-k#gZm{Dp9Hvb z;EZD8nFJ1gl~Sndl3W?U-&8p77`FdN;hY=t!5A^ERSfJg2TWTO!*Mv*!y0~E$!9cN ziQ;n&=l*=B;U6mbM-8t>!bE?$Ri(c-mHdyY^?t2Zew_cS%I-mhvpw(6y&BH@Gq1(r yJWpu$yl>Cn#@;)>yatdGuM4<&=LP2nNXMfRb#1-&0~*f#n$U3W*GUcM{Qm{|$H(UY literal 0 HcmV?d00001 diff --git a/tests/data/test-diff-dwarf/test31-vtable-changes-v1.cc b/tests/data/test-diff-dwarf/test31-vtable-changes-v1.cc new file mode 100644 index 00000000..891804a5 --- /dev/null +++ b/tests/data/test-diff-dwarf/test31-vtable-changes-v1.cc @@ -0,0 +1,15 @@ +// Compile this with : +// gcc -g -Wall -c test31-vtable-changes-v1.cc + +struct S +{ + virtual ~S(); + virtual void fn1(); +}; + +S::~S() +{} + +void +S::fn1() +{} diff --git a/tests/data/test-diff-dwarf/test31-vtable-changes-v1.o b/tests/data/test-diff-dwarf/test31-vtable-changes-v1.o new file mode 100644 index 0000000000000000000000000000000000000000..b1e5d44f054b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PT5m1sTS4y+W6f2uSLQLNs0Nih70B@f0wG^kv zGcWvqbr0d|JmcJ_DuCW^6z;uAoV^O?xcF{^#^^!bBT{m|F<>X@S?8HY&V@TC^RQz& zOUydY{MLJTtNXfptCv@7_rjT;%9jq&-v$0O_RIea$>HAL@b@uw1XoeqQpb}6>2z*! zk*@U%$>et8OPN|t{*=i3=m@NEQB|al1ra70tAhK&EdP1KrG3PMfMc~VJ`Rvb zx91&!{fGM=6XyZ$U3Gj80LS^n6juyzwqYGw;QUR3?9Gd_hKYAH?hZI>n0O}w2ftn^ z)Ms1HJn(Z0=atX)?<$=8h9Z&3E Y5a)FzA>xXGt=E1?!@16B4d*)l0=P+^*#H0l literal 0 HcmV?d00001 diff --git a/tests/test-diff-dwarf.cc b/tests/test-diff-dwarf.cc index a078f907..e2220ce3 100644 --- a/tests/test-diff-dwarf.cc +++ b/tests/test-diff-dwarf.cc @@ -236,6 +236,24 @@ InOutSpec in_out_specs[] = "data/test-diff-dwarf/test28-vtable-changes-report-0.txt", "output/test-diff-dwarf/test28-vtable-changes-report-0.txt" }, + { + "data/test-diff-dwarf/test29-vtable-changes-v0.o", + "data/test-diff-dwarf/test29-vtable-changes-v1.o", + "data/test-diff-dwarf/test29-vtable-changes-report-0.txt", + "output/test-diff-dwarf/test29-vtable-changes-report-0.txt" + }, + { + "data/test-diff-dwarf/test30-vtable-changes-v0.o", + "data/test-diff-dwarf/test30-vtable-changes-v1.o", + "data/test-diff-dwarf/test30-vtable-changes-report-0.txt", + "output/test-diff-dwarf/test30-vtable-changes-report-0.txt" + }, + { + "data/test-diff-dwarf/test31-vtable-changes-v0.o", + "data/test-diff-dwarf/test31-vtable-changes-v1.o", + "data/test-diff-dwarf/test31-vtable-changes-report-0.txt", + "output/test-diff-dwarf/test31-vtable-changes-report-0.txt" + }, // This should be the last entry {NULL, NULL, NULL, NULL} }; -- 2.43.5