Imported Upstream version 4.0.2.4

Former-commit-id: de0c2bbc3d900ab3bd764cd6c9d9062472ce7456
This commit is contained in:
Xamarin Public Jenkins
2015-06-10 19:29:21 -04:00
parent 98e85815fb
commit cae8e1b2db
46 changed files with 249 additions and 134 deletions

View File

@@ -8,3 +8,9 @@ LOCAL_MCS_FLAGS += -d:NO_AUTHENTICODE,STATIC,NO_SYMBOL_WRITER
CLEAN_FILES = monop.exe monop2.exe *.mdb
include ../../build/executable.make
run-test-local : basic-tests
basic-tests:
for type in System.Array System.String 'System.Collections.Generic.List`1'; do \
echo $$type; $(RUNTIME) $(build_lib) $$type >/dev/null || exit 1; done

View File

@@ -301,10 +301,10 @@ class MonoP {
static Options options = new Options ();
static void Main (string [] args)
static int Main (string [] args)
{
if (!options.ProcessArgs (args))
return;
return 1;
if (options.Style == null)
mscorlib = universe.LoadFile (typeof (int).Assembly.Location);
@@ -318,14 +318,14 @@ class MonoP {
if (options.ShowAll){
ShowAll (assembly, options.ShowPrivate, options.FilterObsolete);
return;
return 0;
} else {
if (options.Type == null) {
if (options.PrintRefs)
PrintRefs (assembly);
else
PrintTypes (assembly, options.ShowPrivate, options.FilterObsolete);
return;
return 0;
}
}
}
@@ -348,7 +348,7 @@ class MonoP {
if (count > 1){
Console.WriteLine ("Found " + count + " types that match:");
Console.WriteLine (matches);
return;
return 0;
}
}
@@ -394,7 +394,7 @@ class MonoP {
notfound:
if (t == null) {
Console.WriteLine ("Could not find {0}", tname);
return;
return 1;
}
found:
//
@@ -406,6 +406,7 @@ class MonoP {
if (message != null)
Console.WriteLine (message);
return 0;
}
}

View File

@@ -42,6 +42,19 @@ using System.Reflection;
#endif
namespace Mono.CSharp {
public static class TypeExtensions {
public static string GetNamespace (this Type t)
{
// IKVM crashes here with a null ref sometimes
try {
return t.Namespace;
} catch {
return null;
}
}
}
public class Outline {
bool declared_only;
bool show_private;
@@ -636,7 +649,7 @@ public class Outline {
if (!type.StartsWith ("System.")) {
if (type.IndexOf (".") == -1)
return type;
if (t.Namespace == this.t.Namespace)
if (t.GetNamespace () == this.t.GetNamespace ())
return t.Name;
return type;
}
@@ -745,7 +758,8 @@ public class Outline {
}
if (!recursed) {
string ns = t.Namespace;
string ns;
ns = t.GetNamespace ();
if ((ns != null) && (ns != "")) {
sb.Append (ns);
sb.Append (".");