Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<!--
This file defines some of the browsers that Microsoft's implementation provides in
<windir>\Microsoft.NET\Framework\<ver>\CONFIG\Browsers\*.browser
It is not derived from any file distributed with Microsoft's implementation. Since
we can't distribute MS's browser files, we use browscap.ini to determine
browser capabilities. Then, if and only if the application contains App_Browser/*.browser
files and we are using .NET 2.0 or higher, we supplement the capabilities with the
information in those files and the files in this directory. The primary goal of this file
is provide browser definitions that might be referenced in App_Browser/*.browser files.
-->
<browsers>
<defaultBrowser id="Default">
</defaultBrowser>
<browser id="Default">
<identification>
<userAgent match="." />
</identification>
</browser>
<browser id="IE6to9" parentID="Default">
<identification>
<capability name="majorver" match="^[6-9]" />
<capability name="browser" match="^(IE|AOL)$" />
</identification>
</browser>
<browser id="Opera8to9" parentID="Default">
<identification>
<capability name="majorver" match="^[8-9]" />
<capability name="browser" match="^Opera$" />
</identification>
</browser>
<browser id="Safari" parentID="Default">
<identification>
<capability name="browser" match="^Safari$" />
</identification>
</browser>
<browser id="Mozilla" parentID="Default">
<identification>
<capability name="browser" match="^Mozilla" />
</identification>
</browser>
</browsers>

15
data/ChangeLog Normal file
View File

@@ -0,0 +1,15 @@
2010-05-17 Zoltan Varga <vargaz@gmail.com>
* mono-2.pc.in (Libs): Remove glib dependencies.
2010-05-07 Zoltan Varga <vargaz@gmail.com>
* mono-2.pc (Requires): Remove glib dependencies.
2010-04-02 Jb Evain <jbevain@novell.com>
* dotnet35.pc.in: add System.Data.Services.dll.
2010-03-08 Rodrigo Kumpera <rkumpera@novell.com>
* mono.supp: Add hazard pointers supressions.

53
data/Makefile.am Normal file
View File

@@ -0,0 +1,53 @@
SUBDIRS = net_2_0
if INSTALL_4_0
SUBDIRS += net_4_0 net_4_5
endif
monodir = $(sysconfdir)/mono
EXTRA_DIST = \
config.in \
browscap.ini mono.supp mono.d README ChangeLog \
mono.pc.in mono-2.pc.in monosgen-2.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in \
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
dtrace-prelink.sh system.web.mvc.pc.in system.web.mvc2.pc.in system.web.mvc3.pc.in aspnetwebstack.pc.in \
reactive.pc.in xbuild12.pc \
net_1_1/machine.config \
gdb/mono-gdb.py \
gdb/gdb-python.diff
pkgconfigdir = $(libdir)/pkgconfig
if SUPPORT_SGEN
SGENPCFILE=monosgen-2.pc
else
SGENPCFILE=
endif
if JIT_SUPPORTED
if INTERP_SUPPORTED
pkgconfig_DATA= mono.pc mono-2.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc xbuild12.pc $(SGENPCFILE)
else
pkgconfig_DATA= mono.pc mono-2.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc xbuild12.pc $(SGENPCFILE)
endif
else
pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc
endif
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc $(SGENPCFILE) mono-sgen-gdb.py
mono_DATA = config \
browscap.ini
gdbdir = $(bindir)
mono-sgen-gdb.py: gdb/mono-gdb.py
cp $< $@
gdb_DATA = gdb/mono-gdb.py mono-sgen-gdb.py

890
data/Makefile.in Normal file

File diff suppressed because it is too large Load Diff

25
data/README Normal file
View File

@@ -0,0 +1,25 @@
Files in this directory:
config.in, config:
These files are installed into $prefix/etc/mono and
contain the global mappings of dllnames into native
library names.
browscap.ini
This file contains the browser capabilty database,
this is used by ASP.NET to determine in a per-browser
basis what kind of features it can depend on when
producing the HTML code.
mono.d
This is a DTrace file listing available probes.
This is used by dtrace to generate a C header file,
and on Solaris for postprocessing object files.
mono.supp
This is a valgrind data file, it lists the warnings
that should be supressed when reporting Mono-related
errors.
net_1_1 and net_2_0
They contain profile-specific data files

View File

@@ -0,0 +1,4 @@
Name: AspNetWebStack
Description: References Microsoft ASP.NET Web Stack
Version: @VERSION@
Libs: -r:@prefix@/lib/mono/gac/System.Web.Razor/2.0.0.0__31bf3856ad364e35/System.Web.Razor.dll -r:@prefix@/lib/mono/gac/System.Web.Http/4.0.0.0__31bf3856ad364e35/System.Web.Http.dll -r:@prefix@/lib/mono/gac/System.Web.WebPages/2.0.0.0__31bf3856ad364e35/System.Web.WebPages.dll -r:@prefix@/lib/mono/gac/System.Web.WebPages.Razor/2.0.0.0__31bf3856ad364e35/System.Web.WebPages.Razor.dll -r:@prefix@/lib/mono/gac/System.Web.WebPages.Deployment/2.0.0.0__31bf3856ad364e35/System.Web.WebPages.Deployment.dll

View File

@@ -0,0 +1 @@
1267e1deb4061a8250ad25125fc7d20fd2ae04ac

7
data/cecil.pc.in Normal file
View File

@@ -0,0 +1,7 @@
assemblies_dir=@prefix@/lib/mono
Libraries=${assemblies_dir}/gac/Mono.Cecil/0.9.5.0__0738eb9f132ed756/Mono.Cecil.dll
Name: Mono Internal -- Do not use.
Description: Mono Internal Libraries -- Do not use
Version: @VERSION@
Libs: -r:Mono.Cecil.dll

34
data/config.in Normal file
View File

@@ -0,0 +1,34 @@
<configuration>
<dllmap dll="i:cygwin1.dll" target="@LIBC@" os="!windows" />
<dllmap dll="libc" target="@LIBC@" os="!windows"/>
<dllmap dll="intl" target="@INTL@" os="!windows"/>
<dllmap dll="intl" name="bind_textdomain_codeset" target="@LIBC@" os="solaris"/>
<dllmap dll="libintl" name="bind_textdomain_codeset" target="@LIBC@" os="solaris"/>
<dllmap dll="libintl" target="@INTL@" os="!windows"/>
<dllmap dll="i:libxslt.dll" target="libxslt@libsuffix@" os="!windows"/>
<dllmap dll="i:odbc32.dll" target="libodbc@libsuffix@" os="!windows"/>
<dllmap dll="i:odbc32.dll" target="libiodbc.dylib" os="osx"/>
<dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
<dllmap dll="MonoPosixHelper" target="libMonoPosixHelper@libsuffix@" os="!windows" />
<dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
<dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
<dllmap dll="sqlite" target="@SQLITE@" os="!windows"/>
<dllmap dll="sqlite3" target="@SQLITE3@" os="!windows"/>
<dllmap dll="libX11" target="@X11@" os="!windows" />
<dllmap dll="libXinerama" target="@XINERAMA@" os="!windows" />
<dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows"/>
<dllmap dll="libcairo-2.dll" target="libcairo.2.dylib" os="osx"/>
<dllmap dll="libcups" target="libcups.so.2" os="!windows"/>
<dllmap dll="libcups" target="libcups.dylib" os="osx"/>
<dllmap dll="i:kernel32.dll">
<dllentry dll="__Internal" name="CopyMemory" target="mono_win32_compat_CopyMemory"/>
<dllentry dll="__Internal" name="FillMemory" target="mono_win32_compat_FillMemory"/>
<dllentry dll="__Internal" name="MoveMemory" target="mono_win32_compat_MoveMemory"/>
<dllentry dll="__Internal" name="ZeroMemory" target="mono_win32_compat_ZeroMemory"/>
</dllmap>
<dllmap dll="gdiplus" target="@prefix@/lib/libgdiplus@libsuffix@" os="!windows"/>
<dllmap dll="gdiplus.dll" target="@prefix@/lib/libgdiplus@libsuffix@" os="!windows"/>
<dllmap dll="gdi32" target="@prefix@/lib/libgdiplus@libsuffix@" os="!windows"/>
<dllmap dll="gdi32.dll" target="@prefix@/lib/libgdiplus@libsuffix@" os="!windows"/>
</configuration>

5
data/dotnet.pc.in Normal file
View File

@@ -0,0 +1,5 @@
Name: Standard libraries in a .NET setup
Description: References all the standard .NET libraries for compilation
Version: @VERSION@
Libs: -r:Accessibility.dll -r:cscompmgd.dll -r:Microsoft.VisualC.dll -r:System.Configuration.Install.dll -r:System.Data.dll -r:System.Data.OracleClient.dll -r:System.Design.dll -r:System.DirectoryServices.dll -r:System.dll -r:System.Drawing.Design.dll -r:System.Drawing.dll -r:System.EnterpriseServices.dll -r:System.Management.dll -r:System.Messaging.dll -r:System.Runtime.Remoting.dll -r:System.Runtime.Serialization.Formatters.Soap.dll -r:System.Security.dll -r:System.ServiceProcess.dll -r:System.Web.dll -r:System.Web.Services.dll -r:System.Windows.Forms.dll -r:System.Xml.dll -r:System.Xml.Linq.dll

5
data/dotnet35.pc.in Normal file
View File

@@ -0,0 +1,5 @@
Name: Standard libraries in a .NET setup
Description: References all the standard .NET libraries for compilation (.NET Framework 3.5 compatibility)
Version: @VERSION@
Libs: -r:Accessibility.dll -r:cscompmgd.dll -r:Microsoft.VisualC.dll -r:System.Configuration.Install.dll -r:System.Data.dll -r:System.Data.OracleClient.dll -r:System.Design.dll -r:System.DirectoryServices.dll -r:System.dll -r:System.Drawing.Design.dll -r:System.Drawing.dll -r:System.EnterpriseServices.dll -r:System.Management.dll -r:System.Messaging.dll -r:System.Runtime.Remoting.dll -r:System.Runtime.Serialization.Formatters.Soap.dll -r:System.Security.dll -r:System.ServiceProcess.dll -r:System.Web.dll -r:System.Web.Services.dll -r:System.Windows.Forms.dll -r:System.Xml.dll -r:System.Configuration.dll -r:System.Core.dll -r:System.Xml.Linq.dll -r:System.Data.DataSetExtensions.dll -r:System.Data.Linq.dll -r:System.Data.Services.dll -r:System.Web.Abstractions.dll -r:System.Web.Routing.dll -r:System.Web.DynamicData.dll -r:System.ComponentModel.DataAnnotations.dll

74
data/dtrace-prelink.sh Normal file
View File

@@ -0,0 +1,74 @@
#!/bin/sh
#
# dtrace-prelink.sh: DTrace helper script for Mono
#
# Authors:
# Andreas Faerber <andreas.faerber@web.de>
#
# Assume that PIC object files live in .libs/, non-PIC code in ./
PIC=no
if test "$1" = "--pic"; then
PIC=yes
shift
fi
OBJ="$1"
PROV="$2"
shift
shift
FILES="$*"
OBJS=
TMPDIR=.dtrace
mkdir -p "${TMPDIR}"
# Extract relevant object files to temporary directories
for FILE in ${FILES}; do
if echo "${FILE}" | grep .la > /dev/null; then
LIBDIR=`dirname ${FILE}`
LIB=".libs/`basename ${FILE} .la`.a"
DIR="${TMPDIR}/`basename ${FILE}`"
mkdir -p ${DIR}
(cd "${DIR}" && ${AR} x "../../${LIBDIR}/${LIB}")
TMPOBJS=`ls -1 "${DIR}"`
for TMPOBJ in ${TMPOBJS}; do
LO=`basename "${TMPOBJ}" .o`.lo
SRCOBJ="${TMPOBJ}"
if test x${PIC} = xyes; then
SRCOBJ=".libs/${SRCOBJ}"
fi
# Overwrite with original version
cp "${LIBDIR}/${SRCOBJ}" "${DIR}/${TMPOBJ}" || cp "${LIBDIR}/${TMPOBJ}" "${DIR}/${TMPOBJ}" || exit
# Add to list
OBJS="${OBJS} ${DIR}/${TMPOBJ}"
done
fi
if echo "${FILE}" | grep .lo > /dev/null; then
DIR=`dirname ${FILE}`
SRCOBJ=`basename ${FILE} .lo`.o
if test x${PIC} = xyes; then
SRCOBJ=".libs/${SRCOBJ}"
fi
OBJS="${OBJS} ${DIR}/${SRCOBJ}"
fi
done
# Run dtrace -G over the temporary objects
${DTRACE} -G ${DTRACEFLAGS} -s "${PROV}" -o "${OBJ}" ${OBJS} || exit
# Update the archives with the temporary, modified object files so that they are linked in
for FILE in ${FILES}; do
if echo "${FILE}" | grep .la > /dev/null; then
LIBDIR=`dirname ${FILE}`
LIB=".libs/`basename ${FILE} .la`.a"
DIR="${TMPDIR}/`basename ${FILE}`"
(cd "${DIR}" && ${AR} r "../../${LIBDIR}/${LIB}" *.o)
fi
# .lo files were modified in-place
done
rm -rf "${TMPDIR}"

163
data/gdb/gdb-python.diff Normal file
View File

@@ -0,0 +1,163 @@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 640998b..fb73e9d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2009-02-03 Zoltan Varga <vargaz@gmail.com>
+
+ * cil-script.c python/python-cmd.c: Allow registration of pre/post hooks from
+ python.
+
+ * symfile.c (add_symbol_file_command): Comment out verbose messages.
+
2009-02-03 Thiago Jung Bauermann <bauerman@br.ibm.com>
* gdb/c-lang.c (c_get_string): Remove superfluous parenthesis from
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 835d29c..3941aa5 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -299,6 +299,13 @@ execute_user_command (struct cmd_list_element *c, char *args)
static int user_call_depth = 0;
extern int max_user_call_depth;
+ /* Might be a user defined command implemented in Python */
+ if (!c->user_commands && c->func)
+ {
+ (*c->func) (c, args, FALSE);
+ return;
+ }
+
old_chain = setup_user_args (args);
cmdlines = c->user_commands;
diff --git a/gdb/python/python-cmd.c b/gdb/python/python-cmd.c
index 61d5e5d..a3fbc08 100644
--- a/gdb/python/python-cmd.c
+++ b/gdb/python/python-cmd.c
@@ -339,7 +339,8 @@ gdbpy_parse_command_name (char *text, struct cmd_list_element ***base_list,
/* Object initializer; sets up gdb-side structures for command.
- Use: __init__(NAME, CMDCLASS, [COMPLETERCLASS, [PREFIX]]).
+ Use: __init__(NAME, CMDCLASS, [completerclass=COMPLETERCLASS, prefix=PREFIX,
+ pre_hook_of=PREHOOK_OF, post_hook_of=POSTHOOK_OF]).
NAME is the name of the command. It may consist of multiple words,
in which case the final word is the name of the new command, and
@@ -354,6 +355,11 @@ gdbpy_parse_command_name (char *text, struct cmd_list_element ***base_list,
If PREFIX is True, then this command is a prefix command.
+ PREHOOK_OF is the name of a gdb command this command becomes a
+ pre-execution hook of, same as if this command was defined using
+ "define hook-<cmdname>"
+ POSTHOOK_OF is the same for post-execution hooks.
+
The documentation for the command is taken from the doc string for
the python class.
@@ -362,15 +368,18 @@ static int
cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
{
cmdpy_object *obj = (cmdpy_object *) self;
- char *name;
+ char *name, *pre_hook_of = NULL, *post_hook_of = NULL;
int cmdtype;
int completetype = -1;
char *docstring = NULL;
volatile struct gdb_exception except;
struct cmd_list_element **cmd_list;
+ struct cmd_list_element *pre_hookc = NULL, *post_hookc = NULL;
char *cmd_name, *pfx_name;
PyObject *is_prefix = NULL;
int cmp;
+ static char *kwlist[] = {"name", "cmdclass", "completerclass", "prefix",
+ "pre_hook_of", "post_hook_of", NULL};
if (obj->command)
{
@@ -381,8 +390,9 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
return -1;
}
- if (! PyArg_ParseTuple (args, "si|iO", &name, &cmdtype,
- &completetype, &is_prefix))
+ if (! PyArg_ParseTupleAndKeywords (args, kwds, "si|iOss", kwlist, &name, &cmdtype,
+ &completetype, &is_prefix, &pre_hook_of,
+ &post_hook_of))
return -1;
if (cmdtype != no_class && cmdtype != class_run
@@ -402,6 +412,30 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
return -1;
}
+ if (pre_hook_of)
+ {
+ char *text = pre_hook_of;
+
+ pre_hookc = lookup_cmd_1 (&text, cmdlist, NULL, 1);
+ if (! pre_hookc)
+ {
+ PyErr_Format (PyExc_RuntimeError, _("command name given by pre_hook argument not found"));
+ return -1;
+ }
+ }
+
+ if (post_hook_of)
+ {
+ char *text = post_hook_of;
+
+ post_hookc = lookup_cmd_1 (&text, cmdlist, NULL, 1);
+ if (! post_hookc)
+ {
+ PyErr_Format (PyExc_RuntimeError, _("command name given by post_hook argument not found"));
+ return -1;
+ }
+ }
+
cmd_name = gdbpy_parse_command_name (name, &cmd_list, &cmdlist);
if (! cmd_name)
return -1;
@@ -470,6 +504,18 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
cmd->func = cmdpy_function;
cmd->destroyer = cmdpy_destroyer;
+ if (pre_hookc)
+ {
+ pre_hookc->hook_pre = cmd;
+ cmd->hookee_pre = pre_hookc;
+ }
+
+ if (post_hookc)
+ {
+ post_hookc->hook_post = cmd;
+ cmd->hookee_post = post_hookc;
+ }
+
obj->command = cmd;
set_cmd_context (cmd, self);
set_cmd_completer (cmd, ((completetype == -1) ? cmdpy_completer
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 14cb7b8..6d0bb40 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2196,7 +2196,7 @@ add_symbol_file_command (char *args, int from_tty)
statements because hex_string returns a local static
string. */
- printf_unfiltered (_("add symbol table from file \"%s\" at\n"), filename);
+ /* printf_unfiltered (_("add symbol table from file \"%s\" at\n"), filename); */
section_addrs = alloc_section_addr_info (section_index);
make_cleanup (xfree, section_addrs);
for (i = 0; i < section_index; i++)
@@ -2211,7 +2211,7 @@ add_symbol_file_command (char *args, int from_tty)
entered on the command line. */
section_addrs->other[sec_num].name = sec;
section_addrs->other[sec_num].addr = addr;
- printf_unfiltered ("\t%s_addr = %s\n", sec, paddress (addr));
+ /* printf_unfiltered ("\t%s_addr = %s\n", sec, paddress (addr)); */
sec_num++;
/* The object's sections are initialized when a

354
data/gdb/mono-gdb.py Normal file
View File

@@ -0,0 +1,354 @@
#
# Author: Zoltan Varga (vargaz@gmail.com)
# License: MIT/X11
#
#
# This is a mono support mode for gdb 7.0 and later
# Usage:
# - copy/symlink this file to the directory where the mono executable lives.
# - run mono under gdb, or attach to a mono process started with --debug=gdb using gdb.
#
from __future__ import print_function
import os
class StringPrinter:
"Print a C# string"
def __init__(self, val):
self.val = val
def to_string(self):
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return "null"
obj = self.val.cast (gdb.lookup_type ("MonoString").pointer ()).dereference ()
len = obj ['length']
chars = obj ['chars']
i = 0
res = ['"']
while i < len:
val = (chars.cast(gdb.lookup_type ("gint64")) + (i * 2)).cast(gdb.lookup_type ("gunichar2").pointer ()).dereference ()
if val >= 256:
c = "\u%X".format (val)
else:
c = chr (val)
res.append (c)
i = i + 1
res.append ('"')
return ''.join (res)
def stringify_class_name(ns, name):
if ns == "System":
if name == "Byte":
return "byte"
if name == "String":
return "string"
if ns == "":
return name
else:
return "%s.%s".format (ns, name)
class ArrayPrinter:
"Print a C# array"
def __init__(self, val, class_ns, class_name):
self.val = val
self.class_ns = class_ns
self.class_name = class_name
def to_string(self):
obj = self.val.cast (gdb.lookup_type ("MonoArray").pointer ()).dereference ()
length = obj ['max_length']
return "%s [%d]".format (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length))
class ObjectPrinter:
"Print a C# object"
def __init__(self, val):
if str(val.type)[-1] == "&":
self.val = val.address.cast (gdb.lookup_type ("MonoObject").pointer ())
else:
self.val = val.cast (gdb.lookup_type ("MonoObject").pointer ())
class _iterator:
def __init__(self,obj):
self.obj = obj
self.iter = self.obj.type.fields ().__iter__ ()
pass
def __iter__(self):
return self
def next(self):
field = self.iter.next ()
try:
if str(self.obj [field.name].type) == "object":
# Avoid recursion
return (field.name, self.obj [field.name].cast (gdb.lookup_type ("void").pointer ()))
else:
return (field.name, self.obj [field.name])
except:
# Superclass
return (field.name, self.obj.cast (gdb.lookup_type ("%s".format (field.name))))
def children(self):
# FIXME: It would be easier if gdb.Value would support iteration itself
# It would also be better if we could return None
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return {}.__iter__ ()
try:
obj = self.val.dereference ()
class_ns = obj ['vtable'].dereference ()['klass'].dereference ()['name_space'].string ()
class_name = obj ['vtable'].dereference ()['klass'].dereference ()['name'].string ()
if class_name [-2:len(class_name)] == "[]":
return {}.__iter__ ()
try:
gdb_type = gdb.lookup_type ("struct %s_%s".format (class_ns.replace (".", "_"), class_name))
return self._iterator(obj.cast (gdb_type))
except:
return {}.__iter__ ()
except:
print (sys.exc_info ()[0])
print (sys.exc_info ()[1])
return {}.__iter__ ()
def to_string(self):
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return "null"
try:
obj = self.val.dereference ()
class_ns = obj ['vtable'].dereference ()['klass'].dereference ()['name_space'].string ()
class_name = obj ['vtable'].dereference ()['klass'].dereference ()['name'].string ()
if class_ns == "System" and class_name == "String":
return StringPrinter (self.val).to_string ()
if class_name [-2:len(class_name)] == "[]":
return ArrayPrinter (self.val,class_ns,class_name).to_string ()
if class_ns != "":
try:
gdb_type = gdb.lookup_type ("struct %s.%s".format (class_ns, class_name))
except:
# Maybe there is no debug info for that type
return "%s.%s".format (class_ns, class_name)
#return obj.cast (gdb_type)
return "%s.%s".format (class_ns, class_name)
return class_name
except:
print (sys.exc_info ()[0])
print (sys.exc_info ()[1])
# FIXME: This can happen because we don't have liveness information
return self.val.cast (gdb.lookup_type ("guint64"))
class MonoMethodPrinter:
"Print a MonoMethod structure"
def __init__(self, val):
self.val = val
def to_string(self):
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return "0x0"
val = self.val.dereference ()
klass = val ["klass"].dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
return "\"%s:%s ()\"".format (class_name, val ["name"].string ())
# This returns more info but requires calling into the inferior
#return "\"%s\"".format (gdb.parse_and_eval ("mono_method_full_name (%s, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
class MonoClassPrinter:
"Print a MonoClass structure"
def __init__(self, val):
self.val = val
def to_string_inner(self, add_quotes):
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return "0x0"
klass = self.val.dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
if klass ["generic_class"].cast (gdb.lookup_type ("guint64")) != 0:
class_name = "%s<%s>".format (class_name, str (klass ["generic_class"]["context"]["class_inst"]))
if add_quotes:
return "\"%s\"".format (class_name)
else:
return class_name
# This returns more info but requires calling into the inferior
#return "\"%s\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*)%s)->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
def to_string(self):
try:
return self.to_string_inner (True)
except:
#print (sys.exc_info ()[0])
#print (sys.exc_info ()[1])
return str(self.val.cast (gdb.lookup_type ("gpointer")))
class MonoGenericInstPrinter:
"Print a MonoGenericInst structure"
def __init__(self, val):
self.val = val
def to_string(self):
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return "0x0"
inst = self.val.dereference ()
inst_len = inst ["type_argc"]
inst_args = inst ["type_argv"]
inst_str = ""
for i in range(0, inst_len):
print (inst_args)
type_printer = MonoTypePrinter (inst_args [i])
if i > 0:
inst_str = inst_str + ", "
inst_str = inst_str + type_printer.to_string ()
return inst_str
class MonoGenericClassPrinter:
"Print a MonoGenericClass structure"
def __init__(self, val):
self.val = val
def to_string_inner(self):
gclass = self.val.dereference ()
container_str = str(gclass ["container_class"])
class_inst = gclass ["context"]["class_inst"]
class_inst_str = ""
if int(class_inst.cast (gdb.lookup_type ("guint64"))) != 0:
class_inst_str = str(class_inst)
method_inst = gclass ["context"]["method_inst"]
method_inst_str = ""
if int(method_inst.cast (gdb.lookup_type ("guint64"))) != 0:
method_inst_str = str(method_inst)
return "%s, [%s], [%s]>".format (container_str, class_inst_str, method_inst_str)
def to_string(self):
try:
return self.to_string_inner ()
except:
#print (sys.exc_info ()[0])
#print (sys.exc_info ()[1])
return str(self.val.cast (gdb.lookup_type ("gpointer")))
class MonoTypePrinter:
"Print a MonoType structure"
def __init__(self, val):
self.val = val
def to_string_inner(self, csharp):
try:
t = self.val.dereference ()
kind = str (t ["type"]).replace ("MONO_TYPE_", "").lower ()
info = ""
if kind == "class":
p = MonoClassPrinter(t ["data"]["klass"])
info = p.to_string ()
elif kind == "genericinst":
info = str(t ["data"]["generic_class"])
if info != "":
return "{%s, %s}".format (kind, info)
else:
return "{%s}".format (kind)
except:
#print (sys.exc_info ()[0])
#print (sys.exc_info ()[1])
return str(self.val.cast (gdb.lookup_type ("gpointer")))
def to_string(self):
return self.to_string_inner (False)
class MonoMethodRgctxPrinter:
"Print a MonoMethodRgctx structure"
def __init__(self, val):
self.val = val
def to_string(self):
rgctx = self.val.dereference ()
klass = rgctx ["class_vtable"].dereference () ["klass"]
klass_printer = MonoClassPrinter (klass)
inst = rgctx ["method_inst"].dereference ()
inst_len = inst ["type_argc"]
inst_args = inst ["type_argv"]
inst_str = ""
for i in range(0, inst_len):
print (inst_args)
type_printer = MonoTypePrinter (inst_args [i])
if i > 0:
inst_str = inst_str + ", "
inst_str = inst_str + type_printer.to_string ()
return "MRGCTX[%s, [%s]]".format (klass_printer.to_string(), inst_str)
class MonoVTablePrinter:
"Print a MonoVTable structure"
def __init__(self, val):
self.val = val
def to_string(self):
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return "0x0"
vtable = self.val.dereference ()
klass = vtable ["klass"]
klass_printer = MonoClassPrinter (klass)
return "vtable(%s)".format (klass_printer.to_string ())
def lookup_pretty_printer(val):
t = str (val.type)
if t == "object":
return ObjectPrinter (val)
if t[0:5] == "class" and t[-1] == "&":
return ObjectPrinter (val)
if t == "string":
return StringPrinter (val)
if t == "MonoString *":
return StringPrinter (val)
if t == "MonoMethod *":
return MonoMethodPrinter (val)
if t == "MonoClass *":
return MonoClassPrinter (val)
if t == "MonoType *":
return MonoTypePrinter (val)
if t == "MonoGenericInst *":
return MonoGenericInstPrinter (val)
if t == "MonoGenericClass *":
return MonoGenericClassPrinter (val)
if t == "MonoMethodRuntimeGenericContext *":
return MonoMethodRgctxPrinter (val)
if t == "MonoVTable *":
return MonoVTablePrinter (val)
return None
def register_csharp_printers(obj):
"Register C# pretty-printers with objfile Obj."
if obj == None:
obj = gdb
obj.pretty_printers.append (lookup_pretty_printer)
# This command will flush the debugging info collected by the runtime
class XdbCommand (gdb.Command):
def __init__ (self):
super (XdbCommand, self).__init__ ("xdb", gdb.COMMAND_NONE,
gdb.COMPLETE_COMMAND)
def invoke(self, arg, from_tty):
gdb.execute ("call mono_xdebug_flush ()")
register_csharp_printers (gdb.current_objfile())
XdbCommand ()
gdb.execute ("set environment MONO_XDEBUG gdb")
print ("Mono support loaded.")

12
data/mint.pc.in Normal file
View File

@@ -0,0 +1,12 @@
prefix=${pcfiledir}/../..
exec_prefix=${pcfiledir}/../..
libdir=${prefix}/lib
includedir=${prefix}/include/mono-@API_VER@
Name: Mono Interpreter
Description: Mono Interpreter Runtime
Version: @VERSION@
Requires: glib-2.0 gthread-2.0
Libs: -L${libdir} @export_ldflags@ -lmint @libmono_ldflags@
Cflags: -I${includedir} @libmono_cflags@

11
data/mono-2.pc.in Normal file
View File

@@ -0,0 +1,11 @@
prefix=${pcfiledir}/../..
exec_prefix=${pcfiledir}/../..
libdir=${prefix}/@reloc_libdir@
includedir=${prefix}/include/mono-@API_VER@
sysconfdir=@sysconfdir@
Name: Mono
Description: Mono Runtime
Version: @VERSION@
Libs: -L${libdir} @export_ldflags@ -lmono-@API_VER@ @libmono_ldflags@
Cflags: -I${includedir} @libmono_cflags@

9
data/mono-cairo.pc.in Normal file
View File

@@ -0,0 +1,9 @@
prefix=${pcfiledir}/../..
exec_prefix=${pcfiledir}/../..
libdir=${prefix}/@reloc_libdir@
includedir=${prefix}/include
Name: Mono.Cairo
Description: Cairo bindings for Mono
Version: @VERSION@
Libs: -r:Mono.Cairo

View File

@@ -0,0 +1,7 @@
prefix=${pcfiledir}/../..
assemblies_dir=${prefix}/lib/mono-source-libs
Sources=${assemblies_dir}/getline.cs
Name: Mono.Terminal.LineEditor
Description: Terminal text entry editor using System.Console.
Version: 0.2.1

9
data/mono-nunit.pc.in Normal file
View File

@@ -0,0 +1,9 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
Name: Mono NUnit
Description: Mono's version of NUnit
Version: @VERSION@
Libs: -r:${libdir}/mono/2.0/nunit.core.dll -r:${libdir}/mono/2.0/nunit.core.interfaces.dll -r:${libdir}/mono/2.0/nunit.core.extensions.dll -r:${libdir}/mono/2.0/nunit.framework.dll -r:${libdir}/mono/2.0/nunit.framework.extensions.dll -r:${libdir}/mono/2.0/nunit.mocks.dll -r:${libdir}/mono/2.0/nunit.util.dll -r:${libdir}/mono/2.0/nunit-console-runner.dll

7
data/mono-options.pc.in Normal file
View File

@@ -0,0 +1,7 @@
prefix=${pcfiledir}/../..
assemblies_dir=${prefix}/lib/mono-source-libs
Sources=${assemblies_dir}/Options.cs
Name: Mono.Options
Description: Command Line Parsing Library
Version: 0.2.3

Some files were not shown because too many files have changed in this diff Show More