Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added new ABI mode to mono-api-info tool, wrapped in a mono-abi-info …

…script.

2010-08-05  Andrés G. Aragoneses  <andres@lindenlab.com>

* mcs/tools/corcompare/mono-api-info.cs: Implemented new mode to show ABI.
* mcs/tools/corcompare/Makefile: added mono-abi-info autofoo.
* scripts/.gitignore: added mono-abi-info.
* scripts/Makefile.am: added mono-abi-info autofoo.
  • Loading branch information...
commit c508a786c106ceff274b9b985919368b6b404342 1 parent 197285c
Andres G. Aragoneses knocte authored gonzalop committed
5 ChangeLog
View
@@ -1,3 +1,8 @@
+2010-08-05 Andrés G. Aragoneses <andres@lindenlab.com>
+
+ * scripts/.gitignore: added mono-abi-info.
+ * scripts/Makefile.am: added mono-abi-info autofoo.
+
2010-07-16 Zoltan Varga <vargaz@gmail.com>
* configure.in: Remove the 'LLVM backend is experimental' warning.
5 mcs/tools/corcompare/ChangeLog
View
@@ -1,3 +1,8 @@
+2010-08-05 Andrés G. Aragoneses <andres@lindenlab.com>
+
+ * mono-api-info.cs: Implemented new mode to show ABI.
+ * Makefile: added mono-abi-info autofoo.
+
2010-04-16 C.J. Adams-Collier <cjac@colliertech.org>
* mono-api-diff.cs: revived from the mono-2-2 branch and applied
5 mcs/tools/corcompare/Makefile
View
@@ -2,7 +2,7 @@ thisdir = tools/corcompare
SUBDIRS =
include ../../build/rules.make
-ALL_PROGRAMS = mono-api-info.exe
+ALL_PROGRAMS = mono-api-info.exe mono-abi-info.exe
CECIL = ../../class/lib/net_2_0/Mono.Cecil.dll
@@ -43,3 +43,6 @@ dist-local: dist-default
mono-api-info.exe: $(APIINFO_SOURCES)
$(CSCOMPILE) -r:$(CECIL) -out:$@ $^
+
+mono-abi-info.exe: $(APIINFO_SOURCES)
+ $(CSCOMPILE) -r:$(CECIL) -d:ABI -out:$@ $^
67 mcs/tools/corcompare/mono-api-info.cs
View
@@ -29,6 +29,9 @@ public static int Main (string [] args)
if (args.Length == 0)
return 1;
+ AbiMode = false;
+ SetAbiMode ();
+
AssemblyCollection acoll = new AssemblyCollection ();
foreach (string fullName in args) {
@@ -45,6 +48,14 @@ public static int Main (string [] args)
doc.WriteTo (writer);
return 0;
}
+
+ [System.Diagnostics.Conditional ("ABI")]
+ private static void SetAbiMode ()
+ {
+ AbiMode = true;
+ }
+
+ internal static bool AbiMode { get; private set; }
}
public class Utils {
@@ -211,7 +222,7 @@ public override void DoOutput ()
if (string.IsNullOrEmpty (t.Namespace))
continue;
- if ((t.Attributes & TypeAttributes.VisibilityMask) != TypeAttributes.Public)
+ if (!Driver.AbiMode && ((t.Attributes & TypeAttributes.VisibilityMask) != TypeAttributes.Public))
continue;
if (t.DeclaringType != null)
@@ -409,28 +420,31 @@ public override void DoOutput ()
AddAttribute (nclass, "enumtype", Utils.CleanupTypeName (value_type.FieldType));
}
- MethodDefinition [] ctors = GetConstructors (type);
- if (ctors.Length > 0) {
- Array.Sort (ctors, MemberReferenceComparer.Default);
- members.Add (new ConstructorData (document, nclass, ctors));
- }
+ if (!Driver.AbiMode) {
- PropertyDefinition[] properties = GetProperties (type);
- if (properties.Length > 0) {
- Array.Sort (properties, MemberReferenceComparer.Default);
- members.Add (new PropertyData (document, nclass, properties));
- }
+ MethodDefinition [] ctors = GetConstructors (type);
+ if (ctors.Length > 0) {
+ Array.Sort (ctors, MemberReferenceComparer.Default);
+ members.Add (new ConstructorData (document, nclass, ctors));
+ }
- EventDefinition [] events = GetEvents (type);
- if (events.Length > 0) {
- Array.Sort (events, MemberReferenceComparer.Default);
- members.Add (new EventData (document, nclass, events));
- }
+ PropertyDefinition[] properties = GetProperties (type);
+ if (properties.Length > 0) {
+ Array.Sort (properties, MemberReferenceComparer.Default);
+ members.Add (new PropertyData (document, nclass, properties));
+ }
+
+ EventDefinition [] events = GetEvents (type);
+ if (events.Length > 0) {
+ Array.Sort (events, MemberReferenceComparer.Default);
+ members.Add (new EventData (document, nclass, events));
+ }
- MethodDefinition [] methods = GetMethods (type);
- if (methods.Length > 0) {
- Array.Sort (methods, MemberReferenceComparer.Default);
- members.Add (new MethodData (document, nclass, methods));
+ MethodDefinition [] methods = GetMethods (type);
+ if (methods.Length > 0) {
+ Array.Sort (methods, MemberReferenceComparer.Default);
+ members.Add (new MethodData (document, nclass, methods));
+ }
}
foreach (MemberData md in members)
@@ -542,12 +556,19 @@ static string GetLayout (TypeDefinition type)
if (field.IsSpecialName)
continue;
+ if (Driver.AbiMode && field.IsStatic)
+ continue;
+
// we're only interested in public or protected members
FieldAttributes maskedVisibility = (field.Attributes & FieldAttributes.FieldAccessMask);
- if (maskedVisibility == FieldAttributes.Public
- || maskedVisibility == FieldAttributes.Family
- || maskedVisibility == FieldAttributes.FamORAssem) {
+ if (Driver.AbiMode && !field.IsNotSerialized) {
list.Add (field);
+ } else {
+ if (maskedVisibility == FieldAttributes.Public
+ || maskedVisibility == FieldAttributes.Family
+ || maskedVisibility == FieldAttributes.FamORAssem) {
+ list.Add (field);
+ }
}
}
1  scripts/.gitignore
View
@@ -42,6 +42,7 @@
/mkbundle2
/mod
/mono-api-diff
+/mono-abi-info
/mono-api-info
/mono-api-info1
/mono-api-info2
1  scripts/Makefile.am
View
@@ -82,6 +82,7 @@ scripts_4_0 = \
mconfig$(SCRIPT_SUFFIX) \
mod$(SCRIPT_SUFFIX) \
monolinker$(SCRIPT_SUFFIX) \
+ mono-abi-info$(SCRIPT_SUFFIX) \
mono-api-info$(SCRIPT_SUFFIX) \
mono-shlib-cop$(SCRIPT_SUFFIX) \
mozroots$(SCRIPT_SUFFIX) \
Please sign in to comment.
Something went wrong with that request. Please try again.