[Bug default/26672] detection of changes to an abstract base class
dodji at redhat dot com
sourceware-bugzilla@sourceware.org
Tue Sep 29 15:23:04 GMT 2020
https://sourceware.org/bugzilla/show_bug.cgi?id=26672
--- Comment #5 from dodji at redhat dot com ---
"jiyong at google dot com" <sourceware-bugzilla@sourceware.org> writes:
> Thanks a lot! That worked.
Cool!
> I have one complaint though (sorry!).
No problem :-)
> In your modified example, it looks like
> the existence of `void foo(MyClass&){}` is the critical part. When I had that
> in the source files, `-femit-class-debug-always` wasn't actually needed. When I
> omit the function definition, the flag was useless.
Right.
> It looks like I need at least one function or a variable that ...
>
> 1) is defined outside of the class def and
> 2) has MyClass in its signature
In summary, it must be a function or a variable which ELF symbol is
publicly exported by the binary, and which uses the type (class) in its
signature, indeed.
In other words, the type must be part of the ABI of the binary, for it
to be taken into account in the analysis. By default, we try to make it
so that the analysis doesn't take into account types that are 'internal'
to the binary, from an ABI standpoint.
>
> A few experiments:
>
> -------- DIDN'T WORK---------------
> class MyClass {
> ...
> void foo(){} // doesn't have MyClass in the signature
> };
>
> -------- DIDN'T WORK---------------
> class MyClass {
> ...
> void foo(MyClass*){} // inline definition
> };
>
> -------- WORKED ---------------
> class MyClass {
> ...
> void foo(MyClass*);
> };
> void MyClass::foo(MyClass*){} // has MyClass as signature, and defined outside
> of the class
>
>
> -------- DIDN'T WORK---------------
> class MyClass {
> ...
> void foo();
> };
> void MyClass::foo() {} // defined outside of the class, but doesn't have
> MyClass as signature
>
> -------- WORKED ---------------
> class MyClass {
> ...
> };
> void foo(MyClass*){} // your example
These examples does seem to make sense to me.
Is this suprising to you? How would you want it to be otherwise?
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Libabigail
mailing list