Imported Upstream version 5.5.0.227

This commit is contained in:
Jo Shields 2014-10-06 10:19:19 +01:00
Родитель 9407830aca
Коммит b2c8331abb
7911 изменённых файлов: 681262 добавлений и 422613 удалений

1194
Main.sln

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -2,6 +2,8 @@ include $(top_srcdir)/xbuild.include
SUBDIRS = external . contrib src po man theme-icons build tests
MD_CONFIGURE=$(top_srcdir)/../scripts/configure.sh
#capture aclocal flags for autoreconf
ACLOCAL_AMFLAGS=$(ACLOCAL_FLAGS)
@ -11,29 +13,20 @@ buildinfo = $(top_builddir)/build/bin/buildinfo
all: vcrevision
all-local: sln_build
all-local: vcrevision sln_build
clean: clean-local
clean-local: sln_clean
vcrevision:
@if test -d ../.git; then \
version=$$(cd ..; \
LANG=C; export LANG; \
git rev-parse HEAD; \
); \
echo "$$version" > "vcrevision"; \
else \
if test ! -f ./vcrevision; then \
echo "unknown" > "vcrevision"; \
fi; \
fi
touch vcrevision
$(buildinfo): vcrevision
$(buildinfo):
@mkdir -p "$(top_builddir)/build/bin"
@echo "Git revision: $$(cat $(top_srcdir)/vcrevision)" > "$@"
@echo "Build date: $$(date -u +'%Y-%m-%d %H:%M:%S%z')" >> "$@"
# in a tarball, there is a generated buildinfo, which needs to be copied to the right place
# otherwise, the file buildinfo will be generated based on git revision etc.
if test -f "$(top_srcdir)/buildinfo"; then cp "$(top_srcdir)/buildinfo" "$(top_builddir)/build/bin/buildinfo"; else $(MD_CONFIGURE) gen-buildinfo "$(top_builddir)/build/bin"; fi
@echo "Updated build information"
@cat $(buildinfo)
@ -110,7 +103,7 @@ apidocs:
mdassembler --out docs/sources/monodevelop-extension-guide --addins docs/extension-model.xml
# cd docs/apiguide && mdassembler --out monodevelop-api-guide --xhtml toc.xhtml && mv monodevelop-api-guide.zip ../web/sources
MD_LAUNCH=$(MD_LAUNCH_SETUP) UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 exec -a "monodevelop" $(RUNTIME)
MD_LAUNCH=$(MD_LAUNCH_SETUP) $(MD_LAUNCH_EXTRA_ENV) UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 exec -a "monodevelop" $(RUNTIME)
run: run-sgen
@ -169,7 +162,7 @@ app-dir: all
# we can't use the variables that are conditionally defined
EXTRA_DIST = $(bin_SCRIPTS) $(desktop_DATA) $(pixmap_DATA) \
monodevelop.xml $(pkgconfig_in_files) vcrevision external/Makefile.in \
monodevelop.xml $(pkgconfig_in_files) external/Makefile.in \
Main.sln \
md.targets

Просмотреть файл

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.12.1 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -16,23 +16,51 @@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
test $$am__dry = yes; \
}
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@ -49,14 +77,15 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/mdtool.in \
DIST_COMMON = $(top_srcdir)/xbuild.include \
$(top_srcdir)/Makefile.include $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(srcdir)/monodevelop.in \
$(srcdir)/mdtool.in $(srcdir)/monodevelop.pc.in \
$(srcdir)/monodevelop-core-addins.pc.in \
$(srcdir)/monodevelop-core-mac-addins.pc.in \
$(srcdir)/monodevelop.in $(srcdir)/monodevelop.pc.in \
$(srcdir)/monodevelop.spec.in $(top_srcdir)/Makefile.include \
$(top_srcdir)/configure $(top_srcdir)/xbuild.include AUTHORS \
COPYING ChangeLog NEWS install-sh missing
$(srcdir)/monodevelop.spec.in AUTHORS COPYING ChangeLog NEWS \
README install-sh missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
@ -100,15 +129,28 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(buildinfodir)" \
"$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(pkgconfigdir)" \
"$(DESTDIR)$(xdgmimedir)"
SCRIPTS = $(bin_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@ -118,9 +160,29 @@ DATA = $(buildinfo_DATA) $(desktop_DATA) $(pkgconfig_DATA) \
$(xdgmime_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
@ -169,11 +231,13 @@ ACLOCAL = @ACLOCAL@
ACLOCAL_FLAGS = @ACLOCAL_FLAGS@
ALL_LINGUAS = @ALL_LINGUAS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
ASSEMBLY_VERSION = @ASSEMBLY_VERSION@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
COMPAT_ADDIN_VERSION = @COMPAT_ADDIN_VERSION@
CSC = @CSC@
CSC_FLAGS = @CSC_FLAGS@
CYGPATH_W = @CYGPATH_W@
@ -286,11 +350,11 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ALL_CSPROJ = $(wildcard *.csproj)
MAIN_SLN = $(top_builddir)/Main.sln
@ENABLE_GNOMEPLATFORM_TRUE@PROFILE_NAME = Debug
@ENABLE_GNOMEPLATFORM_TRUE@PROFILE_NAME = DebugGnome
@ENABLE_MACPLATFORM_TRUE@PROFILE_NAME = DebugMac
@ENABLE_WINDOWSPLATFORM_TRUE@PROFILE_NAME = DebugWin32
XBUILD = xbuild
XBUILD_VERBOSITY = quiet
XBUILD_VERBOSITY = normal
XBUILD_ARGS = /verbosity:$(XBUILD_VERBOSITY) /nologo /property:CodePage=65001
XBUILD_PROFILE = /property:Configuration=$(PROFILE_NAME)
@ -315,11 +379,12 @@ WILDCARDED_FILES := $(wildcard $(ALL_FILES))
# we can't use the variables that are conditionally defined
EXTRA_DIST = $(bin_SCRIPTS) $(desktop_DATA) $(pixmap_DATA) \
monodevelop.xml $(pkgconfig_in_files) vcrevision external/Makefile.in \
monodevelop.xml $(pkgconfig_in_files) external/Makefile.in \
Main.sln \
md.targets
SUBDIRS = external . contrib src po man theme-icons build tests
MD_CONFIGURE = $(top_srcdir)/../scripts/configure.sh
#capture aclocal flags for autoreconf
ACLOCAL_AMFLAGS = $(ACLOCAL_FLAGS)
@ -368,7 +433,7 @@ DOCFILES = \
build/bin/MonoDevelop.Projects.Gui.dll
# cd docs/apiguide && mdassembler --out monodevelop-api-guide --xhtml toc.xhtml && mv monodevelop-api-guide.zip ../web/sources
MD_LAUNCH = $(MD_LAUNCH_SETUP) UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 exec -a "monodevelop" $(RUNTIME)
MD_LAUNCH = $(MD_LAUNCH_SETUP) $(MD_LAUNCH_EXTRA_ENV) UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 exec -a "monodevelop" $(RUNTIME)
DISTCLEANFILES = monodevelop intltool-extract intltool-merge intltool-update \
$(pkgconfig_DATA)
@ -577,17 +642,20 @@ uninstall-xdgmimeDATA:
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
@ -602,61 +670,12 @@ $(RECURSIVE_TARGETS):
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
cscopelist-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
done
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@ -672,12 +691,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@ -689,15 +703,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@ -706,18 +716,16 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscope.files: clean-cscope cscopelist-recursive cscopelist
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP)'; \
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
@ -815,10 +823,16 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@ -851,18 +865,19 @@ distcheck: dist
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
&& ../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@ -1028,14 +1043,12 @@ uninstall-am: uninstall-binSCRIPTS uninstall-buildinfoDATA \
uninstall-xdgmimeDATA
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
cscopelist-recursive ctags-recursive install-am \
install-data-am install-strip tags-recursive uninstall-am
.MAKE: $(am__recursive_targets) install-am install-data-am \
install-strip uninstall-am
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am all-local am--refresh check check-am clean \
clean-cscope clean-generic clean-local cscope cscopelist \
cscopelist-recursive ctags ctags-recursive dist dist-all \
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
am--refresh check check-am clean clean-cscope clean-generic \
clean-local cscope cscopelist-am ctags ctags-am dist dist-all \
dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \
dist-zip distcheck distclean distclean-generic distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
@ -1048,7 +1061,7 @@ uninstall-am: uninstall-binSCRIPTS uninstall-buildinfoDATA \
install-ps-am install-strip install-xdgmimeDATA installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
pdf-am ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binSCRIPTS uninstall-buildinfoDATA \
uninstall-desktopDATA uninstall-hook uninstall-pkgconfigDATA \
uninstall-xdgmimeDATA
@ -1085,29 +1098,20 @@ print_extradist:
all: vcrevision
all-local: sln_build
all-local: vcrevision sln_build
clean: clean-local
clean-local: sln_clean
vcrevision:
@if test -d ../.git; then \
version=$$(cd ..; \
LANG=C; export LANG; \
git rev-parse HEAD; \
); \
echo "$$version" > "vcrevision"; \
else \
if test ! -f ./vcrevision; then \
echo "unknown" > "vcrevision"; \
fi; \
fi
touch vcrevision
$(buildinfo): vcrevision
$(buildinfo):
@mkdir -p "$(top_builddir)/build/bin"
@echo "Git revision: $$(cat $(top_srcdir)/vcrevision)" > "$@"
@echo "Build date: $$(date -u +'%Y-%m-%d %H:%M:%S%z')" >> "$@"
# in a tarball, there is a generated buildinfo, which needs to be copied to the right place
# otherwise, the file buildinfo will be generated based on git revision etc.
if test -f "$(top_srcdir)/buildinfo"; then cp "$(top_srcdir)/buildinfo" "$(top_builddir)/build/bin/buildinfo"; else $(MD_CONFIGURE) gen-buildinfo "$(top_builddir)/build/bin"; fi
@echo "Updated build information"
@cat $(buildinfo)

412
aclocal.m4 поставляемый
Просмотреть файл

@ -1,6 +1,6 @@
# generated automatically by aclocal 1.12.1 -*- Autoconf -*-
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -11,6 +11,7 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
@ -179,64 +180,22 @@ else
fi[]dnl
])# PKG_CHECK_MODULES
# PKG_INSTALLDIR(DIRECTORY)
# -------------------------
# Substitutes the variable pkgconfigdir as the location where a module
# should install pkg-config .pc files. By default the directory is
# $libdir/pkgconfig, but the default can be changed by passing
# DIRECTORY. The user can override through the --with-pkgconfigdir
# parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
]) dnl PKG_INSTALLDIR
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
# -------------------------
# Substitutes the variable noarch_pkgconfigdir as the location where a
# module should install arch-independent pkg-config .pc files. By
# default the directory is $datadir/pkgconfig, but the default can be
# changed by passing DIRECTORY. The user can override through the
# --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
]) dnl PKG_NOARCH_INSTALLDIR
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.12'
[am__api_version='1.14'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.12.1], [],
m4_if([$1], [1.14.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@ -252,21 +211,19 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.12.1])dnl
[AM_AUTOMAKE_VERSION([1.14.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
@ -314,14 +271,12 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2012 Free Software Foundation, Inc.
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 10
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
@ -349,17 +304,21 @@ fi])])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 19
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])
[_AM_PROG_CC_C_O
])
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
@ -372,7 +331,7 @@ fi])])
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.62])dnl
[AC_PREREQ([2.65])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@ -402,8 +361,7 @@ AC_SUBST([CYGPATH_W])
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[AC_DIAGNOSE([obsolete],
[$0: two- and three-arguments forms are deprecated. For more info, see:
http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
[$0: two- and three-arguments forms are deprecated.])
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
@ -431,7 +389,11 @@ AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
@ -453,22 +415,60 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES([OBJC])],
[m4_define([AC_PROG_OBJC],
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
dnl Support for Objective C++ was only introduced in Autoconf 2.65,
dnl but we still cater to Autoconf 2.62.
m4_ifdef([AC_PROG_OBJCXX],
[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[_AM_DEPENDENCIES([OBJCXX])],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
])
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
# recipes. So use an aggressive probe to check that the usage we want is
# actually supported "in the wild" to an acceptable degree.
# See automake bug#10828.
# To make any issue more visible, cause the running configure to be aborted
# by default if the 'rm' program in use doesn't match our expectations; the
# user can still override this though.
if rm -f && rm -fr && rm -rf; then : OK; else
cat >&2 <<'END'
Oops!
Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present. This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message. This
can help us improve future automake versions.
END
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
echo 'Configuration will proceed anyway, since you have set the' >&2
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
echo >&2
else
cat >&2 <<'END'
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: <http://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@ -476,7 +476,6 @@ dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
@ -498,14 +497,12 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
@ -521,14 +518,12 @@ if test x"${install_sh}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2012 Free Software Foundation, Inc.
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
@ -545,14 +540,12 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 7
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
@ -580,18 +573,14 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
]
)
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2012 Free Software Foundation, Inc.
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 7
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
@ -599,11 +588,10 @@ AC_DEFUN([AM_MISSING_PROG],
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
# Define MISSING if not defined so far and test if it is modern enough.
# If it is, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
@ -616,8 +604,8 @@ if test x"${MISSING+set}" != xset; then
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
AC_MSG_WARN(['missing' script is too old or missing])
@ -626,14 +614,12 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 6
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
@ -657,14 +643,12 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 1
# AM_RUN_LOG(COMMAND)
# -------------------
# Run COMMAND, save the exit status in ac_status, and log it.
@ -678,14 +662,12 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 9
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
@ -761,13 +743,71 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
# Copyright (C) 2009-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# AM_SILENT_RULES([DEFAULT])
# --------------------------
# Enable less verbose build rules; with the default set to DEFAULT
# ("yes" being less verbose, "no" or empty being verbose).
AC_DEFUN([AM_SILENT_RULES],
[AC_ARG_ENABLE([silent-rules], [dnl
AS_HELP_STRING(
[--enable-silent-rules],
[less verbose build output (undo: "make V=1")])
AS_HELP_STRING(
[--disable-silent-rules],
[verbose build output (undo: "make V=0")])dnl
])
case $enable_silent_rules in @%:@ (((
yes) AM_DEFAULT_VERBOSITY=0;;
no) AM_DEFAULT_VERBOSITY=1;;
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
esac
dnl
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
dnl do not support nested variable expansions.
dnl See automake bug#9928 and bug#10237.
am_make=${MAKE-make}
AC_CACHE_CHECK([whether $am_make supports nested variables],
[am_cv_make_support_nested_variables],
[if AS_ECHO([['TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
am__doit:
@$(TRUE)
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
am_cv_make_support_nested_variables=yes
else
am_cv_make_support_nested_variables=no
fi])
if test $am_cv_make_support_nested_variables = yes; then
dnl Using '$V' instead of '$(V)' breaks IRIX make.
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AC_SUBST([AM_V])dnl
AM_SUBST_NOTMAKE([AM_V])dnl
AC_SUBST([AM_DEFAULT_V])dnl
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
AM_BACKSLASH='\'
AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
@ -791,14 +831,12 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2012 Free Software Foundation, Inc.
# Copyright (C) 2006-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@ -812,14 +850,12 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2012 Free Software Foundation, Inc.
# Copyright (C) 2004-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
@ -833,76 +869,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
#
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
m4_if([$1], [v7],
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of '-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
m4_if([$1], [v7],
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
# tar/untar a dummy directory, and stop if the command works
[m4_case([$1],
[ustar],
[# The POSIX 1988 'ustar' format is defined with fixed-size fields.
# There is notably a 21 bits limit for the UID and the GID. In fact,
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
# and bug#13588).
am_max_uid=2097151 # 2^21 - 1
am_max_gid=$am_max_uid
# The $UID and $GID variables are not portable, so we need to resort
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls
# below are definitely unexpected, so allow the users to see them
# (that is, avoid stderr redirection).
am_uid=`id -u || echo unknown`
am_gid=`id -g || echo unknown`
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
if test $am_uid -le $am_max_uid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
if test $am_gid -le $am_max_gid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi],
[pax],
[],
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Go ahead even if we have the value already cached. We do so because we
# need to set the values for the 'am__tar' and 'am__untar' variables.
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
for _am_tool in $_am_tools; do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar; do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works.
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
AM_RUN_LOG([cat conftest.dir/file])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR

Просмотреть файл

@ -44,6 +44,53 @@
<key>LSIsAppleDefaultForType</key>
<true/>
</dict>
<dict>
<key>CFBundleTypeName</key>
<string>Source Code</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>public.source-code</string>
</array>
</dict>
<dict>
<key>CFBundleTypeName</key>
<string>Text Document</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>public.text</string>
</array>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>Anything</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.xamarin.monodevelop</string>
<key>CFBundleURLSchemes</key>
<array>
<string>monodevelop</string>
</array>
</dict>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>

Просмотреть файл

@ -1,28 +1,20 @@
MAC_APP_DIR=MonoDevelop.app
APP_NAME=MonoDevelop
MACOS=$(MAC_APP_DIR)/Contents/MacOS
MAC_APP_LIB_DIR=$(MACOS)/lib/monodevelop
ADDINS=$(MACOS)/lib/monodevelop/AddIns
LIB_DIR=$(MAC_APP_DIR)/Contents/Resources/lib
MAC_APP_LIB_DIR=$(LIB_DIR)/monodevelop
ADDINS=$(MAC_APP_LIB_DIR)/AddIns
EXTRAS=$(top_srcdir)/../extras
ARTIFACTS=$(top_srcdir)/../../artifacts
MD_CONFIGURE=$(top_srcdir)/../scripts/configure.sh
SDK_PATH=$(shell xcrun --sdk macosx10.8 --show-sdk-path)
# In which commit did the MonoDevelop version change? 00000000 if uncommitted
commit_of_last_version_change := $(shell LANG=C git blame $(top_srcdir)/configure.in | grep AC_INIT | sed 's/ .*//')
# How many commits have passed since $(-commit-of-last-version-change)?
# "0" when commit hash is invalid (e.g. 00000000)
num_commits_since_version_change := $(shell LANG=C git rev-list --count $(commit_of_last_version_change)..HEAD)
PACKAGE_VERSION_MAJOR=0$(word 1, $(subst ., ,$(VERSION)))
PACKAGE_VERSION_MINOR=$(word 2, $(subst ., ,$(VERSION)))
PACKAGE_VERSION_REV=0$(word 3, $(subst ., ,$(VERSION)))
PACKAGE_VERSION_BUILD=$(num_commits_since_version_change)
PACKAGE_UPDATE_ID=$(shell echo $(PACKAGE_VERSION_MAJOR) $(PACKAGE_VERSION_MINOR) $(PACKAGE_VERSION_REV) $(PACKAGE_VERSION_BUILD) | awk '{printf "%d%02d%02d%04d",$$1,$$2,$$3,$$4}')
BUNDLE_VERSION=$(shell echo $(PACKAGE_VERSION_MAJOR) $(PACKAGE_VERSION_MINOR) $(PACKAGE_VERSION_REV) $(PACKAGE_VERSION_BUILD) | awk '{printf "%d.%d.%d.%d",$$1,$$2,$$3,$$4}')
PACKAGE_UPDATE_ID=$(shell $(MD_CONFIGURE) get-releaseid)
BUNDLE_VERSION=$(shell $(MD_CONFIGURE) get-version)
CLEANFILES = render.exe
#DISTCLEANFILES =
EXTRA_DIST = dmg-bg.png DS_Store Info.plist.in make-dmg-bundle.sh render.exe
EXTRA_DIST = dmg-bg.png DS_Store Info.plist.in make-dmg-bundle.sh render.cs
all: app
@ -32,8 +24,8 @@ render.exe: render.cs
dmg: render.exe app
./make-dmg-bundle.sh
monostub: monostub.m
gcc -Wall -mmacosx-version-min=10.6 -m32 -o monostub monostub.m -framework AppKit
monostub: monostub.m $(MONOSTUB_EXTRA_SOURCES)
gcc -Wall -mmacosx-version-min=10.6 -m32 -o $@ $^ -framework AppKit -isysroot $(SDK_PATH)
clean-local:
rm -rf MonoDevelop.app
@ -44,7 +36,7 @@ app: monostub
@echo "Creating directories in app bundle"
@echo ""
mkdir -p $(MAC_APP_DIR)/Contents/{MacOS,Resources}
mkdir -p $(MAC_APP_DIR)/Contents/MacOS/{lib,share}
mkdir -p $(MAC_APP_DIR)/Contents/MacOS/share
mkdir -p $(MAC_APP_LIB_DIR)
# @echo ""
@ -61,6 +53,7 @@ app: monostub
@echo "Copying MonoDevelop into app bundle"
@echo ""
cp -pR ../AddIns $(MAC_APP_LIB_DIR)
cp -pR ../../external/fsharpbinding/monodevelop/bin/mac-linux/Debug $(MAC_APP_LIB_DIR)/AddIns/fsharpbinding
cp -pR ../data $(MAC_APP_LIB_DIR)
cp -pR ../bin $(MAC_APP_LIB_DIR)
cp -pR ../locale $(MAC_APP_DIR)/Contents/MacOS/share
@ -70,9 +63,9 @@ app: monostub
sed -e "s/@BUNDLE_VERSION@/$(BUNDLE_VERSION)/" -e "s/@ASSEMBLY_VERSION@/$(ASSEMBLY_VERSION)/" -e "s/@APP_NAME@/$(APP_NAME)/" -e "s|@RELEASE_ID@|$(PACKAGE_UPDATE_ID)|" Info.plist.in > $(MAC_APP_DIR)/Contents/Info.plist
cp ../../theme-icons/Mac/*.icns $(MAC_APP_DIR)/Contents/Resources/
# copy monodevelop.pc and monodevelop-core-addins.pc to Contents/MacOS/lib/pkgconfig
mkdir -p $(MACOS)/lib/pkgconfig
cp ../../*.pc $(MACOS)/lib/pkgconfig
# copy monodevelop.pc and monodevelop-core-addins.pc to Contents/Resources/lib/pkgconfig
mkdir -p $(LIB_DIR)/pkgconfig
cp ../../*.pc $(LIB_DIR)/pkgconfig
# Copy main/monodevelop.xml to MonoDevelop.app/Contents/MacOS/share/mime/packages
mkdir -p $(MACOS)/share/{applications,mime,icons,locale,man}
@ -100,13 +93,13 @@ app: monostub
@echo "Removing unneeded files"
@echo ""
rm -rf $(MACOS)/lib/monodevelop/bin/UnitTests.dll* \
$(MACOS)/lib/monodevelop/bin/TestResult.xml \
$(MACOS)/lib/monodevelop/bin/addin-db* \
$(MACOS)/lib/monodevelop/bin/local \
$(MACOS)/lib/monodevelop/bin/repository-cache* \
$(MACOS)/lib/monodevelop/bin/addins-setup.config \
$(MACOS)/lib/monodevelop/AddIns/MonoDevelop.TextTemplating/Mono.TextTemplating.Tests*
rm -rf $(MAC_APP_LIB_DIR)/bin/UnitTests.dll* \
$(MAC_APP_LIB_DIR)/bin/TestResult.xml \
$(MAC_APP_LIB_DIR)/bin/addin-db* \
$(MAC_APP_LIB_DIR)/bin/local \
$(MAC_APP_LIB_DIR)/bin/repository-cache* \
$(MAC_APP_LIB_DIR)/bin/addins-setup.config \
$(MAC_APP_LIB_DIR)/AddIns/MonoDevelop.TextTemplating/Mono.TextTemplating.Tests*
# add extras known to work on Mac, if they exist
@echo ""
@ -126,7 +119,7 @@ app: monostub
@echo "Copying binary artifacts into app bundle"
@echo ""
mkdir -p $(MACOS)/lib/pkgconfig
mkdir -p $(LIB_DIR)/pkgconfig
mkdir -p $(MACOS)/MonoDoc.app/
test ! -d $(ARTIFACTS)/MonoDoc.app || cp -pR $(ARTIFACTS)/MonoDoc.app/* $(MACOS)/MonoDoc.app/
@ -137,19 +130,13 @@ app: monostub
@echo "Updating build information"
@echo ""
pushd ../..; make buildinfo; popd
echo "a3140c14-ef90-4019-ae6c-9d93804d6611 $(PACKAGE_UPDATE_ID)" > "$(MACOS)/updateinfo"
echo "Release ID: $(PACKAGE_UPDATE_ID)" > "$(MACOS)/lib/monodevelop/bin/buildinfo"
@cat ../bin/buildinfo >> "$(MACOS)/lib/monodevelop/bin/buildinfo"
$(MD_CONFIGURE) gen-buildinfo "$(MAC_APP_LIB_DIR)/bin"
# touch the directory so that update dependencies work
touch MonoDevelop.app
@echo ""
@echo "MONODEVELOP RELEASE: $(PACKAGE_UPDATE_ID)"
@echo "$$(cat ../../vcrevision)"
@cat "$(MAC_APP_LIB_DIR)/bin/buildinfo"
@if test -f missing-stuff; then echo ""; echo "Missing stuff:"; cat missing-stuff; fi
@echo ""
@rm -f missing-stuff

Просмотреть файл

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.12.1 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -14,23 +14,51 @@
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
test $$am__dry = yes; \
}
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@ -48,7 +76,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = build/MacOSX
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ChangeLog
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@ -56,6 +84,18 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
@ -63,16 +103,19 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_FLAGS = @ACLOCAL_FLAGS@
ALL_LINGUAS = @ALL_LINGUAS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
ASSEMBLY_VERSION = @ASSEMBLY_VERSION@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
COMPAT_ADDIN_VERSION = @COMPAT_ADDIN_VERSION@
CSC = @CSC@
CSC_FLAGS = @CSC_FLAGS@
CYGPATH_W = @CYGPATH_W@
@ -186,26 +229,18 @@ top_srcdir = @top_srcdir@
MAC_APP_DIR = MonoDevelop.app
APP_NAME = MonoDevelop
MACOS = $(MAC_APP_DIR)/Contents/MacOS
MAC_APP_LIB_DIR = $(MACOS)/lib/monodevelop
ADDINS = $(MACOS)/lib/monodevelop/AddIns
LIB_DIR = $(MAC_APP_DIR)/Contents/Resources/lib
MAC_APP_LIB_DIR = $(LIB_DIR)/monodevelop
ADDINS = $(MAC_APP_LIB_DIR)/AddIns
EXTRAS = $(top_srcdir)/../extras
ARTIFACTS = $(top_srcdir)/../../artifacts
# In which commit did the MonoDevelop version change? 00000000 if uncommitted
commit_of_last_version_change := $(shell LANG=C git blame $(top_srcdir)/configure.in | grep AC_INIT | sed 's/ .*//')
# How many commits have passed since $(-commit-of-last-version-change)?
# "0" when commit hash is invalid (e.g. 00000000)
num_commits_since_version_change := $(shell LANG=C git rev-list --count $(commit_of_last_version_change)..HEAD)
PACKAGE_VERSION_MAJOR = 0$(word 1, $(subst ., ,$(VERSION)))
PACKAGE_VERSION_MINOR = $(word 2, $(subst ., ,$(VERSION)))
PACKAGE_VERSION_REV = 0$(word 3, $(subst ., ,$(VERSION)))
PACKAGE_VERSION_BUILD = $(num_commits_since_version_change)
PACKAGE_UPDATE_ID = $(shell echo $(PACKAGE_VERSION_MAJOR) $(PACKAGE_VERSION_MINOR) $(PACKAGE_VERSION_REV) $(PACKAGE_VERSION_BUILD) | awk '{printf "%d%02d%02d%04d",$$1,$$2,$$3,$$4}')
BUNDLE_VERSION = $(shell echo $(PACKAGE_VERSION_MAJOR) $(PACKAGE_VERSION_MINOR) $(PACKAGE_VERSION_REV) $(PACKAGE_VERSION_BUILD) | awk '{printf "%d.%d.%d.%d",$$1,$$2,$$3,$$4}')
MD_CONFIGURE = $(top_srcdir)/../scripts/configure.sh
SDK_PATH = $(shell xcrun --sdk macosx10.8 --show-sdk-path)
PACKAGE_UPDATE_ID = $(shell $(MD_CONFIGURE) get-releaseid)
BUNDLE_VERSION = $(shell $(MD_CONFIGURE) get-version)
CLEANFILES = render.exe
#DISTCLEANFILES =
EXTRA_DIST = dmg-bg.png DS_Store Info.plist.in make-dmg-bundle.sh render.exe
EXTRA_DIST = dmg-bg.png DS_Store Info.plist.in make-dmg-bundle.sh render.cs
all: all-am
.SUFFIXES:
@ -239,11 +274,9 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
tags: TAGS
TAGS:
tags TAGS:
ctags: CTAGS
CTAGS:
ctags CTAGS:
cscope cscopelist:
@ -382,15 +415,15 @@ uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-local \
distclean distclean-generic distdir dvi dvi-am html html-am \
info info-am install install-am install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
uninstall-am
cscopelist-am ctags-am distclean distclean-generic distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags-am uninstall uninstall-am
all: app
@ -401,8 +434,8 @@ render.exe: render.cs
dmg: render.exe app
./make-dmg-bundle.sh
monostub: monostub.m
gcc -Wall -mmacosx-version-min=10.6 -m32 -o monostub monostub.m -framework AppKit
monostub: monostub.m $(MONOSTUB_EXTRA_SOURCES)
gcc -Wall -mmacosx-version-min=10.6 -m32 -o $@ $^ -framework AppKit -isysroot $(SDK_PATH)
clean-local:
rm -rf MonoDevelop.app
@ -413,7 +446,7 @@ app: monostub
@echo "Creating directories in app bundle"
@echo ""
mkdir -p $(MAC_APP_DIR)/Contents/{MacOS,Resources}
mkdir -p $(MAC_APP_DIR)/Contents/MacOS/{lib,share}
mkdir -p $(MAC_APP_DIR)/Contents/MacOS/share
mkdir -p $(MAC_APP_LIB_DIR)
# @echo ""
@ -430,6 +463,7 @@ app: monostub
@echo "Copying MonoDevelop into app bundle"
@echo ""
cp -pR ../AddIns $(MAC_APP_LIB_DIR)
cp -pR ../../external/fsharpbinding/monodevelop/bin/mac-linux/Debug $(MAC_APP_LIB_DIR)/AddIns/fsharpbinding
cp -pR ../data $(MAC_APP_LIB_DIR)
cp -pR ../bin $(MAC_APP_LIB_DIR)
cp -pR ../locale $(MAC_APP_DIR)/Contents/MacOS/share
@ -439,9 +473,9 @@ app: monostub
sed -e "s/@BUNDLE_VERSION@/$(BUNDLE_VERSION)/" -e "s/@ASSEMBLY_VERSION@/$(ASSEMBLY_VERSION)/" -e "s/@APP_NAME@/$(APP_NAME)/" -e "s|@RELEASE_ID@|$(PACKAGE_UPDATE_ID)|" Info.plist.in > $(MAC_APP_DIR)/Contents/Info.plist
cp ../../theme-icons/Mac/*.icns $(MAC_APP_DIR)/Contents/Resources/
# copy monodevelop.pc and monodevelop-core-addins.pc to Contents/MacOS/lib/pkgconfig
mkdir -p $(MACOS)/lib/pkgconfig
cp ../../*.pc $(MACOS)/lib/pkgconfig
# copy monodevelop.pc and monodevelop-core-addins.pc to Contents/Resources/lib/pkgconfig
mkdir -p $(LIB_DIR)/pkgconfig
cp ../../*.pc $(LIB_DIR)/pkgconfig
# Copy main/monodevelop.xml to MonoDevelop.app/Contents/MacOS/share/mime/packages
mkdir -p $(MACOS)/share/{applications,mime,icons,locale,man}
@ -469,13 +503,13 @@ app: monostub
@echo "Removing unneeded files"
@echo ""
rm -rf $(MACOS)/lib/monodevelop/bin/UnitTests.dll* \
$(MACOS)/lib/monodevelop/bin/TestResult.xml \
$(MACOS)/lib/monodevelop/bin/addin-db* \
$(MACOS)/lib/monodevelop/bin/local \
$(MACOS)/lib/monodevelop/bin/repository-cache* \
$(MACOS)/lib/monodevelop/bin/addins-setup.config \
$(MACOS)/lib/monodevelop/AddIns/MonoDevelop.TextTemplating/Mono.TextTemplating.Tests*
rm -rf $(MAC_APP_LIB_DIR)/bin/UnitTests.dll* \
$(MAC_APP_LIB_DIR)/bin/TestResult.xml \
$(MAC_APP_LIB_DIR)/bin/addin-db* \
$(MAC_APP_LIB_DIR)/bin/local \
$(MAC_APP_LIB_DIR)/bin/repository-cache* \
$(MAC_APP_LIB_DIR)/bin/addins-setup.config \
$(MAC_APP_LIB_DIR)/AddIns/MonoDevelop.TextTemplating/Mono.TextTemplating.Tests*
# add extras known to work on Mac, if they exist
@echo ""
@ -495,7 +529,7 @@ app: monostub
@echo "Copying binary artifacts into app bundle"
@echo ""
mkdir -p $(MACOS)/lib/pkgconfig
mkdir -p $(LIB_DIR)/pkgconfig
mkdir -p $(MACOS)/MonoDoc.app/
test ! -d $(ARTIFACTS)/MonoDoc.app || cp -pR $(ARTIFACTS)/MonoDoc.app/* $(MACOS)/MonoDoc.app/
@ -506,19 +540,13 @@ app: monostub
@echo "Updating build information"
@echo ""
pushd ../..; make buildinfo; popd
echo "a3140c14-ef90-4019-ae6c-9d93804d6611 $(PACKAGE_UPDATE_ID)" > "$(MACOS)/updateinfo"
echo "Release ID: $(PACKAGE_UPDATE_ID)" > "$(MACOS)/lib/monodevelop/bin/buildinfo"
@cat ../bin/buildinfo >> "$(MACOS)/lib/monodevelop/bin/buildinfo"
$(MD_CONFIGURE) gen-buildinfo "$(MAC_APP_LIB_DIR)/bin"
# touch the directory so that update dependencies work
touch MonoDevelop.app
@echo ""
@echo "MONODEVELOP RELEASE: $(PACKAGE_UPDATE_ID)"
@echo "$$(cat ../../vcrevision)"
@cat "$(MAC_APP_LIB_DIR)/bin/buildinfo"
@if test -f missing-stuff; then echo ""; echo "Missing stuff:"; cat missing-stuff; fi
@echo ""
@rm -f missing-stuff

Просмотреть файл

@ -34,7 +34,7 @@ rm -f "$DMG_FILE.master"
# Compute an approximated image size in MB, and bloat by 1MB
image_size=$(du -ck "$DMG_APP" | tail -n1 | cut -f1)
image_size=$((($image_size + 2000) / 1000))
image_size=$((($image_size + 40000) / 1000))
echo "Creating disk image (${image_size}MB)..."
hdiutil create "$DMG_FILE" -megabytes $image_size -volname "$VOLUME_NAME" -fs HFS+ -quiet || exit $?

24
build/MacOSX/render.cs Normal file
Просмотреть файл

@ -0,0 +1,24 @@
using System;
using System.Drawing;
using System.Drawing.Imaging;
class X {
static void Main (string[] args)
{
var background = new Bitmap ("dmg-bg.png");
var ctx = Graphics.FromImage (background);
//system.drawing doesn't allow setting the actual font weight
//so we can't get it as heavy as we need :/
var font = new Font ("Helvetica", 12, FontStyle.Bold);
var light = new SolidBrush (Color.FromArgb (255, 255, 255, 255));
var dark = new SolidBrush (Color.FromArgb (230, 151, 173, 190));
float x = 10, y = 10;
ctx.DrawString (args[0], font, light, new PointF (x, y + 1f));
ctx.DrawString (args[0], font, dark, new PointF (x, y));
background.Save ("dmg-bg-with-version.png", ImageFormat.Png);
}
}

Просмотреть файл

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.12.1 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -14,23 +14,51 @@
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
test $$am__dry = yes; \
}
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@ -48,7 +76,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = build
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@ -56,15 +84,28 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@ -72,9 +113,29 @@ am__can_run_installinfo = \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = MacOSX
@ -108,11 +169,13 @@ ACLOCAL = @ACLOCAL@
ACLOCAL_FLAGS = @ACLOCAL_FLAGS@
ALL_LINGUAS = @ALL_LINGUAS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
ASSEMBLY_VERSION = @ASSEMBLY_VERSION@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
COMPAT_ADDIN_VERSION = @COMPAT_ADDIN_VERSION@
CSC = @CSC@
CSC_FLAGS = @CSC_FLAGS@
CYGPATH_W = @CYGPATH_W@
@ -265,17 +328,20 @@ $(am__aclocal_m4_deps):
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
@ -290,61 +356,12 @@ $(RECURSIVE_TARGETS):
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
cscopelist-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
done
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@ -360,12 +377,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@ -377,15 +389,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@ -394,9 +402,10 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP)'; \
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
@ -567,22 +576,20 @@ ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
cscopelist-recursive ctags-recursive install-am install-strip \
tags-recursive
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic clean-local \
cscopelist cscopelist-recursive ctags ctags-recursive \
distclean distclean-generic distclean-tags distdir dvi dvi-am \
html html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-local cscopelist-am ctags \
ctags-am distclean distclean-generic distclean-tags distdir \
dvi dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
all:

3
buildinfo Normal file
Просмотреть файл

@ -0,0 +1,3 @@
Release ID: 505000227
Git revision: 7b721eeec7a2fa4c4f4de0ecd2aed4dc25edac95
Build date: 2014-10-04 10:28:13+01

320
configure поставляемый
Просмотреть файл

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for monodevelop 4.0.12.
# Generated by GNU Autoconf 2.69 for monodevelop 5.5.
#
# Report bugs to <monodevelop-list@lists.ximian.com>.
#
@ -579,8 +579,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='monodevelop'
PACKAGE_TARNAME='monodevelop'
PACKAGE_VERSION='4.0.12'
PACKAGE_STRING='monodevelop 4.0.12'
PACKAGE_VERSION='5.5'
PACKAGE_STRING='monodevelop 5.5'
PACKAGE_BUGREPORT='monodevelop-list@lists.ximian.com'
PACKAGE_URL=''
@ -591,6 +591,7 @@ MD_ADDIN_DIR
MD_ASSEMBLY_DIR
CSC_FLAGS
SQLITE_XML
COMPAT_ADDIN_VERSION
PACKAGE_VERSION_LABEL
ASSEMBLY_VERSION
LIB_PREFIX
@ -655,6 +656,10 @@ ACLOCAL_FLAGS
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
AM_V
am__untar
am__tar
AMTAR
@ -719,6 +724,7 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_silent_rules
enable_maintainer_mode
enable_update_mimedb
enable_update_desktopdb
@ -1295,7 +1301,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures monodevelop 4.0.12 to adapt to many kinds of systems.
\`configure' configures monodevelop 5.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1361,7 +1367,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of monodevelop 4.0.12:";;
short | recursive ) echo "Configuration of monodevelop 5.5:";;
esac
cat <<\_ACEOF
@ -1369,6 +1375,8 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0")
--enable-maintainer-mode
enable make rules and dependencies not useful (and
sometimes confusing) to the casual installer
@ -1498,7 +1506,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
monodevelop configure 4.0.12
monodevelop configure 5.5
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1515,7 +1523,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by monodevelop $as_me 4.0.12, which was
It was created by monodevelop $as_me 5.5, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -1864,7 +1872,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
am__api_version='1.12'
am__api_version='1.14'
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@ -2077,8 +2085,8 @@ if test x"${MISSING+set}" != xset; then
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
@ -2318,6 +2326,45 @@ else
fi
rmdir .tst 2>/dev/null
# Check whether --enable-silent-rules was given.
if test "${enable_silent_rules+set}" = set; then :
enableval=$enable_silent_rules;
fi
case $enable_silent_rules in # (((
yes) AM_DEFAULT_VERBOSITY=0;;
no) AM_DEFAULT_VERBOSITY=1;;
*) AM_DEFAULT_VERBOSITY=1;;
esac
am_make=${MAKE-make}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
if ${am_cv_make_support_nested_variables+:} false; then :
$as_echo_n "(cached) " >&6
else
if $as_echo 'TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
am__doit:
@$(TRUE)
.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
am_cv_make_support_nested_variables=yes
else
am_cv_make_support_nested_variables=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
$as_echo "$am_cv_make_support_nested_variables" >&6; }
if test $am_cv_make_support_nested_variables = yes; then
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AM_BACKSLASH='\'
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
@ -2340,7 +2387,7 @@ fi
# Define the identity of the package.
PACKAGE='monodevelop'
VERSION='4.0.12'
VERSION='5.5'
cat >>confdefs.h <<_ACEOF
@ -2368,7 +2415,12 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
mkdir_p="$MKDIR_P"
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
@ -2376,86 +2428,125 @@ mkdir_p="$MKDIR_P"
AMTAR='$${TAR-tar}'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
$as_echo_n "checking how to create a ustar tar archive... " >&6; }
# Loop over all known methods to create a tar archive until one works.
# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar plaintar pax cpio none'
_am_tools=${am_cv_prog_tar_ustar-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of '-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
{ echo "$as_me:$LINENO: $_am_tar --version" >&5
# The POSIX 1988 'ustar' format is defined with fixed-size fields.
# There is notably a 21 bits limit for the UID and the GID. In fact,
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
# and bug#13588).
am_max_uid=2097151 # 2^21 - 1
am_max_gid=$am_max_uid
# The $UID and $GID variables are not portable, so we need to resort
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls
# below are definitely unexpected, so allow the users to see them
# (that is, avoid stderr redirection).
am_uid=`id -u || echo unknown`
am_gid=`id -g || echo unknown`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5
$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; }
if test $am_uid -le $am_max_uid; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
_am_tools=none
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5
$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; }
if test $am_gid -le $am_max_gid; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
_am_tools=none
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
$as_echo_n "checking how to create a ustar tar archive... " >&6; }
# Go ahead even if we have the value already cached. We do so because we
# need to set the values for the 'am__tar' and 'am__untar' variables.
_am_tools=${am_cv_prog_tar_ustar-$_am_tools}
for _am_tool in $_am_tools; do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar; do
{ echo "$as_me:$LINENO: $_am_tar --version" >&5
($_am_tar --version) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && break
done
am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x ustar -w "$$tardir"'
am__tar_='pax -L -x ustar -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
am__untar='cpio -i -H ustar -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
done
am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x ustar -w "$$tardir"'
am__tar_='pax -L -x ustar -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
am__untar='cpio -i -H ustar -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_ustar}" && break
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_ustar}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
{ echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
# tar/untar a dummy directory, and stop if the command works.
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
{ echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
(tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
rm -rf conftest.dir
if test -s conftest.tar; then
{ echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
rm -rf conftest.dir
if test -s conftest.tar; then
{ echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
($am__untar <conftest.tar) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
{ echo "$as_me:$LINENO: cat conftest.dir/file" >&5
(cat conftest.dir/file) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
if ${am_cv_prog_tar_ustar+:} false; then :
if ${am_cv_prog_tar_ustar+:} false; then :
$as_echo_n "(cached) " >&6
else
am_cv_prog_tar_ustar=$_am_tool
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
$as_echo "$am_cv_prog_tar_ustar" >&6; }
@ -2463,6 +2554,48 @@ $as_echo "$am_cv_prog_tar_ustar" >&6; }
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
# recipes. So use an aggressive probe to check that the usage we want is
# actually supported "in the wild" to an acceptable degree.
# See automake bug#10828.
# To make any issue more visible, cause the running configure to be aborted
# by default if the 'rm' program in use doesn't match our expectations; the
# user can still override this though.
if rm -f && rm -fr && rm -rf; then : OK; else
cat >&2 <<'END'
Oops!
Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present. This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message. This
can help us improve future automake versions.
END
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
echo 'Configuration will proceed anyway, since you have set the' >&2
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
echo >&2
else
cat >&2 <<'END'
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: <http://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.
END
as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
@ -2489,13 +2622,15 @@ fi
#capture aclocal flags for autoreconf
ASSEMBLY_VERSION=4.0.12.0
ASSEMBLY_VERSION=4.0.0.0
# This is parsed in BuildVariables.cs. Keep the format consistent to avoid breaking
# the C# side of things. It should be one of the following two formats:
# 1) "VERSION_NUMBER" "2.0"
# 2) "VERSION_NUMBER BUILD_TYPE BUILD_NUMBER" "2.0 Alpha 1"
PACKAGE_VERSION_LABEL="4.0.12"
PACKAGE_VERSION_LABEL="5.5"
COMPAT_ADDIN_VERSION=5.0
# Extract the first word of "mono", so it can be a program name with args.
set dummy mono; ac_word=$2
@ -2628,15 +2763,7 @@ fi
# On OSX use Mono's private copy of pkg-config if it exists
OSX_PKG_CONFIG=/Library/Frameworks/Mono.framework/Versions/Current/bin/pkg-config
if test -e $OSX_PKG_CONFIG; then
PKG_CONFIG=$OSX_PKG_CONFIG
elif test "x$PKG_CONFIG" = "xno"; then
as_fn_error $? "You need to install pkg-config" "$LINENO" 5
fi
MONO_REQUIRED_VERSION=2.10.9
MONO_REQUIRED_VERSION=3.0.4
if ! $PKG_CONFIG --atleast-version=$MONO_REQUIRED_VERSION mono; then
as_fn_error $? "You need mono $MONO_REQUIRED_VERSION or newer" "$LINENO" 5
@ -2921,7 +3048,6 @@ if test "x$MSGMERGE" = "xno"; then
as_fn_error $? "You need to install msgmerge from intltool" "$LINENO" 5
fi
MONO_REQUIRED_VERSION=2.8
@ -4074,7 +4200,7 @@ else
fi
ALL_LINGUAS="cs da de es fr ja pt_BR tr pl it zh_TW zh_CN ru sl ca gl pt sv nl id hu nb"
ALL_LINGUAS="cs da de es fr ja pt_BR tr pl it zh_TW zh_CN ru sl ca gl pt sv nl id hu nb ko"
GETTEXT_PACKAGE=monodevelop
@ -4094,6 +4220,7 @@ CSC_FLAGS="-debug -codepage:utf8"
MD_DIR='$(prefix)/lib/monodevelop'
MD_ASSEMBLY_DIR="$MD_DIR/bin"
MD_ADDIN_DIR="$MD_DIR/AddIns"
@ -4108,7 +4235,7 @@ fi
echo PACKAGE_VERSION=$PACKAGE_VERSION > monodevelop_version
ac_config_files="$ac_config_files build/Makefile build/MacOSX/Makefile contrib/Makefile contrib/ICSharpCode.Decompiler/Makefile external/Makefile src/Makefile src/core/Makefile src/core/Mono.Texteditor/Makefile src/core/MonoDevelop.Core/Makefile src/core/MonoDevelop.Projects.Formats.MSBuild/Makefile src/core/MonoDevelop.Ide/Makefile src/core/MonoDevelop.Ide/BuildVariables.cs src/core/MonoDevelop.Startup/Makefile src/tools/Makefile src/tools/mdhost/Makefile src/tools/mdtool/Makefile src/tools/SharpCoco/Makefile src/tools/mdmonitor/Makefile src/addins/Makefile src/addins/MonoDeveloperExtensions/Makefile src/addins/MonoDeveloperExtensions/NUnit/Makefile src/addins/NUnit/Makefile src/addins/NUnit/NUnitRunner/Makefile src/addins/VersionControl/MonoDevelop.VersionControl/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Git/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/Makefile src/addins/VersionControl/Makefile src/addins/CSharpBinding/Makefile src/addins/CSharpBinding/Autotools/Makefile src/addins/CSharpBinding/AspNet/Makefile src/addins/ILAsmBinding/Makefile src/addins/VBNetBinding/Makefile src/addins/prj2make-sharp-lib/Makefile src/addins/ChangeLogAddIn/Makefile src/addins/MonoDevelop.GtkCore/Makefile src/addins/MonoDevelop.GtkCore/libstetic/Makefile src/addins/MonoDevelop.GtkCore/libsteticui/Makefile src/addins/TextTemplating/Makefile src/addins/TextTemplating/Mono.TextTemplating/Makefile src/addins/TextTemplating/TextTransform/Makefile src/addins/TextTemplating/MonoDevelop.TextTemplating/Makefile src/addins/TextTemplating/Mono.TextTemplating.Tests/Makefile src/addins/AspNet/Makefile src/addins/AspNet/MonoDevelop.AspNet/Makefile src/addins/AspNet/MonoDevelop.AspNet.Mvc/Makefile src/addins/MonoDevelop.Autotools/Makefile src/addins/MonoDevelop.DesignerSupport/Makefile src/addins/MonoDevelop.WebReferences/Makefile src/addins/Deployment/Makefile src/addins/Deployment/MonoDevelop.Deployment/Makefile src/addins/Deployment/MonoDevelop.Deployment.Linux/Makefile src/addins/MonoDevelop.Gettext/Makefile src/addins/MonoDevelop.RegexToolkit/Makefile src/addins/CBinding/Makefile src/addins/GnomePlatform/Makefile src/addins/MacPlatform/Makefile src/addins/WindowsPlatform/Makefile src/addins/MonoDevelop.AssemblyBrowser/Makefile src/addins/MonoDevelop.SourceEditor2/Makefile src/addins/MonoDevelop.XmlEditor/Makefile src/addins/MonoDevelop.Refactoring/Makefile src/addins/MonoDevelop.Debugger/Makefile src/addins/MonoDevelop.Debugger.Soft/Makefile src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/Makefile src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/Makefile src/addins/MonoDevelop.HexEditor/Makefile src/addins/MonoDevelop.DocFood/Makefile tests/Makefile tests/UnitTests/Makefile tests/UserInterfaceTests/Makefile tests/MacPlatform.Tests/Makefile Makefile monodevelop mdtool monodevelop.pc monodevelop-core-addins.pc monodevelop-core-mac-addins.pc monodevelop.spec po/Makefile man/Makefile theme-icons/Makefile"
ac_config_files="$ac_config_files build/Makefile build/MacOSX/Makefile contrib/Makefile contrib/ICSharpCode.Decompiler/Makefile external/Makefile src/Makefile src/core/Makefile src/core/Mono.Texteditor/Makefile src/core/MonoDevelop.Core/Makefile src/core/MonoDevelop.Projects.Formats.MSBuild/Makefile src/core/MonoDevelop.Ide/Makefile src/core/MonoDevelop.Startup/Makefile src/core/MonoDevelop.TextEditor.Tests/Makefile src/tools/Makefile src/tools/mdhost/Makefile src/tools/mdtool/Makefile src/tools/SharpCoco/Makefile src/tools/mdmonitor/Makefile src/addins/Makefile src/addins/MonoDeveloperExtensions/Makefile src/addins/MonoDeveloperExtensions/NUnit/Makefile src/addins/NUnit/Makefile src/addins/NUnit/NUnitRunner/Makefile src/addins/VersionControl/MonoDevelop.VersionControl/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Git/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/Makefile src/addins/VersionControl/Makefile src/addins/CSharpBinding/Makefile src/addins/CSharpBinding/Autotools/Makefile src/addins/CSharpBinding/AspNet/Makefile src/addins/ILAsmBinding/Makefile src/addins/VBNetBinding/Makefile src/addins/ChangeLogAddIn/Makefile src/addins/MonoDevelop.GtkCore/Makefile src/addins/MonoDevelop.GtkCore/libstetic/Makefile src/addins/MonoDevelop.GtkCore/libsteticui/Makefile src/addins/TextTemplating/Makefile src/addins/TextTemplating/Mono.TextTemplating/Makefile src/addins/TextTemplating/TextTransform/Makefile src/addins/TextTemplating/MonoDevelop.TextTemplating/Makefile src/addins/TextTemplating/Mono.TextTemplating.Tests/Makefile src/addins/AspNet/Makefile src/addins/MonoDevelop.Autotools/Makefile src/addins/MonoDevelop.DesignerSupport/Makefile src/addins/MonoDevelop.WebReferences/Makefile src/addins/Deployment/Makefile src/addins/Deployment/MonoDevelop.Deployment/Makefile src/addins/Deployment/MonoDevelop.Deployment.Linux/Makefile src/addins/MonoDevelop.Gettext/Makefile src/addins/MonoDevelop.RegexToolkit/Makefile src/addins/CBinding/Makefile src/addins/GnomePlatform/Makefile src/addins/MacPlatform/Makefile src/addins/WindowsPlatform/Makefile src/addins/WindowsPlatform/WindowsAPICodePack/Makefile src/addins/WindowsPlatform/WindowsAPICodePack/Core/Makefile src/addins/WindowsPlatform/WindowsAPICodePack/Shell/Makefile src/addins/WindowsPlatform/WindowsPlatform/Makefile src/addins/MonoDevelop.AssemblyBrowser/Makefile src/addins/MonoDevelop.SourceEditor2/Makefile src/addins/Xml/Makefile src/addins/MonoDevelop.Refactoring/Makefile src/addins/MonoDevelop.Debugger/Makefile src/addins/MonoDevelop.Debugger.Gdb/Makefile src/addins/MonoDevelop.Debugger.Soft/Makefile src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/Makefile src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/Makefile src/addins/MonoDevelop.HexEditor/Makefile src/addins/MonoDevelop.DocFood/Makefile src/addins/MonoDevelop.PackageManagement/Makefile src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/Makefile tests/Makefile tests/UnitTests/Makefile tests/UserInterfaceTests/Makefile tests/TestRunner/Makefile tests/Ide.Tests/Makefile tests/MacPlatform.Tests/Makefile Makefile monodevelop mdtool monodevelop.pc monodevelop-core-addins.pc monodevelop-core-mac-addins.pc monodevelop.spec po/Makefile man/Makefile theme-icons/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -4709,7 +4836,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by monodevelop $as_me 4.0.12, which was
This file was extended by monodevelop $as_me 5.5, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -4762,7 +4889,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
monodevelop config.status 4.0.12
monodevelop config.status 5.5
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@ -4886,8 +5013,8 @@ do
"src/core/MonoDevelop.Core/Makefile") CONFIG_FILES="$CONFIG_FILES src/core/MonoDevelop.Core/Makefile" ;;
"src/core/MonoDevelop.Projects.Formats.MSBuild/Makefile") CONFIG_FILES="$CONFIG_FILES src/core/MonoDevelop.Projects.Formats.MSBuild/Makefile" ;;
"src/core/MonoDevelop.Ide/Makefile") CONFIG_FILES="$CONFIG_FILES src/core/MonoDevelop.Ide/Makefile" ;;
"src/core/MonoDevelop.Ide/BuildVariables.cs") CONFIG_FILES="$CONFIG_FILES src/core/MonoDevelop.Ide/BuildVariables.cs" ;;
"src/core/MonoDevelop.Startup/Makefile") CONFIG_FILES="$CONFIG_FILES src/core/MonoDevelop.Startup/Makefile" ;;
"src/core/MonoDevelop.TextEditor.Tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/core/MonoDevelop.TextEditor.Tests/Makefile" ;;
"src/tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/Makefile" ;;
"src/tools/mdhost/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/mdhost/Makefile" ;;
"src/tools/mdtool/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/mdtool/Makefile" ;;
@ -4910,7 +5037,6 @@ do
"src/addins/CSharpBinding/AspNet/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/CSharpBinding/AspNet/Makefile" ;;
"src/addins/ILAsmBinding/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/ILAsmBinding/Makefile" ;;
"src/addins/VBNetBinding/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/VBNetBinding/Makefile" ;;
"src/addins/prj2make-sharp-lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/prj2make-sharp-lib/Makefile" ;;
"src/addins/ChangeLogAddIn/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/ChangeLogAddIn/Makefile" ;;
"src/addins/MonoDevelop.GtkCore/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.GtkCore/Makefile" ;;
"src/addins/MonoDevelop.GtkCore/libstetic/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.GtkCore/libstetic/Makefile" ;;
@ -4921,8 +5047,6 @@ do
"src/addins/TextTemplating/MonoDevelop.TextTemplating/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/TextTemplating/MonoDevelop.TextTemplating/Makefile" ;;
"src/addins/TextTemplating/Mono.TextTemplating.Tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/TextTemplating/Mono.TextTemplating.Tests/Makefile" ;;
"src/addins/AspNet/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/AspNet/Makefile" ;;
"src/addins/AspNet/MonoDevelop.AspNet/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/AspNet/MonoDevelop.AspNet/Makefile" ;;
"src/addins/AspNet/MonoDevelop.AspNet.Mvc/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/AspNet/MonoDevelop.AspNet.Mvc/Makefile" ;;
"src/addins/MonoDevelop.Autotools/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.Autotools/Makefile" ;;
"src/addins/MonoDevelop.DesignerSupport/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.DesignerSupport/Makefile" ;;
"src/addins/MonoDevelop.WebReferences/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.WebReferences/Makefile" ;;
@ -4935,19 +5059,28 @@ do
"src/addins/GnomePlatform/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/GnomePlatform/Makefile" ;;
"src/addins/MacPlatform/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MacPlatform/Makefile" ;;
"src/addins/WindowsPlatform/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/WindowsPlatform/Makefile" ;;
"src/addins/WindowsPlatform/WindowsAPICodePack/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/WindowsPlatform/WindowsAPICodePack/Makefile" ;;
"src/addins/WindowsPlatform/WindowsAPICodePack/Core/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/WindowsPlatform/WindowsAPICodePack/Core/Makefile" ;;
"src/addins/WindowsPlatform/WindowsAPICodePack/Shell/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/WindowsPlatform/WindowsAPICodePack/Shell/Makefile" ;;
"src/addins/WindowsPlatform/WindowsPlatform/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/WindowsPlatform/WindowsPlatform/Makefile" ;;
"src/addins/MonoDevelop.AssemblyBrowser/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.AssemblyBrowser/Makefile" ;;
"src/addins/MonoDevelop.SourceEditor2/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.SourceEditor2/Makefile" ;;
"src/addins/MonoDevelop.XmlEditor/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.XmlEditor/Makefile" ;;
"src/addins/Xml/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/Xml/Makefile" ;;
"src/addins/MonoDevelop.Refactoring/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.Refactoring/Makefile" ;;
"src/addins/MonoDevelop.Debugger/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.Debugger/Makefile" ;;
"src/addins/MonoDevelop.Debugger.Gdb/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.Debugger.Gdb/Makefile" ;;
"src/addins/MonoDevelop.Debugger.Soft/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.Debugger.Soft/Makefile" ;;
"src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/Makefile" ;;
"src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/Makefile" ;;
"src/addins/MonoDevelop.HexEditor/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.HexEditor/Makefile" ;;
"src/addins/MonoDevelop.DocFood/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.DocFood/Makefile" ;;
"src/addins/MonoDevelop.PackageManagement/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.PackageManagement/Makefile" ;;
"src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/Makefile" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"tests/UnitTests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/UnitTests/Makefile" ;;
"tests/UserInterfaceTests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/UserInterfaceTests/Makefile" ;;
"tests/TestRunner/Makefile") CONFIG_FILES="$CONFIG_FILES tests/TestRunner/Makefile" ;;
"tests/Ide.Tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Ide.Tests/Makefile" ;;
"tests/MacPlatform.Tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/MacPlatform.Tests/Makefile" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"monodevelop") CONFIG_FILES="$CONFIG_FILES monodevelop" ;;
@ -5424,6 +5557,9 @@ echo ""
echo "Configuration summary"
echo ""
echo " * Installation prefix = $prefix"
echo " * Version = $VERSION"
echo " * Version Label = $PACKAGE_VERSION_LABEL"
echo " * Compat Version = $COMPAT_ADDIN_VERSION"
echo " * C# compiler = $CSC"
echo " * Mono class library development extensions: $enable_monoextensions"
echo " * Version control providers:"

Просмотреть файл

@ -1,4 +1,4 @@
AC_INIT([monodevelop], 4.0.12, [monodevelop-list@lists.ximian.com])
AC_INIT([monodevelop], m4_esyscmd_s([grep ^Version ../version.config|cut -d '=' -f 2|tr -d '\n']), [monodevelop-list@lists.ximian.com])
AC_PREREQ(2.53)
AM_INIT_AUTOMAKE([1.10 tar-ustar])
AM_MAINTAINER_MODE
@ -6,13 +6,15 @@ AM_MAINTAINER_MODE
#capture aclocal flags for autoreconf
AC_SUBST(ACLOCAL_FLAGS)
ASSEMBLY_VERSION=4.0.12.0
ASSEMBLY_VERSION=4.0.0.0
# This is parsed in BuildVariables.cs. Keep the format consistent to avoid breaking
# the C# side of things. It should be one of the following two formats:
# 1) "VERSION_NUMBER" "2.0"
# 2) "VERSION_NUMBER BUILD_TYPE BUILD_NUMBER" "2.0 Alpha 1"
PACKAGE_VERSION_LABEL="4.0.12"
PACKAGE_VERSION_LABEL="m4_esyscmd_s([grep ^Label ../version.config|cut -d "=" -f 2|tr -d '\n'])"
COMPAT_ADDIN_VERSION=m4_esyscmd_s([grep ^CompatVersion ../version.config|cut -d "=" -f 2|tr -d '\n'])
AC_PATH_PROG(MONO, mono)
AC_PATH_PROG(MCS, gmcs)
@ -27,15 +29,7 @@ fi
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
# On OSX use Mono's private copy of pkg-config if it exists
OSX_PKG_CONFIG=/Library/Frameworks/Mono.framework/Versions/Current/bin/pkg-config
if test -e $OSX_PKG_CONFIG; then
PKG_CONFIG=$OSX_PKG_CONFIG
elif test "x$PKG_CONFIG" = "xno"; then
AC_MSG_ERROR([You need to install pkg-config])
fi
MONO_REQUIRED_VERSION=2.10.9
MONO_REQUIRED_VERSION=3.0.4
if ! $PKG_CONFIG --atleast-version=$MONO_REQUIRED_VERSION mono; then
AC_MSG_ERROR([You need mono $MONO_REQUIRED_VERSION or newer])
@ -103,7 +97,6 @@ if test "x$MSGMERGE" = "xno"; then
AC_MSG_ERROR([You need to install msgmerge from intltool])
fi
MONO_REQUIRED_VERSION=2.8
PKG_CHECK_MODULES(UNMANAGED_DEPENDENCIES_MONO,mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)
if test "x$has_mono" = "xfalse"; then
@ -222,7 +215,7 @@ fi
AM_CONDITIONAL(ENABLE_MACPLATFORM, [test x$enable_macplatform = xyes])
# Mac bundle
# Mac bundle
AC_ARG_ENABLE(macbundle,
AC_HELP_STRING([--enable-macbundle],
[enable Mac bundle packaging [default=no]]),
@ -242,7 +235,7 @@ fi
AM_CONDITIONAL(ENABLE_WINDOWSPLATFORM, [test x$enable_windowsplatform = xyes])
dnl Intl
ALL_LINGUAS="cs da de es fr ja pt_BR tr pl it zh_TW zh_CN ru sl ca gl pt sv nl id hu nb"
ALL_LINGUAS="cs da de es fr ja pt_BR tr pl it zh_TW zh_CN ru sl ca gl pt sv nl id hu nb ko"
AC_SUBST(ALL_LINGUAS)
GETTEXT_PACKAGE=monodevelop
AC_SUBST(GETTEXT_PACKAGE)
@ -254,6 +247,7 @@ AC_SUBST(LIB_SUFFIX)
AC_SUBST(LIB_PREFIX)
AC_SUBST(ASSEMBLY_VERSION)
AC_SUBST(PACKAGE_VERSION_LABEL)
AC_SUBST(COMPAT_ADDIN_VERSION)
AC_SUBST(SQLITE_XML)
AC_SUBST(CSC_FLAGS)
@ -284,8 +278,8 @@ src/core/Mono.Texteditor/Makefile
src/core/MonoDevelop.Core/Makefile
src/core/MonoDevelop.Projects.Formats.MSBuild/Makefile
src/core/MonoDevelop.Ide/Makefile
src/core/MonoDevelop.Ide/BuildVariables.cs
src/core/MonoDevelop.Startup/Makefile
src/core/MonoDevelop.TextEditor.Tests/Makefile
src/tools/Makefile
src/tools/mdhost/Makefile
src/tools/mdtool/Makefile
@ -308,7 +302,6 @@ src/addins/CSharpBinding/Autotools/Makefile
src/addins/CSharpBinding/AspNet/Makefile
src/addins/ILAsmBinding/Makefile
src/addins/VBNetBinding/Makefile
src/addins/prj2make-sharp-lib/Makefile
src/addins/ChangeLogAddIn/Makefile
src/addins/MonoDevelop.GtkCore/Makefile
src/addins/MonoDevelop.GtkCore/libstetic/Makefile
@ -319,8 +312,6 @@ src/addins/TextTemplating/TextTransform/Makefile
src/addins/TextTemplating/MonoDevelop.TextTemplating/Makefile
src/addins/TextTemplating/Mono.TextTemplating.Tests/Makefile
src/addins/AspNet/Makefile
src/addins/AspNet/MonoDevelop.AspNet/Makefile
src/addins/AspNet/MonoDevelop.AspNet.Mvc/Makefile
src/addins/MonoDevelop.Autotools/Makefile
src/addins/MonoDevelop.DesignerSupport/Makefile
src/addins/MonoDevelop.WebReferences/Makefile
@ -333,19 +324,28 @@ src/addins/CBinding/Makefile
src/addins/GnomePlatform/Makefile
src/addins/MacPlatform/Makefile
src/addins/WindowsPlatform/Makefile
src/addins/WindowsPlatform/WindowsAPICodePack/Makefile
src/addins/WindowsPlatform/WindowsAPICodePack/Core/Makefile
src/addins/WindowsPlatform/WindowsAPICodePack/Shell/Makefile
src/addins/WindowsPlatform/WindowsPlatform/Makefile
src/addins/MonoDevelop.AssemblyBrowser/Makefile
src/addins/MonoDevelop.SourceEditor2/Makefile
src/addins/MonoDevelop.XmlEditor/Makefile
src/addins/Xml/Makefile
src/addins/MonoDevelop.Refactoring/Makefile
src/addins/MonoDevelop.Debugger/Makefile
src/addins/MonoDevelop.Debugger.Gdb/Makefile
src/addins/MonoDevelop.Debugger.Soft/Makefile
src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/Makefile
src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/Makefile
src/addins/MonoDevelop.HexEditor/Makefile
src/addins/MonoDevelop.DocFood/Makefile
src/addins/MonoDevelop.PackageManagement/Makefile
src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/Makefile
tests/Makefile
tests/UnitTests/Makefile
tests/UserInterfaceTests/Makefile
tests/TestRunner/Makefile
tests/Ide.Tests/Makefile
tests/MacPlatform.Tests/Makefile
Makefile
monodevelop
@ -363,6 +363,9 @@ echo ""
echo "Configuration summary"
echo ""
echo " * Installation prefix = $prefix"
echo " * Version = $VERSION"
echo " * Version Label = $PACKAGE_VERSION_LABEL"
echo " * Compat Version = $COMPAT_ADDIN_VERSION"
echo " * C# compiler = $CSC"
echo " * Mono class library development extensions: $enable_monoextensions"
echo " * Version control providers:"

Просмотреть файл

@ -52,7 +52,7 @@ namespace ICSharpCode.Decompiler.Ast
public class AstBuilder
{
DecompilerContext context;
SyntaxTree astCompileUnit = new SyntaxTree();
SyntaxTree syntaxTree = new SyntaxTree();
Dictionary<string, NamespaceDeclaration> astNamespaces = new Dictionary<string, NamespaceDeclaration>();
bool transformationsHaveRun;
@ -70,7 +70,7 @@ namespace ICSharpCode.Decompiler.Ast
if (method != null) {
if (method.IsGetter || method.IsSetter || method.IsAddOn || method.IsRemoveOn)
return true;
if (settings.HideNonPublicMembers && !(method.IsPublic || method.IsFamily))
if (settings.AnonymousMethods && method.HasGeneratedName() && method.IsCompilerGenerated())
return true;
}
@ -155,15 +155,15 @@ namespace ICSharpCode.Decompiler.Ast
public void RunTransformations(Predicate<IAstTransform> transformAbortCondition)
{
TransformationPipeline.RunTransformationsUntil(astCompileUnit, transformAbortCondition, context);
TransformationPipeline.RunTransformationsUntil(syntaxTree, transformAbortCondition, context);
transformationsHaveRun = true;
}
/// <summary>
/// Gets the abstract source tree.
/// </summary>
public SyntaxTree CompilationUnit {
get { return astCompileUnit; }
public SyntaxTree SyntaxTree {
get { return syntaxTree; }
}
/// <summary>
@ -175,16 +175,16 @@ namespace ICSharpCode.Decompiler.Ast
if (!transformationsHaveRun)
RunTransformations();
astCompileUnit.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = true });
var outputFormatter = new TextOutputFormatter(output) { FoldBraces = context.Settings.FoldBraces };
syntaxTree.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = true });
var outputFormatter = new TextTokenWriter(output) { FoldBraces = context.Settings.FoldBraces };
var formattingPolicy = context.Settings.CSharpFormattingOptions;
astCompileUnit.AcceptVisitor(new CSharpOutputVisitor(outputFormatter, formattingPolicy));
syntaxTree.AcceptVisitor(new CSharpOutputVisitor(outputFormatter, formattingPolicy));
}
public void AddAssembly(AssemblyDefinition assemblyDefinition, bool onlyAssemblyLevel = false)
{
if (assemblyDefinition.Name.Version != null) {
astCompileUnit.AddChild(
syntaxTree.AddChild(
new AttributeSection {
AttributeTarget = "assembly",
Attributes = {
@ -201,10 +201,10 @@ namespace ICSharpCode.Decompiler.Ast
}, EntityDeclaration.AttributeRole);
}
ConvertCustomAttributes(astCompileUnit, assemblyDefinition, "assembly");
ConvertSecurityAttributes(astCompileUnit, assemblyDefinition, "assembly");
ConvertCustomAttributes(astCompileUnit, assemblyDefinition.MainModule, "module");
AddTypeForwarderAttributes(astCompileUnit, assemblyDefinition.MainModule, "assembly");
ConvertCustomAttributes(syntaxTree, assemblyDefinition, "assembly");
ConvertSecurityAttributes(syntaxTree, assemblyDefinition, "assembly");
ConvertCustomAttributes(syntaxTree, assemblyDefinition.MainModule, "module");
AddTypeForwarderAttributes(syntaxTree, assemblyDefinition.MainModule, "assembly");
if (!onlyAssemblyLevel) {
foreach (TypeDefinition typeDef in assemblyDefinition.MainModule.Types) {
@ -253,7 +253,7 @@ namespace ICSharpCode.Decompiler.Ast
} else {
// Create the namespace
NamespaceDeclaration astNamespace = new NamespaceDeclaration { Name = name };
astCompileUnit.AddChild(astNamespace, SyntaxTree.MemberRole);
syntaxTree.Members.Add(astNamespace);
astNamespaces[name] = astNamespace;
return astNamespace;
}
@ -264,31 +264,31 @@ namespace ICSharpCode.Decompiler.Ast
var astType = CreateType(typeDef);
NamespaceDeclaration astNS = GetCodeNamespace(typeDef.Namespace);
if (astNS != null) {
astNS.AddChild(astType, NamespaceDeclaration.MemberRole);
astNS.Members.Add(astType);
} else {
astCompileUnit.AddChild(astType, SyntaxTree.MemberRole);
syntaxTree.Members.Add(astType);
}
}
public void AddMethod(MethodDefinition method)
{
AstNode node = method.IsConstructor ? (AstNode)CreateConstructor(method) : CreateMethod(method);
astCompileUnit.AddChild(node, SyntaxTree.MemberRole);
syntaxTree.Members.Add(node);
}
public void AddProperty(PropertyDefinition property)
{
astCompileUnit.AddChild(CreateProperty(property), SyntaxTree.MemberRole);
syntaxTree.Members.Add(CreateProperty(property));
}
public void AddField(FieldDefinition field)
{
astCompileUnit.AddChild(CreateField(field), SyntaxTree.MemberRole);
syntaxTree.Members.Add(CreateField(field));
}
public void AddEvent(EventDefinition ev)
{
astCompileUnit.AddChild(CreateEvent(ev), SyntaxTree.MemberRole);
syntaxTree.Members.Add(CreateEvent(ev));
}
/// <summary>

Просмотреть файл

@ -126,7 +126,7 @@ namespace ICSharpCode.Decompiler.Ast
astBlock.Statements.InsertBefore(insertionPoint, newVarDecl);
}
astBlock.AddAnnotation(new MemberMapping(methodDef) { LocalVariables = localVariables });
astBlock.AddAnnotation(new MethodDebugSymbols(methodDef) { LocalVariables = localVariables.ToList() });
return astBlock;
}
@ -147,7 +147,7 @@ namespace ICSharpCode.Decompiler.Ast
if (node is ILLabel) {
yield return new Ast.LabelStatement { Label = ((ILLabel)node).Name };
} else if (node is ILExpression) {
List<ILRange> ilRanges = ILRange.OrderAndJoint(node.GetSelfAndChildrenRecursive<ILExpression>().SelectMany(e => e.ILRanges));
List<ILRange> ilRanges = ILRange.OrderAndJoin(node.GetSelfAndChildrenRecursive<ILExpression>().SelectMany(e => e.ILRanges));
AstNode codeExpr = TransformExpression((ILExpression)node);
if (codeExpr != null) {
codeExpr = codeExpr.WithAnnotation(ilRanges);
@ -253,7 +253,7 @@ namespace ICSharpCode.Decompiler.Ast
Expression astExpr = node as Expression;
// get IL ranges - used in debugger
List<ILRange> ilRanges = ILRange.OrderAndJoint(expr.GetSelfAndChildrenRecursive<ILExpression>().SelectMany(e => e.ILRanges));
List<ILRange> ilRanges = ILRange.OrderAndJoin(expr.GetSelfAndChildrenRecursive<ILExpression>().SelectMany(e => e.ILRanges));
AstNode result;
if (astExpr != null)

Просмотреть файл

@ -1,338 +0,0 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.ILAst;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.CSharp;
using Mono.Cecil;
namespace ICSharpCode.Decompiler.Ast
{
public class TextOutputFormatter : IOutputFormatter
{
readonly ITextOutput output;
readonly Stack<AstNode> nodeStack = new Stack<AstNode>();
int braceLevelWithinType = -1;
bool inDocumentationComment = false;
bool firstUsingDeclaration;
bool lastUsingDeclaration;
public bool FoldBraces = false;
public TextOutputFormatter(ITextOutput output)
{
if (output == null)
throw new ArgumentNullException("output");
this.output = output;
}
public void WriteIdentifier(string identifier)
{
var definition = GetCurrentDefinition();
if (definition != null) {
output.WriteDefinition(identifier, definition, false);
return;
}
object memberRef = GetCurrentMemberReference();
if (memberRef != null) {
output.WriteReference(identifier, memberRef);
return;
}
definition = GetCurrentLocalDefinition();
if (definition != null) {
output.WriteDefinition(identifier, definition);
return;
}
memberRef = GetCurrentLocalReference();
if (memberRef != null) {
output.WriteReference(identifier, memberRef, true);
return;
}
if (firstUsingDeclaration) {
output.MarkFoldStart(defaultCollapsed: true);
firstUsingDeclaration = false;
}
output.Write(identifier);
}
MemberReference GetCurrentMemberReference()
{
AstNode node = nodeStack.Peek();
MemberReference memberRef = node.Annotation<MemberReference>();
if (memberRef == null && node.Role == Roles.TargetExpression && (node.Parent is InvocationExpression || node.Parent is ObjectCreateExpression)) {
memberRef = node.Parent.Annotation<MemberReference>();
}
return memberRef;
}
object GetCurrentLocalReference()
{
AstNode node = nodeStack.Peek();
ILVariable variable = node.Annotation<ILVariable>();
if (variable != null) {
if (variable.OriginalParameter != null)
return variable.OriginalParameter;
//if (variable.OriginalVariable != null)
// return variable.OriginalVariable;
return variable;
}
var gotoStatement = node as GotoStatement;
if (gotoStatement != null)
{
var method = nodeStack.Select(nd => nd.Annotation<MethodReference>()).FirstOrDefault(mr => mr != null);
if (method != null)
return method.ToString() + gotoStatement.Label;
}
return null;
}
object GetCurrentLocalDefinition()
{
AstNode node = nodeStack.Peek();
if (node is Identifier && node.Parent != null)
node = node.Parent;
var parameterDef = node.Annotation<ParameterDefinition>();
if (parameterDef != null)
return parameterDef;
if (node is VariableInitializer || node is CatchClause || node is ForeachStatement) {
var variable = node.Annotation<ILVariable>();
if (variable != null) {
if (variable.OriginalParameter != null)
return variable.OriginalParameter;
//if (variable.OriginalVariable != null)
// return variable.OriginalVariable;
return variable;
}
}
var label = node as LabelStatement;
if (label != null) {
var method = nodeStack.Select(nd => nd.Annotation<MethodReference>()).FirstOrDefault(mr => mr != null);
if (method != null)
return method.ToString() + label.Label;
}
return null;
}
object GetCurrentDefinition()
{
if (nodeStack == null || nodeStack.Count == 0)
return null;
var node = nodeStack.Peek();
if (IsDefinition(node))
return node.Annotation<MemberReference>();
var fieldDef = node.Parent.Annotation<FieldDefinition>();
if (fieldDef != null)
return node.Parent.Annotation<MemberReference>();
return null;
}
public void WriteKeyword(string keyword)
{
output.Write(keyword);
}
public void WriteToken(string token)
{
// Attach member reference to token only if there's no identifier in the current node.
MemberReference memberRef = GetCurrentMemberReference();
var node = nodeStack.Peek();
if (memberRef != null && node.GetChildByRole(Roles.Identifier).IsNull)
output.WriteReference(token, memberRef);
else
output.Write(token);
}
public void Space()
{
output.Write(' ');
}
public void OpenBrace(BraceStyle style)
{
if (braceLevelWithinType >= 0 || nodeStack.Peek() is TypeDeclaration)
braceLevelWithinType++;
if (nodeStack.OfType<BlockStatement>().Count() <= 1 || FoldBraces) {
output.MarkFoldStart(defaultCollapsed: braceLevelWithinType == 1);
}
output.WriteLine();
output.WriteLine("{");
output.Indent();
}
public void CloseBrace(BraceStyle style)
{
output.Unindent();
output.Write('}');
if (nodeStack.OfType<BlockStatement>().Count() <= 1 || FoldBraces)
output.MarkFoldEnd();
if (braceLevelWithinType >= 0)
braceLevelWithinType--;
}
public void Indent()
{
output.Indent();
}
public void Unindent()
{
output.Unindent();
}
public void NewLine()
{
if (lastUsingDeclaration) {
output.MarkFoldEnd();
lastUsingDeclaration = false;
}
output.WriteLine();
}
public void WriteComment(CommentType commentType, string content)
{
switch (commentType) {
case CommentType.SingleLine:
output.Write("//");
output.WriteLine(content);
break;
case CommentType.MultiLine:
output.Write("/*");
output.Write(content);
output.Write("*/");
break;
case CommentType.Documentation:
bool isLastLine = !(nodeStack.Peek().NextSibling is Comment);
if (!inDocumentationComment && !isLastLine) {
inDocumentationComment = true;
output.MarkFoldStart("///" + content, true);
}
output.Write("///");
output.Write(content);
if (inDocumentationComment && isLastLine) {
inDocumentationComment = false;
output.MarkFoldEnd();
}
output.WriteLine();
break;
default:
output.Write(content);
break;
}
}
public void WritePreProcessorDirective(PreProcessorDirectiveType type, string argument)
{
// pre-processor directive must start on its own line
output.Write('#');
output.Write(type.ToString().ToLowerInvariant());
if (!string.IsNullOrEmpty(argument)) {
output.Write(' ');
output.Write(argument);
}
output.WriteLine();
}
Stack<TextLocation> startLocations = new Stack<TextLocation>();
MemberMapping currentMemberMapping;
Stack<MemberMapping> parentMemberMappings = new Stack<MemberMapping>();
public void StartNode(AstNode node)
{
if (nodeStack.Count == 0) {
if (IsUsingDeclaration(node)) {
firstUsingDeclaration = !IsUsingDeclaration(node.PrevSibling);
lastUsingDeclaration = !IsUsingDeclaration(node.NextSibling);
} else {
firstUsingDeclaration = false;
lastUsingDeclaration = false;
}
}
nodeStack.Push(node);
startLocations.Push(output.Location);
if (node is EntityDeclaration && node.Annotation<MemberReference>() != null && node.GetChildByRole(Roles.Identifier).IsNull)
output.WriteDefinition("", node.Annotation<MemberReference>(), false);
MemberMapping mapping = node.Annotation<MemberMapping>();
if (mapping != null) {
parentMemberMappings.Push(currentMemberMapping);
currentMemberMapping = mapping;
}
}
private bool IsUsingDeclaration(AstNode node)
{
return node is UsingDeclaration || node is UsingAliasDeclaration;
}
public void EndNode(AstNode node)
{
if (nodeStack.Pop() != node)
throw new InvalidOperationException();
var startLocation = startLocations.Pop();
// code mappings
if (currentMemberMapping != null) {
var ranges = node.Annotation<List<ILRange>>();
if (ranges != null && ranges.Count > 0) {
// add all ranges
foreach (var range in ranges) {
currentMemberMapping.MemberCodeMappings.Add(
new SourceCodeMapping {
ILInstructionOffset = range,
StartLocation = startLocation,
EndLocation = output.Location,
MemberMapping = currentMemberMapping
});
}
}
}
if (node.Annotation<MemberMapping>() != null) {
output.AddDebuggerMemberMapping(currentMemberMapping);
currentMemberMapping = parentMemberMappings.Pop();
}
}
private static bool IsDefinition(AstNode node)
{
return node is EntityDeclaration;
}
}
}

Просмотреть файл

@ -0,0 +1,347 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.ILAst;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.CSharp;
using Mono.Cecil;
namespace ICSharpCode.Decompiler.Ast
{
public class TextTokenWriter : TokenWriter
{
readonly ITextOutput output;
readonly Stack<AstNode> nodeStack = new Stack<AstNode>();
int braceLevelWithinType = -1;
bool inDocumentationComment = false;
bool firstUsingDeclaration;
bool lastUsingDeclaration;
TextLocation? lastEndOfLine;
public bool FoldBraces = false;
public TextTokenWriter(ITextOutput output)
{
if (output == null)
throw new ArgumentNullException("output");
this.output = output;
}
public override void WriteIdentifier(Identifier identifier)
{
var definition = GetCurrentDefinition();
if (definition != null) {
output.WriteDefinition(identifier.Name, definition, false);
return;
}
object memberRef = GetCurrentMemberReference();
if (memberRef != null) {
output.WriteReference(identifier.Name, memberRef);
return;
}
definition = GetCurrentLocalDefinition();
if (definition != null) {
output.WriteDefinition(identifier.Name, definition);
return;
}
memberRef = GetCurrentLocalReference();
if (memberRef != null) {
output.WriteReference(identifier.Name, memberRef, true);
return;
}
if (firstUsingDeclaration) {
output.MarkFoldStart(defaultCollapsed: true);
firstUsingDeclaration = false;
}
output.Write(identifier.Name);
}
MemberReference GetCurrentMemberReference()
{
AstNode node = nodeStack.Peek();
MemberReference memberRef = node.Annotation<MemberReference>();
if (memberRef == null && node.Role == Roles.TargetExpression && (node.Parent is InvocationExpression || node.Parent is ObjectCreateExpression)) {
memberRef = node.Parent.Annotation<MemberReference>();
}
return memberRef;
}
object GetCurrentLocalReference()
{
AstNode node = nodeStack.Peek();
ILVariable variable = node.Annotation<ILVariable>();
if (variable != null) {
if (variable.OriginalParameter != null)
return variable.OriginalParameter;
//if (variable.OriginalVariable != null)
// return variable.OriginalVariable;
return variable;
}
var gotoStatement = node as GotoStatement;
if (gotoStatement != null)
{
var method = nodeStack.Select(nd => nd.Annotation<MethodReference>()).FirstOrDefault(mr => mr != null);
if (method != null)
return method.ToString() + gotoStatement.Label;
}
return null;
}
object GetCurrentLocalDefinition()
{
AstNode node = nodeStack.Peek();
if (node is Identifier && node.Parent != null)
node = node.Parent;
var parameterDef = node.Annotation<ParameterDefinition>();
if (parameterDef != null)
return parameterDef;
if (node is VariableInitializer || node is CatchClause || node is ForeachStatement) {
var variable = node.Annotation<ILVariable>();
if (variable != null) {
if (variable.OriginalParameter != null)
return variable.OriginalParameter;
//if (variable.OriginalVariable != null)
// return variable.OriginalVariable;
return variable;
}
}
var label = node as LabelStatement;
if (label != null) {
var method = nodeStack.Select(nd => nd.Annotation<MethodReference>()).FirstOrDefault(mr => mr != null);
if (method != null)
return method.ToString() + label.Label;
}
return null;
}
object GetCurrentDefinition()
{
if (nodeStack == null || nodeStack.Count == 0)
return null;
var node = nodeStack.Peek();
if (node is Identifier)
node = node.Parent;
if (IsDefinition(node))
return node.Annotation<MemberReference>();
return null;
}
public override void WriteKeyword(Role role, string keyword)
{
output.Write(keyword);
}
public override void WriteToken(Role role, string token)
{
// Attach member reference to token only if there's no identifier in the current node.
MemberReference memberRef = GetCurrentMemberReference();
var node = nodeStack.Peek();
if (memberRef != null && node.GetChildByRole(Roles.Identifier).IsNull)
output.WriteReference(token, memberRef);
else
output.Write(token);
}
public override void Space()
{
output.Write(' ');
}
public void OpenBrace(BraceStyle style)
{
if (braceLevelWithinType >= 0 || nodeStack.Peek() is TypeDeclaration)
braceLevelWithinType++;
if (nodeStack.OfType<BlockStatement>().Count() <= 1 || FoldBraces) {
output.MarkFoldStart(defaultCollapsed: braceLevelWithinType == 1);
}
output.WriteLine();
output.WriteLine("{");
output.Indent();
}
public void CloseBrace(BraceStyle style)
{
output.Unindent();
output.Write('}');
if (nodeStack.OfType<BlockStatement>().Count() <= 1 || FoldBraces)
output.MarkFoldEnd();
if (braceLevelWithinType >= 0)
braceLevelWithinType--;
}
public override void Indent()
{
output.Indent();
}
public override void Unindent()
{
output.Unindent();
}
public override void NewLine()
{
if (lastUsingDeclaration) {
output.MarkFoldEnd();
lastUsingDeclaration = false;
}
lastEndOfLine = output.Location;
output.WriteLine();
}
public override void WriteComment(CommentType commentType, string content)
{
switch (commentType) {
case CommentType.SingleLine:
output.Write("//");
output.WriteLine(content);
break;
case CommentType.MultiLine:
output.Write("/*");
output.Write(content);
output.Write("*/");
break;
case CommentType.Documentation:
bool isLastLine = !(nodeStack.Peek().NextSibling is Comment);
if (!inDocumentationComment && !isLastLine) {
inDocumentationComment = true;
output.MarkFoldStart("///" + content, true);
}
output.Write("///");
output.Write(content);
if (inDocumentationComment && isLastLine) {
inDocumentationComment = false;
output.MarkFoldEnd();
}
output.WriteLine();
break;
default:
output.Write(content);
break;
}
}
public override void WritePreProcessorDirective(PreProcessorDirectiveType type, string argument)
{
// pre-processor directive must start on its own line
output.Write('#');
output.Write(type.ToString().ToLowerInvariant());
if (!string.IsNullOrEmpty(argument)) {
output.Write(' ');
output.Write(argument);
}
output.WriteLine();
}
public override void WritePrimitiveValue(object value, string literalValue = null)
{
output.WritePrimitiveValue(value, literalValue);
}
public override void WritePrimitiveType(string type)
{
output.Write(type);
if (type == "new") {
output.Write("()");
}
}
Stack<TextLocation> startLocations = new Stack<TextLocation>();
Stack<MethodDebugSymbols> symbolsStack = new Stack<MethodDebugSymbols>();
public override void StartNode(AstNode node)
{
if (nodeStack.Count == 0) {
if (IsUsingDeclaration(node)) {
firstUsingDeclaration = !IsUsingDeclaration(node.PrevSibling);
lastUsingDeclaration = !IsUsingDeclaration(node.NextSibling);
} else {
firstUsingDeclaration = false;
lastUsingDeclaration = false;
}
}
nodeStack.Push(node);
startLocations.Push(output.Location);
if (node is EntityDeclaration && node.Annotation<MemberReference>() != null && node.GetChildByRole(Roles.Identifier).IsNull)
output.WriteDefinition("", node.Annotation<MemberReference>(), false);
if (node.Annotation<MethodDebugSymbols>() != null) {
symbolsStack.Push(node.Annotation<MethodDebugSymbols>());
symbolsStack.Peek().StartLocation = startLocations.Peek();
}
}
private bool IsUsingDeclaration(AstNode node)
{
return node is UsingDeclaration || node is UsingAliasDeclaration;
}
public override void EndNode(AstNode node)
{
if (nodeStack.Pop() != node)
throw new InvalidOperationException();
var startLocation = startLocations.Pop();
// code mappings
var ranges = node.Annotation<List<ILRange>>();
if (symbolsStack.Count > 0 && ranges != null && ranges.Count > 0) {
// Ignore the newline which was printed at the end of the statement
TextLocation endLocation = (node is Statement) ? (lastEndOfLine ?? output.Location) : output.Location;
symbolsStack.Peek().SequencePoints.Add(
new SequencePoint() {
ILRanges = ILRange.OrderAndJoin(ranges).ToArray(),
StartLocation = startLocation,
EndLocation = endLocation
});
}
if (node.Annotation<MethodDebugSymbols>() != null) {
symbolsStack.Peek().EndLocation = output.Location;
output.AddDebugSymbols(symbolsStack.Pop());
}
}
private static bool IsDefinition(AstNode node)
{
return node is EntityDeclaration
|| (node is VariableInitializer && node.Parent is FieldDeclaration)
|| node is FixedVariableInitializer;
}
}
}

Просмотреть файл

@ -115,7 +115,7 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
public override object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data)
{
string oldNamespace = currentNamespace;
foreach (var ident in namespaceDeclaration.Identifiers) {
foreach (string ident in namespaceDeclaration.Identifiers) {
currentNamespace = NamespaceDeclaration.BuildQualifiedName(currentNamespace, ident);
transform.declaredNamespaces.Add(currentNamespace);
}
@ -154,7 +154,7 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
public override object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data)
{
string oldNamespace = currentNamespace;
foreach (var ident in namespaceDeclaration.Identifiers) {
foreach (string ident in namespaceDeclaration.Identifiers) {
currentNamespace = NamespaceDeclaration.BuildQualifiedName(currentNamespace, ident);
}
base.VisitNamespaceDeclaration(namespaceDeclaration, data);

Просмотреть файл

@ -897,6 +897,7 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
#region Automatic Events
static readonly Accessor automaticEventPatternV4 = new Accessor {
Attributes = { new Repeat(new AnyNode()) },
Body = new BlockStatement {
new VariableDeclarationStatement { Type = new AnyNode("type"), Variables = { new AnyNode() } },
new VariableDeclarationStatement { Type = new Backreference("type"), Variables = { new AnyNode() } },
@ -965,6 +966,10 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
return null;
EventDeclaration ed = new EventDeclaration();
ev.Attributes.MoveTo(ed.Attributes);
foreach (var attr in ev.AddAccessor.Attributes) {
attr.AttributeTarget = "method";
ed.Attributes.Add(attr.Detach());
}
ed.ReturnType = ev.ReturnType.Detach();
ed.Modifiers = ev.Modifiers;
ed.Variables.Add(new VariableInitializer(ev.Name));

Просмотреть файл

@ -17,240 +17,41 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using ICSharpCode.Decompiler.Ast;
using ICSharpCode.Decompiler.Disassembler;
using ICSharpCode.Decompiler.ILAst;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.CSharp;
using Mono.Cecil;
namespace ICSharpCode.Decompiler
{
/// <summary>
/// Maps the source code to IL.
/// </summary>
public sealed class SourceCodeMapping
/// <summary> Maps method's source code to IL </summary>
public class MethodDebugSymbols
{
/// <summary>
/// Gets or sets the start location of the instruction.
/// </summary>
public MethodDefinition CecilMethod { get; set; }
public List<ILVariable> LocalVariables { get; set; }
public List<SequencePoint> SequencePoints { get; set; }
public TextLocation StartLocation { get; set; }
/// <summary>
/// Gets or sets the end location of the instruction.
/// </summary>
public TextLocation EndLocation { get; set; }
/// <summary>
/// Gets or sets IL Range offset for the source code line. E.g.: 13-19 &lt;-&gt; 135.
/// </summary>
public ILRange ILInstructionOffset { get; set; }
/// <summary>
/// Gets or sets the member mapping this source code mapping belongs to.
/// </summary>
public MemberMapping MemberMapping { get; set; }
/// <summary>
/// Retrieves the array that contains the IL range and the missing gaps between ranges.
/// </summary>
/// <returns>The array representation of the step aranges.</returns>
public int[] ToArray(bool isMatch)
public MethodDebugSymbols(MethodDefinition methodDef)
{
var currentList = new List<ILRange>();
// add list for the current source code line
currentList.AddRange(ILRange.OrderAndJoint(MemberMapping.MemberCodeMappings
.FindAll(m => m.StartLocation.Line == this.StartLocation.Line)
.ConvertAll<ILRange>(m => m.ILInstructionOffset)));
if (!isMatch) {
// add inverted
currentList.AddRange(MemberMapping.InvertedList);
} else {
// if the current list contains the last mapping, add also the last gap
var lastInverted = MemberMapping.InvertedList.LastOrDefault();
if (lastInverted != null && lastInverted.From == currentList[currentList.Count - 1].To)
currentList.Add(lastInverted);
}
// set the output
var resultList = new List<int>();
foreach (var element in ILRange.OrderAndJoint(currentList)) {
resultList.Add(element.From);
resultList.Add(element.To);
}
return resultList.ToArray();
this.CecilMethod = methodDef;
this.LocalVariables = new List<ILVariable>();
this.SequencePoints = new List<SequencePoint>();
}
}
/// <summary>
/// Stores the member information and its source code mappings.
/// </summary>
public sealed class MemberMapping
public class SequencePoint
{
IEnumerable<ILRange> invertedList;
public ILRange[] ILRanges { get; set; }
public TextLocation StartLocation { get; set; }
public TextLocation EndLocation { get; set; }
public int ILOffset { get { return this.ILRanges[0].From; } }
internal MemberMapping()
public override string ToString()
{
}
public MemberMapping(MethodDefinition method)
{
this.MetadataToken = method.MetadataToken.ToInt32();
this.MemberCodeMappings = new List<SourceCodeMapping>();
this.MemberReference = method;
this.CodeSize = method.Body.CodeSize;
}
/// <summary>
/// Gets or sets the type of the mapping.
/// </summary>
public MemberReference MemberReference { get; internal set; }
/// <summary>
/// Metadata token of the member.
/// </summary>
public int MetadataToken { get; internal set; }
/// <summary>
/// Gets or sets the code size for the member mapping.
/// </summary>
public int CodeSize { get; internal set; }
/// <summary>
/// Gets or sets the source code mappings.
/// </summary>
public List<SourceCodeMapping> MemberCodeMappings { get; internal set; }
/// <summary>
/// Gets or sets the local variables.
/// </summary>
public IEnumerable<ILVariable> LocalVariables { get; internal set; }
/// <summary>
/// Gets the inverted IL Ranges.<br/>
/// E.g.: for (0-9, 11-14, 14-18, 21-25) => (9-11,18-21).
/// </summary>
/// <returns>IL Range inverted list.</returns>
public IEnumerable<ILRange> InvertedList
{
get {
if (invertedList == null) {
var list = MemberCodeMappings.ConvertAll<ILRange>(
s => new ILRange { From = s.ILInstructionOffset.From, To = s.ILInstructionOffset.To });
invertedList = ILRange.OrderAndJoint(ILRange.Invert(list, CodeSize));
}
return invertedList;
}
}
}
/// <summary>
/// Code mappings helper class.
/// </summary>
public static class CodeMappings
{
/// <summary>
/// Gets source code mapping and metadata token based on type name and line number.
/// </summary>
/// <param name="codeMappings">Code mappings storage.</param>
/// <param name="typeName">Member reference name.</param>
/// <param name="lineNumber">Line number.</param>
/// <param name="metadataToken">Metadata token.</param>
/// <returns></returns>
public static SourceCodeMapping GetInstructionByLineNumber(
this MemberMapping codeMapping,
int lineNumber,
out int metadataToken)
{
if (codeMapping == null)
throw new ArgumentException("CodeMappings storage must be valid!");
var map = codeMapping.MemberCodeMappings.Find(m => m.StartLocation.Line == lineNumber);
if (map != null) {
metadataToken = codeMapping.MetadataToken;
return map;
}
metadataToken = 0;
return null;
}
/// <summary>
/// Gets a mapping given a type, a token and an IL offset.
/// </summary>
/// <param name="codeMappings">Code mappings storage.</param>
/// <param name="token">Token.</param>
/// <param name="ilOffset">IL offset.</param>
/// <param name="isMatch">True, if perfect match.</param>
/// <returns>A code mapping.</returns>
public static SourceCodeMapping GetInstructionByTokenAndOffset(
this MemberMapping codeMapping,
int ilOffset,
out bool isMatch)
{
isMatch = false;
if (codeMapping == null)
throw new ArgumentNullException("CodeMappings storage must be valid!");
// try find an exact match
var map = codeMapping.MemberCodeMappings.Find(m => m.ILInstructionOffset.From <= ilOffset && ilOffset < m.ILInstructionOffset.To);
if (map == null) {
// get the immediate next one
map = codeMapping.MemberCodeMappings.Find(m => m.ILInstructionOffset.From > ilOffset);
isMatch = false;
if (map == null)
map = codeMapping.MemberCodeMappings.LastOrDefault(); // get the last
return map;
}
isMatch = true;
return map;
}
/// <summary>
/// Gets the source code and type name from metadata token and offset.
/// </summary>
/// <param name="codeMappings">Code mapping storage.</param>
/// <param name="token">Metadata token.</param>
/// <param name="ilOffset">IL offset.</param>
/// <param name="typeName">Type definition.</param>
/// <param name="line">Line number.</param>
/// <remarks>It is possible to exist to different types from different assemblies with the same metadata token.</remarks>
public static bool GetInstructionByTokenAndOffset(
this MemberMapping mapping,
int ilOffset,
out MemberReference member,
out int line)
{
member = null;
line = 0;
if (mapping == null)
throw new ArgumentException("CodeMappings storage must be valid!");
var codeMapping = mapping.MemberCodeMappings.Find(
cm => cm.ILInstructionOffset.From <= ilOffset && ilOffset <= cm.ILInstructionOffset.To - 1);
if (codeMapping == null) {
codeMapping = mapping.MemberCodeMappings.Find(cm => cm.ILInstructionOffset.From > ilOffset);
if (codeMapping == null) {
codeMapping = mapping.MemberCodeMappings.LastOrDefault();
if (codeMapping == null)
return false;
}
}
member = mapping.MemberReference;
line = codeMapping.StartLocation.Line;
return true;
return string.Join(" ", this.ILRanges) + " " + this.StartLocation + "-" + this.EndLocation;
}
}
}

Просмотреть файл

@ -222,7 +222,7 @@ namespace ICSharpCode.Decompiler.Disassembler
} else {
// The ECMA specification says that ' inside SQString should be ecaped using an octal escape sequence,
// but we follow Microsoft's ILDasm and use \'.
return "'" + NRefactory.CSharp.CSharpOutputVisitor.ConvertString(identifier).Replace("'", "\\'") + "'";
return "'" + NRefactory.CSharp.TextWriterTokenWriter.ConvertString(identifier).Replace("'", "\\'") + "'";
}
}
@ -353,7 +353,7 @@ namespace ICSharpCode.Decompiler.Disassembler
string s = operand as string;
if (s != null) {
writer.Write("\"" + NRefactory.CSharp.CSharpOutputVisitor.ConvertString(s) + "\"");
writer.Write("\"" + NRefactory.CSharp.TextWriterTokenWriter.ConvertString(s) + "\"");
} else if (operand is char) {
writer.Write(((int)(char)operand).ToString());
} else if (operand is float) {

Просмотреть файл

@ -47,7 +47,7 @@ namespace ICSharpCode.Decompiler.Disassembler
this.cancellationToken = cancellationToken;
}
public void Disassemble(MethodBody body, MemberMapping methodMapping)
public void Disassemble(MethodBody body, MethodDebugSymbols debugSymbols)
{
// start writing IL code
MethodDefinition method = body.Method;
@ -82,20 +82,19 @@ namespace ICSharpCode.Decompiler.Disassembler
if (detectControlStructure && body.Instructions.Count > 0) {
Instruction inst = body.Instructions[0];
HashSet<int> branchTargets = GetBranchTargets(body.Instructions);
WriteStructureBody(new ILStructure(body), branchTargets, ref inst, methodMapping, method.Body.CodeSize);
WriteStructureBody(new ILStructure(body), branchTargets, ref inst, debugSymbols, method.Body.CodeSize);
} else {
foreach (var inst in method.Body.Instructions) {
var startLocation = output.Location;
inst.WriteTo(output);
if (methodMapping != null) {
if (debugSymbols != null) {
// add IL code mappings - used in debugger
methodMapping.MemberCodeMappings.Add(
new SourceCodeMapping() {
debugSymbols.SequencePoints.Add(
new SequencePoint() {
StartLocation = output.Location,
EndLocation = output.Location,
ILInstructionOffset = new ILRange { From = inst.Offset, To = inst.Next == null ? method.Body.CodeSize : inst.Next.Offset },
MemberMapping = methodMapping
ILRanges = new ILRange[] { new ILRange(inst.Offset, inst.Next == null ? method.Body.CodeSize : inst.Next.Offset) }
});
}
@ -174,7 +173,7 @@ namespace ICSharpCode.Decompiler.Disassembler
output.Indent();
}
void WriteStructureBody(ILStructure s, HashSet<int> branchTargets, ref Instruction inst, MemberMapping currentMethodMapping, int codeSize)
void WriteStructureBody(ILStructure s, HashSet<int> branchTargets, ref Instruction inst, MethodDebugSymbols debugSymbols, int codeSize)
{
bool isFirstInstructionInStructure = true;
bool prevInstructionWasBranch = false;
@ -184,7 +183,7 @@ namespace ICSharpCode.Decompiler.Disassembler
if (childIndex < s.Children.Count && s.Children[childIndex].StartOffset <= offset && offset < s.Children[childIndex].EndOffset) {
ILStructure child = s.Children[childIndex++];
WriteStructureHeader(child);
WriteStructureBody(child, branchTargets, ref inst, currentMethodMapping, codeSize);
WriteStructureBody(child, branchTargets, ref inst, debugSymbols, codeSize);
WriteStructureFooter(child);
} else {
if (!isFirstInstructionInStructure && (prevInstructionWasBranch || branchTargets.Contains(offset))) {
@ -194,13 +193,12 @@ namespace ICSharpCode.Decompiler.Disassembler
inst.WriteTo(output);
// add IL code mappings - used in debugger
if (currentMethodMapping != null) {
currentMethodMapping.MemberCodeMappings.Add(
new SourceCodeMapping() {
if (debugSymbols != null) {
debugSymbols.SequencePoints.Add(
new SequencePoint() {
StartLocation = startLocation,
EndLocation = output.Location,
ILInstructionOffset = new ILRange { From = inst.Offset, To = inst.Next == null ? codeSize : inst.Next.Offset },
MemberMapping = currentMethodMapping
ILRanges = new ILRange[] { new ILRange(inst.Offset, inst.Next == null ? codeSize : inst.Next.Offset) }
});
}

Просмотреть файл

@ -22,6 +22,7 @@ using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using ICSharpCode.NRefactory;
using Mono.Cecil;
using Mono.Collections.Generic;
@ -114,6 +115,8 @@ namespace ICSharpCode.Decompiler.Disassembler
// instance default class [mscorlib]System.IO.TextWriter get_BaseWriter () cil managed
//
TextLocation startLocation = output.Location;
//emit flags
WriteEnum(method.Attributes & MethodAttributes.MemberAccessMask, methodVisibility);
WriteFlags(method.Attributes & ~MethodAttributes.MemberAccessMask, methodAttributeFlags);
@ -123,10 +126,10 @@ namespace ICSharpCode.Decompiler.Disassembler
output.Write("pinvokeimpl");
if (method.HasPInvokeInfo && method.PInvokeInfo != null) {
PInvokeInfo info = method.PInvokeInfo;
output.Write("(\"" + NRefactory.CSharp.CSharpOutputVisitor.ConvertString(info.Module.Name) + "\"");
output.Write("(\"" + NRefactory.CSharp.TextWriterTokenWriter.ConvertString(info.Module.Name) + "\"");
if (!string.IsNullOrEmpty(info.EntryPoint) && info.EntryPoint != method.Name)
output.Write(" as \"" + NRefactory.CSharp.CSharpOutputVisitor.ConvertString(info.EntryPoint) + "\"");
output.Write(" as \"" + NRefactory.CSharp.TextWriterTokenWriter.ConvertString(info.EntryPoint) + "\"");
if (info.IsNoMangle)
output.Write(" nomangle");
@ -217,9 +220,11 @@ namespace ICSharpCode.Decompiler.Disassembler
if (method.HasBody) {
// create IL code mappings - used in debugger
MemberMapping methodMapping = new MemberMapping(method);
methodBodyDisassembler.Disassemble(method.Body, methodMapping);
output.AddDebuggerMemberMapping(methodMapping);
MethodDebugSymbols debugSymbols = new MethodDebugSymbols(method);
debugSymbols.StartLocation = startLocation;
methodBodyDisassembler.Disassemble(method.Body, debugSymbols);
debugSymbols.EndLocation = output.Location;
output.AddDebugSymbols(debugSymbols);
}
CloseBlock("end of method " + DisassemblerHelpers.Escape(method.DeclaringType.Name) + "::" + DisassemblerHelpers.Escape(method.Name));
@ -341,7 +346,7 @@ namespace ICSharpCode.Decompiler.Disassembler
output.Write(" = ");
if (na.Argument.Value is string) {
// secdecls use special syntax for strings
output.Write("string('{0}')", NRefactory.CSharp.CSharpOutputVisitor.ConvertString((string)na.Argument.Value).Replace("'", "\'"));
output.Write("string('{0}')", NRefactory.CSharp.TextWriterTokenWriter.ConvertString((string)na.Argument.Value).Replace("'", "\'"));
} else {
WriteConstant(na.Argument.Value);
}
@ -569,10 +574,10 @@ namespace ICSharpCode.Decompiler.Disassembler
if (cmi == null)
goto default;
output.Write("custom(\"{0}\", \"{1}\"",
NRefactory.CSharp.CSharpOutputVisitor.ConvertString(cmi.ManagedType.FullName),
NRefactory.CSharp.CSharpOutputVisitor.ConvertString(cmi.Cookie));
NRefactory.CSharp.TextWriterTokenWriter.ConvertString(cmi.ManagedType.FullName),
NRefactory.CSharp.TextWriterTokenWriter.ConvertString(cmi.Cookie));
if (cmi.Guid != Guid.Empty || !string.IsNullOrEmpty(cmi.UnmanagedType)) {
output.Write(", \"{0}\", \"{1}\"", cmi.Guid.ToString(), NRefactory.CSharp.CSharpOutputVisitor.ConvertString(cmi.UnmanagedType));
output.Write(", \"{0}\", \"{1}\"", cmi.Guid.ToString(), NRefactory.CSharp.TextWriterTokenWriter.ConvertString(cmi.UnmanagedType));
}
output.Write(')');
break;

Просмотреть файл

@ -16,7 +16,7 @@
<AssemblyOriginatorKeyFile>..\..\external\nrefactory\ICSharpCode.NRefactory.snk</AssemblyOriginatorKeyFile>
<DelaySign>False</DelaySign>
<AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
<ProductVersion>10.0.0</ProductVersion>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
@ -56,7 +56,6 @@
<Compile Include="Ast\DecompilerContext.cs" />
<Compile Include="Ast\NameVariables.cs" />
<Compile Include="Ast\NRefactoryExtensions.cs" />
<Compile Include="Ast\TextOutputFormatter.cs" />
<Compile Include="Ast\Transforms\AddCheckedBlocks.cs" />
<Compile Include="Ast\Transforms\CombineQueryExpressions.cs" />
<Compile Include="Ast\Transforms\ContextTrackingVisitor.cs" />
@ -121,6 +120,7 @@
<Compile Include="ILAst\StateRange.cs" />
<Compile Include="ILAst\SymbolicExecution.cs" />
<Compile Include="ILAst\AsyncDecompiler.cs" />
<Compile Include="Ast\TextTokenWriter.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\external\cecil\Mono.Cecil.csproj">

Просмотреть файл

@ -743,7 +743,7 @@ namespace ICSharpCode.Decompiler.ILAst
// Convert stack-based IL code to ILAst tree
foreach(ByteCode byteCode in body) {
ILRange ilRange = new ILRange() { From = byteCode.Offset, To = byteCode.EndOffset };
ILRange ilRange = new ILRange(byteCode.Offset, byteCode.EndOffset);
if (byteCode.StackBefore == null) {
// Unreachable code

Просмотреть файл

@ -221,37 +221,43 @@ namespace ICSharpCode.Decompiler.ILAst
}
}
public class ILRange
public struct ILRange
{
public int From;
public int To; // Exlusive
public readonly int From;
public readonly int To; // Exlusive
public ILRange(int @from, int to)
{
this.From = @from;
this.To = to;
}
public override string ToString()
{
return string.Format("{0}-{1}", From.ToString("X"), To.ToString("X"));
return string.Format("{0:X2}-{1:X2}", From, To);
}
public static List<ILRange> OrderAndJoint(IEnumerable<ILRange> input)
public static List<ILRange> OrderAndJoin(IEnumerable<ILRange> input)
{
if (input == null)
throw new ArgumentNullException("Input is null!");
List<ILRange> ranges = input.Where(r => r != null).OrderBy(r => r.From).ToList();
for (int i = 0; i < ranges.Count - 1;) {
ILRange curr = ranges[i];
ILRange next = ranges[i + 1];
// Merge consequtive ranges if they intersect
if (curr.From <= next.From && next.From <= curr.To) {
curr.To = Math.Max(curr.To, next.To);
ranges.RemoveAt(i + 1);
} else {
i++;
List<ILRange> result = new List<ILRange>();
foreach(ILRange curr in input.OrderBy(r => r.From)) {
if (result.Count > 0) {
// Merge consequtive ranges if possible
ILRange last = result[result.Count - 1];
if (curr.From <= last.To) {
result[result.Count - 1] = new ILRange(last.From, Math.Max(last.To, curr.To));
continue;
}
}
result.Add(curr);
}
return ranges;
return result;
}
public static IEnumerable<ILRange> Invert(IEnumerable<ILRange> input, int codeSize)
public static List<ILRange> Invert(IEnumerable<ILRange> input, int codeSize)
{
if (input == null)
throw new ArgumentNullException("Input is null!");
@ -259,23 +265,25 @@ namespace ICSharpCode.Decompiler.ILAst
if (codeSize <= 0)
throw new ArgumentException("Code size must be grater than 0");
var ordered = OrderAndJoint(input);
List<ILRange> ordered = OrderAndJoin(input);
List<ILRange> result = new List<ILRange>(ordered.Count + 1);
if (ordered.Count == 0) {
yield return new ILRange() { From = 0, To = codeSize };
result.Add(new ILRange(0, codeSize));
} else {
// Gap before the first element
if (ordered.First().From != 0)
yield return new ILRange() { From = 0, To = ordered.First().From };
result.Add(new ILRange(0, ordered.First().From));
// Gaps between elements
for (int i = 0; i < ordered.Count - 1; i++)
yield return new ILRange() { From = ordered[i].To, To = ordered[i + 1].From };
result.Add(new ILRange(ordered[i].To, ordered[i + 1].From));
// Gap after the last element
Debug.Assert(ordered.Last().To <= codeSize);
if (ordered.Last().To != codeSize)
yield return new ILRange() { From = ordered.Last().To, To = codeSize };
result.Add(new ILRange(ordered.Last().To, codeSize));
}
return result;
}
}

Просмотреть файл

@ -303,7 +303,13 @@ namespace ICSharpCode.Decompiler.ILAst
return v.Type;
}
case ILCode.Ldloca:
return new ByReferenceType(((ILVariable)expr.Operand).Type);
{
ILVariable v = (ILVariable)expr.Operand;
if (v.Type != null)
return new ByReferenceType(v.Type);
else
return null;
}
#endregion
#region Call / NewObj
case ILCode.Call:

Просмотреть файл

@ -34,8 +34,9 @@ namespace ICSharpCode.Decompiler
void WriteLine();
void WriteDefinition(string text, object definition, bool isLocal = true);
void WriteReference(string text, object reference, bool isLocal = false);
void WritePrimitiveValue (object value, string literalValue = null);
void AddDebuggerMemberMapping(MemberMapping memberMapping);
void AddDebugSymbols(MethodDebugSymbols methodDebugSymbols);
void MarkFoldStart(string collapsedText = "...", bool defaultCollapsed = false);
void MarkFoldEnd();

Просмотреть файл

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.12.1 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -14,23 +14,51 @@
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
test $$am__dry = yes; \
}
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@ -47,8 +75,8 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/xbuild.include
DIST_COMMON = $(top_srcdir)/xbuild.include $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am
subdir = contrib/ICSharpCode.Decompiler
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
@ -57,6 +85,18 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
@ -64,16 +104,19 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_FLAGS = @ACLOCAL_FLAGS@
ALL_LINGUAS = @ALL_LINGUAS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
ASSEMBLY_VERSION = @ASSEMBLY_VERSION@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
COMPAT_ADDIN_VERSION = @COMPAT_ADDIN_VERSION@
CSC = @CSC@
CSC_FLAGS = @CSC_FLAGS@
CYGPATH_W = @CYGPATH_W@
@ -186,11 +229,11 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ALL_CSPROJ = $(wildcard *.csproj)
MAIN_SLN = $(top_builddir)/Main.sln
@ENABLE_GNOMEPLATFORM_TRUE@PROFILE_NAME = Debug
@ENABLE_GNOMEPLATFORM_TRUE@PROFILE_NAME = DebugGnome
@ENABLE_MACPLATFORM_TRUE@PROFILE_NAME = DebugMac
@ENABLE_WINDOWSPLATFORM_TRUE@PROFILE_NAME = DebugWin32
XBUILD = xbuild
XBUILD_VERBOSITY = quiet
XBUILD_VERBOSITY = normal
XBUILD_ARGS = /verbosity:$(XBUILD_VERBOSITY) /nologo /property:CodePage=65001
XBUILD_PROFILE = /property:Configuration=$(PROFILE_NAME)
@ -244,11 +287,9 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
tags: TAGS
TAGS:
tags TAGS:
ctags: CTAGS
CTAGS:
ctags CTAGS:
cscope cscopelist:
@ -383,15 +424,16 @@ uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
ctags-am distclean distclean-generic distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags-am uninstall uninstall-am
all: csproj_build

Просмотреть файл

@ -106,7 +106,12 @@ namespace ICSharpCode.Decompiler
{
Write(text);
}
public void WritePrimitiveValue (object value, string literalValue)
{
Write (value.ToString ());
}
void ITextOutput.MarkFoldStart(string collapsedText, bool defaultCollapsed)
{
}
@ -115,7 +120,7 @@ namespace ICSharpCode.Decompiler
{
}
void ITextOutput.AddDebuggerMemberMapping(MemberMapping memberMapping)
void ITextOutput.AddDebugSymbols(MethodDebugSymbols methodDebugSymbols)
{
}
}

Просмотреть файл

@ -1,27 +0,0 @@
#region Using directives
using System;
using System.Resources;
using System.Reflection;
using System.Runtime.InteropServices;
#endregion
[assembly: AssemblyTitle("ICSharpCode.Decompiler")]
[assembly: AssemblyDescription("IL decompiler engine")]
[assembly: AssemblyCompany("ic#code")]
[assembly: AssemblyProduct("ILSpy")]
[assembly: AssemblyCopyright("Copyright 2011 AlphaSierraPapa for the SharpDevelop Team")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("$INSERTVERSION$")]
[assembly: AssemblyInformationalVersion("$INSERTVERSION$$INSERTBRANCHPOSTFIX$$INSERTVERSIONNAMEPOSTFIX$-$INSERTSHORTCOMMITHASH$")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly",
Justification = "AssemblyInformationalVersion does not need to be a parsable version")]

Просмотреть файл

@ -1,5 +1,20 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;

Просмотреть файл

@ -1,5 +1,20 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//$CS
using System;
@ -69,6 +84,19 @@ namespace AppliedToEvent
public event EventHandler MyEvent;
}
}
//$$ AppliedToEventMethods
namespace AppliedToEventMethods
{
[AttributeUsage(AttributeTargets.Method)]
public class MyAttributeAttribute : Attribute
{
}
public class TestClass
{
[method: MyAttribute]
public event EventHandler MyEvent;
}
}
//$$ AppliedToField
namespace AppliedToField
{

Просмотреть файл

@ -1,5 +1,20 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
@ -61,4 +76,4 @@ namespace aa
{
}
}
}
}

Просмотреть файл

@ -58,7 +58,7 @@ namespace ICSharpCode.Decompiler.Tests
AssemblyDefinition assembly = Compile(code);
AstBuilder decompiler = new AstBuilder(new DecompilerContext(assembly.MainModule) { Settings = settings });
decompiler.AddAssembly(assembly);
new Helpers.RemoveCompilerAttribute().Run(decompiler.CompilationUnit);
new Helpers.RemoveCompilerAttribute().Run(decompiler.SyntaxTree);
StringWriter output = new StringWriter();
decompiler.GenerateCode(new PlainTextOutput(output));
return output.ToString();

Просмотреть файл

@ -34,7 +34,7 @@
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\bin\Debug\</OutputPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
@ -133,4 +133,4 @@
<None Include="BooleanConsumedAsInteger.il" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>
</Project>

Просмотреть файл

@ -184,7 +184,7 @@ namespace ICSharpCode.Decompiler.Tests
AssemblyDefinition assembly = Compile(code, optimize, useDebug);
AstBuilder decompiler = new AstBuilder(new DecompilerContext(assembly.MainModule));
decompiler.AddAssembly(assembly);
new Helpers.RemoveCompilerAttribute().Run(decompiler.CompilationUnit);
new Helpers.RemoveCompilerAttribute().Run(decompiler.SyntaxTree);
StringWriter output = new StringWriter();
decompiler.GenerateCode(new PlainTextOutput(output));
CodeAssert.AreEqual(code, output.ToString());

Просмотреть файл

@ -1,5 +1,20 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//$CS
using System;

Просмотреть файл

@ -1,5 +1,20 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//$CS
using System;

Просмотреть файл

@ -1,4 +0,0 @@
/home/builder/data/lanes/monodevelop-linux-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/build/bin/ICSharpCode.Decompiler.dll.mdb
/home/builder/data/lanes/monodevelop-linux-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/build/bin/ICSharpCode.Decompiler.dll
/home/builder/data/lanes/monodevelop-linux-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/contrib/ICSharpCode.Decompiler/obj/Debug/ICSharpCode.Decompiler.dll
/home/builder/data/lanes/monodevelop-linux-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/contrib/ICSharpCode.Decompiler/obj/Debug/ICSharpCode.Decompiler.dll.mdb

Просмотреть файл

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.12.1 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -14,23 +14,51 @@
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
test $$am__dry = yes; \
}
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@ -48,7 +76,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = contrib
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ChangeLog
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@ -56,15 +84,28 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@ -72,9 +113,29 @@ am__can_run_installinfo = \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
@ -108,11 +169,13 @@ ACLOCAL = @ACLOCAL@
ACLOCAL_FLAGS = @ACLOCAL_FLAGS@
ALL_LINGUAS = @ALL_LINGUAS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
ASSEMBLY_VERSION = @ASSEMBLY_VERSION@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
COMPAT_ADDIN_VERSION = @COMPAT_ADDIN_VERSION@
CSC = @CSC@
CSC_FLAGS = @CSC_FLAGS@
CYGPATH_W = @CYGPATH_W@
@ -265,17 +328,20 @@ $(am__aclocal_m4_deps):
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
@ -290,61 +356,12 @@ $(RECURSIVE_TARGETS):
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
cscopelist-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
done
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@ -360,12 +377,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@ -377,15 +389,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@ -394,9 +402,10 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP)'; \
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
@ -568,22 +577,19 @@ ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
cscopelist-recursive ctags-recursive install-am install-strip \
tags-recursive
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic cscopelist \
cscopelist-recursive ctags ctags-recursive distclean \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic cscopelist-am ctags ctags-am \
distclean distclean-generic distclean-tags distdir dvi dvi-am \
html html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
pdf-am ps ps-am tags tags-am uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.

102
external/Makefile.in поставляемый
Просмотреть файл

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.12.1 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -14,23 +14,51 @@
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
test $$am__dry = yes; \
}
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@ -48,7 +76,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = external
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@ -56,6 +84,18 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
@ -63,16 +103,19 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_FLAGS = @ACLOCAL_FLAGS@
ALL_LINGUAS = @ALL_LINGUAS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
ASSEMBLY_VERSION = @ASSEMBLY_VERSION@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
COMPAT_ADDIN_VERSION = @COMPAT_ADDIN_VERSION@
CSC = @CSC@
CSC_FLAGS = @CSC_FLAGS@
CYGPATH_W = @CYGPATH_W@
@ -217,11 +260,9 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
tags: TAGS
TAGS:
tags TAGS:
ctags: CTAGS
CTAGS:
ctags CTAGS:
cscope cscopelist:
@ -323,15 +364,16 @@ uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
ctags-am distclean distclean-generic distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags-am uninstall uninstall-am
all:

Просмотреть файл

@ -105,7 +105,7 @@ namespace Newtonsoft.Json.Serialization
return;
}
JsonConverter converter;
JsonConverter converter = null;
if ((((converter = (member != null) ? member.Converter : null) != null)
|| ((converter = (containerProperty != null) ? containerProperty.ItemConverter : null) != null)
|| ((converter = (containerContract != null) ? containerContract.ItemConverter : null) != null)

Просмотреть файл

@ -150,6 +150,13 @@ namespace Mono.Cecil {
return assembly;
#if !SILVERLIGHT && !CF
if (name.IsRetargetable) {
// if the reference is retargetable, zero it
name = new AssemblyNameReference (name.Name, new Version (0, 0, 0, 0)) {
PublicKeyToken = Empty<byte>.Array,
};
}
var framework_dir = Path.GetDirectoryName (typeof (object).Module.FullyQualifiedName);
if (IsZero (name.Version)) {

17
external/cecil/Mono.Cecil/MetadataResolver.cs поставляемый
Просмотреть файл

@ -57,9 +57,26 @@ namespace Mono.Cecil {
get { return member; }
}
public IMetadataScope Scope {
get {
var type = member as TypeReference;
if (type != null)
return type.Scope;
var declaring_type = member.DeclaringType;
if (declaring_type != null)
return declaring_type.Scope;
throw new NotSupportedException ();
}
}
public ResolutionException (MemberReference member)
: base ("Failed to resolve " + member.FullName)
{
if (member == null)
throw new ArgumentNullException ("member");
this.member = member;
}

5
external/cecil/Mono.Cecil/MetadataSystem.cs поставляемый
Просмотреть файл

@ -106,7 +106,7 @@ namespace Mono.Cecil {
return;
var scope = type.scope;
if (scope == null || scope.MetadataScopeType != MetadataScopeType.AssemblyNameReference || scope.Name != "mscorlib")
if (scope == null || scope.MetadataScopeType != MetadataScopeType.AssemblyNameReference)
return;
Row<ElementType, bool> primitive_data;
@ -124,9 +124,6 @@ namespace Mono.Cecil {
if (type.Namespace != "System")
return false;
if (!type.HasImage || !type.Module.IsCorlib ())
return false;
Row<ElementType, bool> primitive_data;
if (TryGetPrimitiveData (type, out primitive_data) && primitive_data.Col1.IsPrimitive ()) {
etype = primitive_data.Col1;

10
external/cecil/Mono.Cecil/TypeReference.cs поставляемый
Просмотреть файл

@ -147,6 +147,16 @@ namespace Mono.Cecil {
return scope;
}
set {
var declaring_type = this.DeclaringType;
if (declaring_type != null) {
declaring_type.Scope = value;
return;
}
scope = value;
}
}
public bool IsNested {

Просмотреть файл

@ -62,6 +62,7 @@
<Compile Include="Mono.Debugger.Soft\IInvokeAsyncResult.cs" />
<Compile Include="Mono.Debugger.Soft\ILExceptionHandler.cs" />
<Compile Include="Mono.Debugger.Soft\ILInstruction.cs" />
<Compile Include="Mono.Debugger.Soft\ILInterpreter.cs" />
<Compile Include="Mono.Debugger.Soft\IMirror.cs" />
<Compile Include="Mono.Debugger.Soft\InterfaceMappingMirror.cs" />
<Compile Include="Mono.Debugger.Soft\InvalidStackFrameException.cs" />

Просмотреть файл

@ -1,4 +1,5 @@
using System;
using System.Threading;
namespace Mono.Debugger.Soft
{
@ -6,6 +7,9 @@ namespace Mono.Debugger.Soft
{
string friendly_name;
AssemblyMirror entry_assembly, corlib;
AssemblyMirror[] assemblies;
bool assembliesCacheIsInvalid = true;
object assembliesCacheLocker = new object ();
internal AppDomainMirror (VirtualMachine vm, long id) : base (vm, id) {
}
@ -19,15 +23,26 @@ namespace Mono.Debugger.Soft
}
}
// Not cached
internal void InvalidateAssembliesCache () {
assembliesCacheIsInvalid = true;
}
public AssemblyMirror[] GetAssemblies () {
long[] ids = vm.conn.Domain_GetAssemblies (id);
AssemblyMirror[] assemblies = new AssemblyMirror [ids.Length];
// FIXME: Uniqueness
for (int i = 0; i < ids.Length; ++i)
assemblies [i] = vm.GetAssembly (ids [i]);
if (assembliesCacheIsInvalid) {
lock (assembliesCacheLocker) {
if (assembliesCacheIsInvalid) {
long[] ids = vm.conn.Domain_GetAssemblies (id);
assemblies = new AssemblyMirror [ids.Length];
// FIXME: Uniqueness
for (int i = 0; i < ids.Length; ++i)
assemblies [i] = vm.GetAssembly (ids [i]);
Thread.MemoryBarrier ();
assembliesCacheIsInvalid = false;
}
}
}
return assemblies;
}
}
// This returns null when called before the first AssemblyLoad event
public AssemblyMirror GetEntryAssembly () {

Просмотреть файл

@ -2,6 +2,7 @@ using System;
using System.Reflection;
using Mono.Debugger;
using Mono.Cecil;
using System.Collections.Generic;
namespace Mono.Debugger.Soft
{
@ -13,6 +14,8 @@ namespace Mono.Debugger.Soft
ModuleMirror main_module;
AssemblyName aname;
AssemblyDefinition meta;
Dictionary<string, long> typeCacheIgnoreCase = new Dictionary<string, long> (StringComparer.InvariantCultureIgnoreCase);
Dictionary<string, long> typeCache = new Dictionary<string, long> ();
internal AssemblyMirror (VirtualMachine vm, long id) : base (vm, id) {
}
@ -62,13 +65,30 @@ namespace Mono.Debugger.Soft
public TypeMirror GetType (string name, bool throwOnError, bool ignoreCase)
{
if (name == null)
throw new ArgumentNullException (name);
throw new ArgumentNullException ("name");
if (name.Length == 0)
throw new ArgumentException ("name", "Name cannot be empty");
if (throwOnError)
throw new NotImplementedException ();
return vm.GetType (vm.conn.Assembly_GetType (id, name, ignoreCase));
long typeId;
if (ignoreCase) {
if (!typeCacheIgnoreCase.TryGetValue (name, out typeId)) {
typeId = vm.conn.Assembly_GetType (id, name, ignoreCase);
typeCacheIgnoreCase.Add (name, typeId);
var type = vm.GetType (typeId);
if (type != null) {
typeCache.Add (type.FullName, typeId);
}
return type;
}
} else {
if (!typeCache.TryGetValue (name, out typeId)) {
typeId = vm.conn.Assembly_GetType (id, name, ignoreCase);
typeCache.Add (name, typeId);
}
}
return vm.GetType (typeId);
}
public TypeMirror GetType (String name, Boolean throwOnError)

Просмотреть файл

@ -44,6 +44,8 @@ namespace Mono.Debugger.Soft
public int[] il_offsets;
public int[] line_numbers;
public int[] column_numbers;
public int[] end_line_numbers;
public int[] end_column_numbers;
public SourceInfo[] source_files;
}
@ -93,6 +95,7 @@ namespace Mono.Debugger.Soft
public long catch_type_id;
}
[Flags]
enum ExceptionClauseFlags {
None = 0x0,
Filter = 0x1,
@ -146,9 +149,11 @@ namespace Mono.Debugger.Soft
enum ValueTypeId {
VALUE_TYPE_ID_NULL = 0xf0,
VALUE_TYPE_ID_TYPE = 0xf1
VALUE_TYPE_ID_TYPE = 0xf1,
VALUE_TYPE_ID_PARENT_VTYPE = 0xf2
}
[Flags]
enum InvokeFlags {
NONE = 0x0,
DISABLE_BREAKPOINTS = 0x1,
@ -205,6 +210,7 @@ namespace Mono.Debugger.Soft
public ValueImpl[] Fields; // for ElementType.ValueType
public bool IsEnum; // For ElementType.ValueType
public long Id; /* For VALUE_TYPE_ID_TYPE */
public int Index; /* For VALUE_TYPE_PARENT_VTYPE */
}
class ModuleInfo {
@ -212,6 +218,12 @@ namespace Mono.Debugger.Soft
public long Assembly;
}
class FieldMirrorInfo {
public string Name;
public long Parent, TypeId;
public int Attrs;
}
enum TokenType {
STRING = 0,
TYPE = 1,
@ -220,6 +232,7 @@ namespace Mono.Debugger.Soft
UNKNOWN = 4
}
[Flags]
enum StackFrameFlags {
NONE = 0,
DEBUGGER_INVOKE = 1,
@ -285,6 +298,9 @@ namespace Mono.Debugger.Soft
public bool Uncaught {
get; set;
}
public bool Subclasses {
get; set;
}
}
class AssemblyModifier : Modifier {
@ -342,6 +358,10 @@ namespace Mono.Debugger.Soft
get; set;
}
public int ExitCode {
get; set;
}
public EventInfo (EventType type, int req_id) {
EventType = type;
ReqId = req_id;
@ -384,8 +404,7 @@ namespace Mono.Debugger.Soft
static readonly bool EnableConnectionLogging = !String.IsNullOrEmpty (Environment.GetEnvironmentVariable ("MONO_SDB_LOG"));
static int ConnectionId;
readonly StreamWriter LoggingStream = EnableConnectionLogging ?
new StreamWriter (string.Format ("/tmp/sdb_conn_log_{0}", ConnectionId++), false) : null;
readonly StreamWriter LoggingStream;
/*
* Th version of the wire-protocol implemented by the library. The library
@ -395,7 +414,7 @@ namespace Mono.Debugger.Soft
* with newer runtimes, and vice versa.
*/
internal const int MAJOR_VERSION = 2;
internal const int MINOR_VERSION = 24;
internal const int MINOR_VERSION = 34;
enum WPSuspendPolicy {
NONE = 0,
@ -416,6 +435,7 @@ namespace Mono.Debugger.Soft
METHOD = 22,
TYPE = 23,
MODULE = 24,
FIELD = 25,
EVENT = 64
}
@ -463,7 +483,9 @@ namespace Mono.Debugger.Soft
SET_KEEPALIVE = 10,
GET_TYPES_FOR_SOURCE_FILE = 11,
GET_TYPES = 12,
INVOKE_METHODS = 13
INVOKE_METHODS = 13,
START_BUFFERING = 14,
STOP_BUFFERING = 15
}
enum CmdEvent {
@ -478,7 +500,8 @@ namespace Mono.Debugger.Soft
/* FIXME: Merge into GET_INFO when the major protocol version is increased */
GET_ID = 5,
/* Ditto */
GET_TID = 6
GET_TID = 6,
SET_IP = 7
}
enum CmdEventRequest {
@ -543,9 +566,15 @@ namespace Mono.Debugger.Soft
CMD_TYPE_GET_METHODS_BY_NAME_FLAGS = 15,
GET_INTERFACES = 16,
GET_INTERFACE_MAP = 17,
IS_INITIALIZED = 18
IS_INITIALIZED = 18,
CREATE_INSTANCE = 19
}
enum CmdField {
GET_INFO = 1
}
[Flags]
enum BindingFlagsExtensions {
BINDING_FLAGS_IGNORE_CASE = 0x70000000,
}
@ -822,6 +851,8 @@ namespace Mono.Debugger.Soft
return new ValueImpl { Type = etype };
case (ElementType)ValueTypeId.VALUE_TYPE_ID_TYPE:
return new ValueImpl () { Type = etype, Id = ReadId () };
case (ElementType)ValueTypeId.VALUE_TYPE_ID_PARENT_VTYPE:
return new ValueImpl () { Type = etype, Index = ReadInt () };
default:
throw new NotImplementedException ("Unable to handle type " + etype);
}
@ -1036,6 +1067,19 @@ namespace Mono.Debugger.Soft
reply_cbs = new Dictionary<int, ReplyCallback> ();
reply_cb_counts = new Dictionary<int, int> ();
reply_packets_monitor = new Object ();
if (EnableConnectionLogging) {
var path = Environment.GetEnvironmentVariable ("MONO_SDB_LOG");
if (path.Contains ("{0}")) {
//C:\SomeDir\sdbLog{0}.txt -> C:\SomeDir\sdbLog1.txt
LoggingStream = new StreamWriter (string.Format (path, ConnectionId++), false);
} else if (Path.HasExtension (path)) {
//C:\SomeDir\sdbLog.txt -> C:\SomeDir\sdbLog1.txt
LoggingStream = new StreamWriter (Path.GetDirectoryName (path) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension (path) + ConnectionId++ + "." + Path.GetExtension (path), false);
} else {
//C:\SomeDir\sdbLog -> C:\SomeDir\sdbLog1
LoggingStream = new StreamWriter (path + ConnectionId++, false);
}
}
}
protected abstract int TransportReceive (byte[] buf, int buf_offset, int len);
@ -1140,6 +1184,22 @@ namespace Mono.Debugger.Soft
TransportSend (packet, 0, packet.Length);
}
internal void WritePackets (List<byte[]> packets) {
// FIXME: Throw ClosedConnectionException () if the connection is closed
// FIXME: Throw ClosedConnectionException () if another thread closes the connection
// FIXME: Locking
int len = 0;
for (int i = 0; i < packets.Count; ++i)
len += packets [i].Length;
byte[] data = new byte [len];
int pos = 0;
for (int i = 0; i < packets.Count; ++i) {
Buffer.BlockCopy (packets [i], 0, data, pos, packets [i].Length);
pos += packets [i].Length;
}
TransportSend (data, 0, data.Length);
}
internal void Close () {
closed = true;
}
@ -1218,82 +1278,71 @@ namespace Mono.Debugger.Soft
EventType etype = (EventType)kind;
long thread_id = r.ReadId ();
if (kind == EventKind.VM_START) {
long thread_id = r.ReadId ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id };
//EventHandler.VMStart (req_id, thread_id, null);
} else if (kind == EventKind.VM_DEATH) {
int exit_code = 0;
if (Version.AtLeast (2, 27))
exit_code = r.ReadInt ();
//EventHandler.VMDeath (req_id, 0, null);
events [i] = new EventInfo (etype, req_id) { };
events [i] = new EventInfo (etype, req_id) { ExitCode = exit_code };
} else if (kind == EventKind.THREAD_START) {
long thread_id = r.ReadId ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = thread_id };
//EventHandler.ThreadStart (req_id, thread_id, thread_id);
} else if (kind == EventKind.THREAD_DEATH) {
long thread_id = r.ReadId ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = thread_id };
//EventHandler.ThreadDeath (req_id, thread_id, thread_id);
} else if (kind == EventKind.ASSEMBLY_LOAD) {
long thread_id = r.ReadId ();
long id = r.ReadId ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
//EventHandler.AssemblyLoad (req_id, thread_id, id);
} else if (kind == EventKind.ASSEMBLY_UNLOAD) {
long thread_id = r.ReadId ();
long id = r.ReadId ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
//EventHandler.AssemblyUnload (req_id, thread_id, id);
} else if (kind == EventKind.TYPE_LOAD) {
long thread_id = r.ReadId ();
long id = r.ReadId ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
//EventHandler.TypeLoad (req_id, thread_id, id);
} else if (kind == EventKind.METHOD_ENTRY) {
long thread_id = r.ReadId ();
long id = r.ReadId ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
//EventHandler.MethodEntry (req_id, thread_id, id);
} else if (kind == EventKind.METHOD_EXIT) {
long thread_id = r.ReadId ();
long id = r.ReadId ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
//EventHandler.MethodExit (req_id, thread_id, id);
} else if (kind == EventKind.BREAKPOINT) {
long thread_id = r.ReadId ();
long id = r.ReadId ();
long loc = r.ReadLong ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id, Location = loc };
//EventHandler.Breakpoint (req_id, thread_id, id, loc);
} else if (kind == EventKind.STEP) {
long thread_id = r.ReadId ();
long id = r.ReadId ();
long loc = r.ReadLong ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id, Location = loc };
//EventHandler.Step (req_id, thread_id, id, loc);
} else if (kind == EventKind.EXCEPTION) {
long thread_id = r.ReadId ();
long id = r.ReadId ();
long loc = 0; // FIXME
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id, Location = loc };
//EventHandler.Exception (req_id, thread_id, id, loc);
} else if (kind == EventKind.APPDOMAIN_CREATE) {
long thread_id = r.ReadId ();
long id = r.ReadId ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
//EventHandler.AppDomainCreate (req_id, thread_id, id);
} else if (kind == EventKind.APPDOMAIN_UNLOAD) {
long thread_id = r.ReadId ();
long id = r.ReadId ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
//EventHandler.AppDomainUnload (req_id, thread_id, id);
} else if (kind == EventKind.USER_BREAK) {
long thread_id = r.ReadId ();
long id = 0;
long loc = 0;
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id, Location = loc };
//EventHandler.Exception (req_id, thread_id, id, loc);
} else if (kind == EventKind.USER_LOG) {
long thread_id = r.ReadId ();
int level = r.ReadInt ();
string category = r.ReadString ();
string message = r.ReadString ();
@ -1357,6 +1406,9 @@ namespace Mono.Debugger.Soft
case CommandSet.MODULE:
cmd = ((CmdModule)command).ToString ();
break;
case CommandSet.FIELD:
cmd = ((CmdField)command).ToString ();
break;
case CommandSet.EVENT:
cmd = ((CmdEvent)command).ToString ();
break;
@ -1382,6 +1434,33 @@ namespace Mono.Debugger.Soft
LoggingStream.Flush ();
}
bool buffer_packets;
List<byte[]> buffered_packets = new List<byte[]> ();
//
// Start buffering request/response packets on both the client and the debuggee side.
// Packets sent between StartBuffering ()/StopBuffering () must be async, i.e. sent
// using Send () and not SendReceive ().
//
public void StartBuffering () {
buffer_packets = true;
if (Version.AtLeast (2, 34))
VM_StartBuffering ();
}
public void StopBuffering () {
if (Version.AtLeast (2, 34))
VM_StopBuffering ();
buffer_packets = false;
WritePackets (buffered_packets);
if (EnableConnectionLogging) {
LoggingStream.WriteLine (String.Format ("Sent {0} packets.", buffered_packets.Count));
LoggingStream.Flush ();
}
buffered_packets.Clear ();
}
/* Send a request and call cb when a result is received */
int Send (CommandSet command_set, int command, PacketWriter packet, Action<PacketReader> cb, int count) {
int id = IdGenerator;
@ -1396,22 +1475,32 @@ namespace Mono.Debugger.Soft
else
encoded_packet = EncodePacket (id, (int)command_set, command, packet.Data, packet.Offset);
lock (reply_packets_monitor) {
reply_cbs [id] = delegate (int packet_id, byte[] p) {
if (EnableConnectionLogging)
LogPacket (packet_id, encoded_packet, p, command_set, command, watch);
/* Run the callback on a tp thread to avoid blocking the receive thread */
PacketReader r = new PacketReader (p);
cb.BeginInvoke (r, null, null);
};
reply_cb_counts [id] = count;
if (cb != null) {
lock (reply_packets_monitor) {
reply_cbs [id] = delegate (int packet_id, byte[] p) {
if (EnableConnectionLogging)
LogPacket (packet_id, encoded_packet, p, command_set, command, watch);
/* Run the callback on a tp thread to avoid blocking the receive thread */
PacketReader r = new PacketReader (p);
cb.BeginInvoke (r, null, null);
};
reply_cb_counts [id] = count;
}
}
WritePacket (encoded_packet);
if (buffer_packets)
buffered_packets.Add (encoded_packet);
else
WritePacket (encoded_packet);
return id;
}
// Send a request without waiting for an answer
void Send (CommandSet command_set, int command) {
Send (command_set, command, null, null, 0);
}
PacketReader SendReceive (CommandSet command_set, int command, PacketWriter packet) {
int id = IdGenerator;
Stopwatch watch = null;
@ -1660,6 +1749,14 @@ namespace Mono.Debugger.Soft
return types;
}
internal void VM_StartBuffering () {
Send (CommandSet.VM, (int)CmdVM.START_BUFFERING);
}
internal void VM_StopBuffering () {
Send (CommandSet.VM, (int)CmdVM.STOP_BUFFERING);
}
/*
* DOMAIN
*/
@ -1739,6 +1836,8 @@ namespace Mono.Debugger.Soft
info.line_numbers = new int [n_il_offsets];
info.source_files = new SourceInfo [n_il_offsets];
info.column_numbers = new int [n_il_offsets];
info.end_line_numbers = new int [n_il_offsets];
info.end_column_numbers = new int [n_il_offsets];
for (int i = 0; i < n_il_offsets; ++i) {
info.il_offsets [i] = res.ReadInt ();
info.line_numbers [i] = res.ReadInt ();
@ -1752,6 +1851,13 @@ namespace Mono.Debugger.Soft
info.column_numbers [i] = res.ReadInt ();
else
info.column_numbers [i] = 0;
if (Version.AtLeast (2, 32)) {
info.end_line_numbers [i] = res.ReadInt ();
info.end_column_numbers [i] = res.ReadInt ();
} else {
info.end_column_numbers [i] = -1;
info.end_column_numbers [i] = -1;
}
}
return info;
@ -1889,21 +1995,20 @@ namespace Mono.Debugger.Soft
return SendReceive (CommandSet.THREAD, (int)CmdThread.GET_NAME, new PacketWriter ().WriteId (id)).ReadString ();
}
internal FrameInfo[] Thread_GetFrameInfo (long id, int start_frame, int length) {
var res = SendReceive (CommandSet.THREAD, (int)CmdThread.GET_FRAME_INFO, new PacketWriter ().WriteId (id).WriteInt (start_frame).WriteInt (length));
int count = res.ReadInt ();
var frames = new FrameInfo [count];
for (int i = 0; i < count; ++i) {
var f = new FrameInfo ();
f.id = res.ReadInt ();
f.method = res.ReadId ();
f.il_offset = res.ReadInt ();
f.flags = (StackFrameFlags)res.ReadByte ();
frames [i] = f;
}
return frames;
internal void Thread_GetFrameInfo (long id, int start_frame, int length, Action<FrameInfo[]> resultCallaback) {
Send (CommandSet.THREAD, (int)CmdThread.GET_FRAME_INFO, new PacketWriter ().WriteId (id).WriteInt (start_frame).WriteInt (length), (res) => {
int count = res.ReadInt ();
var frames = new FrameInfo[count];
for (int i = 0; i < count; ++i) {
var f = new FrameInfo ();
f.id = res.ReadInt ();
f.method = res.ReadId ();
f.il_offset = res.ReadInt ();
f.flags = (StackFrameFlags)res.ReadByte ();
frames [i] = f;
}
resultCallaback (frames);
}, 1);
}
internal int Thread_GetState (long id) {
@ -1926,6 +2031,10 @@ namespace Mono.Debugger.Soft
return SendReceive (CommandSet.THREAD, (int)CmdThread.GET_TID, new PacketWriter ().WriteId (id)).ReadLong ();
}
internal void Thread_SetIP (long id, long method_id, long il_offset) {
SendReceive (CommandSet.THREAD, (int)CmdThread.SET_IP, new PacketWriter ().WriteId (id).WriteId (method_id).WriteLong (il_offset));
}
/*
* MODULE
*/
@ -2135,6 +2244,21 @@ namespace Mono.Debugger.Soft
return r.ReadInt () == 1;
}
internal long Type_CreateInstance (long id) {
PacketReader r = SendReceive (CommandSet.TYPE, (int)CmdType.CREATE_INSTANCE, new PacketWriter ().WriteId (id));
return r.ReadId ();
}
/*
* FIELD
*/
internal FieldMirrorInfo Field_GetInfo (long id) {
PacketReader r = SendReceive (CommandSet.FIELD, (int)CmdField.GET_INFO, new PacketWriter ().WriteId (id));
FieldMirrorInfo info = new FieldMirrorInfo { Name = r.ReadString (), Parent = r.ReadId (), TypeId = r.ReadId (), Attrs = r.ReadInt () };
return info;
}
/*
* EVENTS
*/
@ -2174,6 +2298,11 @@ namespace Mono.Debugger.Soft
} else if (!em.Caught || !em.Uncaught) {
throw new NotSupportedException ("This request is not supported by the protocol version implemented by the debuggee.");
}
if (Version.MajorVersion > 2 || Version.MinorVersion > 24) {
w.WriteBool (em.Subclasses);
} else if (!em.Subclasses) {
throw new NotSupportedException ("This request is not supported by the protocol version implemented by the debuggee.");
}
} else if (mod is AssemblyModifier) {
w.WriteByte ((byte)ModifierKind.ASSEMBLY_ONLY);
var amod = (mod as AssemblyModifier);

Просмотреть файл

@ -6,7 +6,7 @@ namespace Mono.Debugger.Soft
public sealed class ExceptionEventRequest : EventRequest {
TypeMirror exc_type;
bool caught, uncaught;
bool caught, uncaught, subclasses;
internal ExceptionEventRequest (VirtualMachine vm, TypeMirror exc_type, bool caught, bool uncaught) : base (vm, EventType.Exception) {
if (exc_type != null) {
@ -18,6 +18,7 @@ namespace Mono.Debugger.Soft
this.exc_type = exc_type;
this.caught = caught;
this.uncaught = uncaught;
this.subclasses = true;
}
public TypeMirror ExceptionType {
@ -26,9 +27,21 @@ namespace Mono.Debugger.Soft
}
}
// Defaults to true
// Supported since protocol version 2.25
public bool IncludeSubclasses {
get {
return subclasses;
}
set {
vm.CheckProtocolVersion (2, 25);
subclasses = value;
}
}
public override void Enable () {
var mods = new List <Modifier> ();
mods.Add (new ExceptionModifier () { Type = exc_type != null ? exc_type.Id : 0, Caught = caught, Uncaught = uncaught });
mods.Add (new ExceptionModifier () { Type = exc_type != null ? exc_type.Id : 0, Caught = caught, Uncaught = uncaught, Subclasses = subclasses });
SendReq (mods);
}
}

Просмотреть файл

@ -15,38 +15,62 @@ namespace Mono.Debugger.Soft
FieldAttributes attrs;
CustomAttributeDataMirror[] cattrs;
C.FieldDefinition meta;
bool inited;
public FieldInfoMirror (TypeMirror parent, long id, string name, TypeMirror type, FieldAttributes attrs) : base (parent.VirtualMachine, id) {
this.parent = parent;
this.name = name;
this.type = type;
this.attrs = attrs;
inited = true;
}
public FieldInfoMirror (VirtualMachine vm, long id) : base (vm, id) {
}
public TypeMirror DeclaringType {
get {
if (!inited)
GetInfo ();
return parent;
}
}
public string Name {
get {
if (!inited)
GetInfo ();
return name;
}
}
public TypeMirror FieldType {
get {
if (!inited)
GetInfo ();
return type;
}
}
public FieldAttributes Attributes {
get {
if (!inited)
GetInfo ();
return attrs;
}
}
void GetInfo () {
if (inited)
return;
var info = vm.conn.Field_GetInfo (id);
name = info.Name;
parent = vm.GetType (info.Parent);
type = vm.GetType (info.TypeId);
attrs = (FieldAttributes)info.Attrs;
inited = true;
}
public bool IsLiteral
{
get {return (Attributes & FieldAttributes.Literal) != 0;}

Просмотреть файл

@ -0,0 +1,369 @@
using System;
using Mono.Cecil.Cil;
using Mono.Cecil.Metadata;
namespace Mono.Debugger.Soft
{
internal class ILInterpreter
{
MethodMirror method;
public ILInterpreter (MethodMirror method) {
this.method = method;
}
public Value Evaluate (Value this_val, Value[] args) {
var body = method.GetMethodBody ();
// Implement only the IL opcodes required to evaluate mcs compiled property accessors:
// IL_0000: nop
// IL_0001: ldarg.0
// IL_0002: ldfld int32 Tests::field_i
// IL_0007: stloc.0
// IL_0008: br IL_000d
// IL_000d: ldloc.0
// IL_000e: ret
// ... or returns a simple constant:
// IL_0000: ldc.i4 1024
// IL_0005: conv.i8
// IL_0006: ret
if (args != null && args.Length != 0)
throw new NotSupportedException ();
if (method.IsStatic || method.DeclaringType.IsValueType || this_val == null || !(this_val is ObjectMirror))
throw new NotSupportedException ();
var instructions = body.Instructions;
if (instructions.Count < 1 || instructions.Count > 16)
throw new NotSupportedException ();
var stack = new Value [16];
var ins = instructions [0];
Value locals_0 = null;
int ins_count = 0;
int sp = 0;
while (ins != null) {
if (ins_count > 16)
throw new NotImplementedException ();
var next = ins.Next;
ins_count++;
var op = ins.OpCode;
if (op == OpCodes.Nop) {
} else if (op == OpCodes.Ldarg_0) {
if (sp != 0)
throw new NotSupportedException ();
stack [sp++] = this_val;
} else if (op == OpCodes.Ldfld) {
if (sp != 1)
throw new NotSupportedException ();
var obj = (ObjectMirror) stack [--sp];
var field = (FieldInfoMirror) ins.Operand;
try {
stack [sp++] = obj.GetValue (field);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4_0) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, 0);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4_1) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, 1);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4_2) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, 2);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4_3) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, 3);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4_4) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, 4);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4_5) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, 5);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4_6) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, 6);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4_7) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, 7);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4_8) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, 8);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4_M1) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, -1);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, ins.Operand);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I4_S) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, ins.Operand);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_I8) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, ins.Operand);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_R4) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, ins.Operand);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Ldc_R8) {
if (sp != 0)
throw new NotSupportedException ();
try {
stack [sp++] = new PrimitiveValue (method.VirtualMachine, ins.Operand);
} catch (ArgumentException) {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Conv_I) {
if (sp != 1)
throw new NotSupportedException ();
try {
var primitive = (PrimitiveValue) stack [--sp];
stack [sp++] = new PrimitiveValue (method.VirtualMachine, Convert.ToInt32 (primitive.Value));
} catch {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Conv_I1) {
if (sp != 1)
throw new NotSupportedException ();
try {
var primitive = (PrimitiveValue) stack [--sp];
stack [sp++] = new PrimitiveValue (method.VirtualMachine, Convert.ToSByte (primitive.Value));
} catch {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Conv_U1) {
if (sp != 1)
throw new NotSupportedException ();
try {
var primitive = (PrimitiveValue) stack [--sp];
stack [sp++] = new PrimitiveValue (method.VirtualMachine, Convert.ToByte (primitive.Value));
} catch {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Conv_I2) {
if (sp != 1)
throw new NotSupportedException ();
try {
var primitive = (PrimitiveValue) stack [--sp];
stack [sp++] = new PrimitiveValue (method.VirtualMachine, Convert.ToInt16 (primitive.Value));
} catch {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Conv_U2) {
if (sp != 1)
throw new NotSupportedException ();
try {
var primitive = (PrimitiveValue) stack [--sp];
stack [sp++] = new PrimitiveValue (method.VirtualMachine, Convert.ToUInt16 (primitive.Value));
} catch {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Conv_I4) {
if (sp != 1)
throw new NotSupportedException ();
try {
var primitive = (PrimitiveValue) stack [--sp];
stack [sp++] = new PrimitiveValue (method.VirtualMachine, Convert.ToInt32 (primitive.Value));
} catch {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Conv_U4) {
if (sp != 1)
throw new NotSupportedException ();
try {
var primitive = (PrimitiveValue) stack [--sp];
stack [sp++] = new PrimitiveValue (method.VirtualMachine, Convert.ToUInt32 (primitive.Value));
} catch {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Conv_I8) {
if (sp != 1)
throw new NotSupportedException ();
try {
var primitive = (PrimitiveValue) stack [--sp];
stack [sp++] = new PrimitiveValue (method.VirtualMachine, Convert.ToInt64 (primitive.Value));
} catch {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Conv_U8) {
if (sp != 1)
throw new NotSupportedException ();
try {
var primitive = (PrimitiveValue) stack [--sp];
stack [sp++] = new PrimitiveValue (method.VirtualMachine, Convert.ToUInt64 (primitive.Value));
} catch {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Conv_R4) {
if (sp != 1)
throw new NotSupportedException ();
try {
var primitive = (PrimitiveValue) stack [--sp];
stack [sp++] = new PrimitiveValue (method.VirtualMachine, Convert.ToSingle (primitive.Value));
} catch {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Conv_R8) {
if (sp != 1)
throw new NotSupportedException ();
try {
var primitive = (PrimitiveValue) stack [--sp];
stack [sp++] = new PrimitiveValue (method.VirtualMachine, Convert.ToDouble (primitive.Value));
} catch {
throw new NotSupportedException ();
}
} else if (op == OpCodes.Stloc_0) {
if (sp != 1)
throw new NotSupportedException ();
locals_0 = stack [--sp];
} else if (op == OpCodes.Br) {
next = (ILInstruction) ins.Operand;
} else if (op == OpCodes.Ldloc_0) {
if (sp != 0)
throw new NotSupportedException ();
stack [sp++] = locals_0;
} else if (op == OpCodes.Ret) {
if (sp > 0) {
var res = stack [--sp];
var primitive = res as PrimitiveValue;
if (method.ReturnType.IsPrimitive && primitive != null) {
// cast the primitive value to the return type
try {
switch (method.ReturnType.CSharpName) {
case "double": res = new PrimitiveValue (method.VirtualMachine, Convert.ToDouble (primitive.Value)); break;
case "float": res = new PrimitiveValue (method.VirtualMachine, Convert.ToSingle (primitive.Value)); break;
case "ulong": res = new PrimitiveValue (method.VirtualMachine, Convert.ToUInt64 (primitive.Value)); break;
case "long": res = new PrimitiveValue (method.VirtualMachine, Convert.ToInt64 (primitive.Value)); break;
case "uint": res = new PrimitiveValue (method.VirtualMachine, Convert.ToUInt32 (primitive.Value)); break;
case "int": res = new PrimitiveValue (method.VirtualMachine, Convert.ToInt32 (primitive.Value)); break;
case "ushort": res = new PrimitiveValue (method.VirtualMachine, Convert.ToUInt16 (primitive.Value)); break;
case "short": res = new PrimitiveValue (method.VirtualMachine, Convert.ToInt16 (primitive.Value)); break;
case "sbyte": res = new PrimitiveValue (method.VirtualMachine, Convert.ToSByte (primitive.Value)); break;
case "byte": res = new PrimitiveValue (method.VirtualMachine, Convert.ToByte (primitive.Value)); break;
case "char": res = new PrimitiveValue (method.VirtualMachine, Convert.ToChar (primitive.Value)); break;
case "bool": res = new PrimitiveValue (method.VirtualMachine, Convert.ToBoolean (primitive.Value)); break;
}
} catch {
throw new NotSupportedException ();
}
}
return res;
}
return null;
} else {
throw new NotSupportedException ();
}
ins = next;
}
return null;
}
}
}

Просмотреть файл

@ -11,8 +11,10 @@ namespace Mono.Debugger.Soft
int line_number;
byte[] hash;
int column_number;
int end_line_number;
int end_column_number;
internal Location (VirtualMachine vm, MethodMirror method, long native_addr, int il_offset, string source_file, int line_number, int column_number, byte[] hash) : base (vm, 0) {
internal Location (VirtualMachine vm, MethodMirror method, long native_addr, int il_offset, string source_file, int line_number, int column_number, int end_line_number, int end_column_number, byte[] hash) : base (vm, 0) {
this.method = method;
//this.native_addr = native_addr;
this.il_offset = il_offset;
@ -20,6 +22,8 @@ namespace Mono.Debugger.Soft
this.line_number = line_number;
this.hash = hash;
this.column_number = column_number;
this.end_line_number = end_line_number;
this.end_column_number = end_column_number;
}
public MethodMirror Method {
@ -53,6 +57,20 @@ namespace Mono.Debugger.Soft
}
}
// Since protocol version 2.32, -1 in earlier protocol versions, or if not available
public int EndLineNumber {
get {
return end_line_number;
}
}
// Since protocol version 2.32, -1 in earlier protocol versions, or if not available
public int EndColumnNumber {
get {
return end_column_number;
}
}
// MD5 hash of source file
// Since protocol version 2.14, null in earlier protocol versions
public byte[] SourceFileHash {
@ -62,7 +80,10 @@ namespace Mono.Debugger.Soft
}
public override string ToString () {
return String.Format ("{0}+0x{1:x} at {2}:{3}", Method.FullName, ILOffset, SourceFile, LineNumber);
if (EndLineNumber != -1 && EndColumnNumber != -1)
return String.Format ("{0}+0x{1:x} at {2}:[{3}:{4}-{5}:{6}]", Method.FullName, ILOffset, SourceFile, LineNumber, ColumnNumber, EndLineNumber, EndColumnNumber);
else
return String.Format ("{0}+0x{1:x} at {2}:{3}", Method.FullName, ILOffset, SourceFile, LineNumber);
}
}
}

Просмотреть файл

@ -57,6 +57,20 @@ namespace Mono.Debugger.Soft
static OpCode [] OneByteOpCode = new OpCode [0xe0 + 1];
static OpCode [] TwoBytesOpCode = new OpCode [0x1e + 1];
Dictionary<int, ResolvedToken> tokensCache = new Dictionary<int, ResolvedToken> ();
ResolvedToken ResolveToken (int token)
{
lock (tokensCache) {
ResolvedToken resolvedToken;
if (!tokensCache.TryGetValue (token, out resolvedToken)) {
resolvedToken = vm.conn.Method_ResolveToken (Method.Id, token);
tokensCache.Add (token, resolvedToken);
}
return resolvedToken;
}
}
// Adapted from Cecil
List<ILInstruction> ReadCilBody (BinaryReader br, int code_size)
{
@ -152,7 +166,7 @@ namespace Mono.Debugger.Soft
break;
case OperandType.InlineString :
token = br.ReadInt32 ();
t = vm.conn.Method_ResolveToken (Method.Id, token);
t = ResolveToken (token);
if (t.Type == TokenType.STRING)
instr.Operand = t.Str;
break;
@ -162,15 +176,14 @@ namespace Mono.Debugger.Soft
case OperandType.InlineTok :
token = br.ReadInt32 ();
t = vm.conn.Method_ResolveToken (Method.Id, token);
t = ResolveToken (token);
switch (t.Type) {
case TokenType.TYPE:
instr.Operand = vm.GetType (t.Id);
break;
case TokenType.FIELD:
// FIXME: No vm.GetField ()
//instr.Operand = vm.GetField (t.Id);
instr.Operand = vm.GetField (t.Id);
break;
case TokenType.METHOD:
instr.Operand = vm.GetMethod (t.Id);

Просмотреть файл

@ -249,15 +249,15 @@ namespace Mono.Debugger.Soft
}
// Add the arguments as well
var pi = vm.conn.Method_GetParamInfo (id);
var pi = GetParameters ();
locals = new LocalVariable [pi.param_count + li.names.Length];
locals = new LocalVariable [pi.Length + li.names.Length];
for (int i = 0; i < pi.param_count; ++i)
locals [i] = new LocalVariable (vm, this, i, pi.param_types [i], pi.param_names [i], -1, -1, true);
for (int i = 0; i < pi.Length; ++i)
locals [i] = new LocalVariable (vm, this, i, pi[i].ParameterType.Id, pi[i].Name, -1, -1, true);
for (int i = 0; i < li.names.Length; ++i)
locals [i + pi.param_count] = new LocalVariable (vm, this, i, li.types [i], li.names [i], li.live_range_start [i], li.live_range_end [i], false);
locals [i + pi.Length] = new LocalVariable (vm, this, i, li.types [i], li.names [i], li.live_range_start [i], li.live_range_end [i], false);
}
return locals;
}
@ -362,14 +362,14 @@ namespace Mono.Debugger.Soft
var line_numbers = LineNumbers;
IList<Location> res = new Location [ILOffsets.Count];
for (int i = 0; i < il_offsets.Count; ++i)
res [i] = new Location (vm, this, -1, il_offsets [i], debug_info.source_files [i].source_file, line_numbers [i], debug_info.column_numbers [i], debug_info.source_files [i].hash);
res [i] = new Location (vm, this, -1, il_offsets [i], debug_info.source_files [i].source_file, line_numbers [i], debug_info.column_numbers [i], debug_info.end_line_numbers [i], debug_info.end_column_numbers [i], debug_info.source_files [i].hash);
locations = res;
}
return locations;
}
}
internal int il_offset_to_line_number (int il_offset, out string src_file, out byte[] src_hash, out int column_number) {
internal int il_offset_to_line_number (int il_offset, out string src_file, out byte[] src_hash, out int column_number, out int end_line_number, out int end_column_number) {
if (debug_info == null)
debug_info = vm.conn.Method_GetDebugInfo (id);
@ -377,11 +377,15 @@ namespace Mono.Debugger.Soft
src_file = null;
src_hash = null;
column_number = 0;
end_line_number = -1;
end_column_number = -1;
for (int i = debug_info.il_offsets.Length - 1; i >= 0; --i) {
if (debug_info.il_offsets [i] <= il_offset) {
src_file = debug_info.source_files [i].source_file;
src_hash = debug_info.source_files [i].hash;
column_number = debug_info.column_numbers [i];
end_line_number = debug_info.end_line_numbers [i];
end_column_number = debug_info.end_column_numbers [i];
return debug_info.line_numbers [i];
}
}
@ -407,5 +411,21 @@ namespace Mono.Debugger.Soft
return meta;
}
}
//
// Evaluate the method on the client using an IL interpreter.
// Only supports a subset of IL instructions. Doesn't change
// debuggee state.
// Returns the result of the evaluation, or null for methods
// which return void.
// Throws a NotSupportedException if the method body contains
// unsupported IL instructions, or if evaluating the method
// would change debuggee state.
//
public Value Evaluate (Value this_val, Value[] args) {
var interp = new ILInterpreter (this);
return interp.Evaluate (this_val, args);
}
}
}

Просмотреть файл

@ -2,6 +2,9 @@ using System;
using System.Collections.Generic;
using System.Runtime.Remoting.Messaging;
using System.Threading;
#if NET_4_5
using System.Threading.Tasks;
#endif
namespace Mono.Debugger.Soft
{
@ -71,9 +74,11 @@ namespace Mono.Debugger.Soft
try {
return vm.DecodeValues (vm.conn.Object_GetValues (id, ids));
} catch (CommandException ex) {
if (ex.ErrorCode == ErrorCode.INVALID_FIELDID)
if (ex.ErrorCode == ErrorCode.INVALID_FIELDID) {
if (fields.Count == 1)
throw new ArgumentException (string.Format ("The field '{0}' is not valid for this type.", fields[0].Name));
throw new ArgumentException ("One of the fields is not valid for this type.", "fields");
else
} else
throw;
}
}
@ -144,6 +149,23 @@ namespace Mono.Debugger.Soft
return EndInvokeMethodInternal (asyncResult);
}
#if NET_4_5
public Task<Value> InvokeMethodAsync (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options = InvokeOptions.None) {
var tcs = new TaskCompletionSource<Value> ();
BeginInvokeMethod (thread, method, arguments, options, iar =>
{
try {
tcs.SetResult (EndInvokeMethod (iar));
} catch (OperationCanceledException) {
tcs.TrySetCanceled ();
} catch (Exception ex) {
tcs.TrySetException (ex);
}
}, null);
return tcs.Task;
}
#endif
//
// Invoke the members of METHODS one-by-one, calling CALLBACK after each invoke was finished. The IAsyncResult will be marked as completed after all invokes have
// finished. The callback will be called with a different IAsyncResult that represents one method invocation.
@ -240,7 +262,7 @@ namespace Mono.Debugger.Soft
f |= InvokeFlags.SINGLE_THREADED;
InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Thread = thread, Callback = callback };
thread.InvalidateFrames ();
r.ID = vm.conn.VM_BeginInvokeMethod (thread.Id, method.Id, this_obj != null ? vm.EncodeValue (this_obj) : vm.EncodeValue (vm.CreateValue (null)), vm.EncodeValues (arguments), f, InvokeCB, r);
return r;
@ -279,15 +301,15 @@ namespace Mono.Debugger.Soft
} catch (CommandException ex) {
if (ex.ErrorCode == ErrorCode.INVALID_ARGUMENT)
throw new ArgumentException ("Incorrect number or types of arguments", "arguments");
else
throw;
throw;
}
throw new NotImplementedException ();
} else {
if (r.Exception != null)
throw new InvocationException ((ObjectMirror)r.VM.DecodeValue (r.Exception));
else
return r.VM.DecodeValue (r.Value);
return r.VM.DecodeValue (r.Value);
}
}
@ -348,6 +370,7 @@ namespace Mono.Debugger.Soft
var args = new List<ValueImpl[]> ();
for (int i = 0; i < methods.Length; ++i)
args.Add (vm.EncodeValues (arguments [i]));
thread.InvalidateFrames ();
r.ID = vm.conn.VM_BeginInvokeMethods (thread.Id, mids, this_obj != null ? vm.EncodeValue (this_obj) : vm.EncodeValue (vm.CreateValue (null)), args, f, InvokeMultipleCB, r);
return r;

Просмотреть файл

@ -22,8 +22,11 @@ namespace Mono.Debugger.Soft
public override bool Equals (object obj) {
if (value == obj)
return true;
if (obj != null && obj is PrimitiveValue)
return value == (obj as PrimitiveValue).Value;
var primitive = obj as PrimitiveValue;
if (primitive != null)
return value == primitive.Value;
return base.Equals (obj);
}

Просмотреть файл

@ -45,13 +45,15 @@ namespace Mono.Debugger.Soft
string src_file = null;
byte[] hash = null;
int column_number = 0;
int end_line_number = -1;
int end_column_number = -1;
if (il_offset == -1)
line_number = -1;
else
line_number = method.il_offset_to_line_number (il_offset, out src_file, out hash, out column_number);
line_number = method.il_offset_to_line_number (il_offset, out src_file, out hash, out column_number, out end_line_number, out end_column_number);
location = new Location (vm, Method, 0, il_offset, src_file != null ? src_file : method.SourceFile, line_number, column_number, hash);
location = new Location (vm, Method, 0, il_offset, src_file != null ? src_file : method.SourceFile, line_number, column_number, end_line_number, end_column_number, hash);
}
return location;
}

Просмотреть файл

@ -23,7 +23,14 @@ namespace Mono.Debugger.Soft
StaticCtor = 1,
/* Since protocol version 2.20 */
/* Methods which have the [DebuggerHidden] attribute */
/* Before protocol version 2.26, this includes [DebuggerStepThrough] as well */
DebuggerHidden = 2,
/* Since protocol version 2.26 */
/* Methods which have the [DebuggerStepThrough] attribute */
DebuggerStepThrough = 4,
/* Since protocol version 2.30 */
/* Methods which have the [DebuggerNonUserCode] attribute */
DebuggerNonUserCode = 8
}
public sealed class StepEventRequest : EventRequest {

Просмотреть файл

@ -41,6 +41,24 @@ namespace Mono.Debugger.Soft
}
throw new ArgumentException ("Unknown struct field '" + field + "'.", "field");
}
set {
FieldInfoMirror[] field_info = Type.GetFields ();
int nf = 0;
for (int i = 0; i < field_info.Length; ++i) {
if (!field_info [i].IsStatic) {
if (field_info [i].Name == field) {
fields [nf] = value;
return;
}
nf++;
}
}
throw new ArgumentException ("Unknown struct field '" + field + "'.", "field");
}
}
internal void SetFields (Value[] fields) {
this.fields = fields;
}
internal void SetField (int index, Value value) {

Просмотреть файл

@ -7,6 +7,12 @@ namespace Mono.Debugger.Soft
public class ThreadMirror : ObjectMirror
{
string name;
bool cacheInvalid = true;
bool fetching;
object fetchingLocker = new object ();
ManualResetEvent fetchingEvent = new ManualResetEvent (false);
ThreadInfo info;
StackFrame[] frames;
internal ThreadMirror (VirtualMachine vm, long id) : base (vm, id) {
}
@ -14,22 +20,58 @@ namespace Mono.Debugger.Soft
internal ThreadMirror (VirtualMachine vm, long id, TypeMirror type, AppDomainMirror domain) : base (vm, id, type, domain) {
}
// FIXME: Cache, invalidate when the thread/runtime is resumed
public StackFrame[] GetFrames () {
FrameInfo[] frame_info = vm.conn.Thread_GetFrameInfo (id, 0, -1);
FetchFrames (true);
fetchingEvent.WaitOne ();
return frames;
}
var frames = new List<StackFrame> ();
internal void InvalidateFrames () {
cacheInvalid = true;
}
for (int i = 0; i < frame_info.Length; ++i) {
FrameInfo info = (FrameInfo)frame_info [i];
MethodMirror method = vm.GetMethod (info.method);
var f = new StackFrame (vm, info.id, this, method, info.il_offset, info.flags);
if (!(f.IsNativeTransition && !NativeTransitions))
frames.Add (f);
internal void FetchFrames (bool mustFetch = false) {
lock (fetchingLocker) {
if (fetching || !cacheInvalid)
return;
cacheInvalid = false;
fetching = true;
fetchingEvent.Reset ();
}
vm.conn.Thread_GetFrameInfo (id, 0, -1, (frame_info) => {
var framesList = new List<StackFrame> ();
for (int i = 0; i < frame_info.Length; ++i) {
var frameInfo = (FrameInfo)frame_info [i];
var method = vm.GetMethod (frameInfo.method);
var f = new StackFrame (vm, frameInfo.id, this, method, frameInfo.il_offset, frameInfo.flags);
if (!(f.IsNativeTransition && !NativeTransitions))
framesList.Add (f);
}
lock (fetchingLocker) {
vm.AddThreadToInvalidateList (this);
fetching = false;
//In case it was invalidated during waiting for response from
//runtime and mustFetch was set refetch
if (cacheInvalid && mustFetch) {
FetchFrames (mustFetch);
return;
}
frames = framesList.ToArray ();
fetchingEvent.Set ();
}
});
}
return frames.ToArray ();
}
public static void FetchFrames(IList<ThreadMirror> threads)
{
if (threads.Count == 0)
return;
threads [0].vm.conn.StartBuffering ();
foreach (var thread in threads) {
thread.FetchFrames ();
}
threads [0].vm.conn.StopBuffering ();
}
public string Name {
get {
@ -37,7 +79,7 @@ namespace Mono.Debugger.Soft
name = vm.conn.Thread_GetName (id);
return name;
}
}
}
public new long Id {
get {
@ -53,8 +95,8 @@ namespace Mono.Debugger.Soft
public bool IsThreadPoolThread {
get {
ThreadInfo info = vm.conn.Thread_GetInfo (id);
if (info == null)
info = vm.conn.Thread_GetInfo (id);
return info.is_thread_pool;
}
}
@ -91,5 +133,28 @@ namespace Mono.Debugger.Soft
public static bool NativeTransitions {
get; set;
}
/*
* Set the location where execution will return when this thread is
* resumed.
* Throws:
* ArgumentException - if L doesn't refer to a location in the
* current method of this thread.
* NotSupportedException - if continuing at L is not supported
* for any other reason.
* Since protocol version 29.
*/
public void SetIP (Location loc) {
if (loc == null)
throw new ArgumentNullException ("loc");
try {
vm.conn.Thread_SetIP (id, loc.Method.Id, loc.ILOffset);
} catch (CommandException ex) {
if (ex.ErrorCode == ErrorCode.INVALID_ARGUMENT)
throw new ArgumentException ("loc doesn't refer to a location in the current method of this thread.", "loc");
throw;
}
}
}
}

Просмотреть файл

@ -3,6 +3,9 @@ using System.Collections.Generic;
using System.Reflection;
using C = Mono.Cecil;
using Mono.Cecil.Metadata;
#if NET_4_5
using System.Threading.Tasks;
#endif
namespace Mono.Debugger.Soft
{
@ -26,6 +29,7 @@ namespace Mono.Debugger.Soft
TypeMirror[] ifaces;
Dictionary<TypeMirror, InterfaceMappingMirror> iface_map;
TypeMirror[] type_args;
bool cached_base_type;
bool inited;
internal const BindingFlags DefaultBindingFlags =
@ -78,9 +82,9 @@ namespace Mono.Debugger.Soft
public TypeMirror BaseType {
get {
// FIXME: base_type could be null for object/interfaces
if (base_type == null) {
if (!cached_base_type) {
base_type = vm.GetType (GetInfo ().base_type);
cached_base_type = true;
}
return base_type;
}
@ -188,6 +192,14 @@ namespace Mono.Debugger.Soft
}
}
public bool IsNested {
get {
var masked = (Attributes & TypeAttributes.VisibilityMask);
return masked >= TypeAttributes.NestedPublic && masked <= TypeAttributes.NestedFamORAssem;
}
}
public bool IsNestedAssembly {
get {
return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedAssembly;
@ -591,11 +603,11 @@ namespace Mono.Debugger.Soft
string[] source_files;
string[] source_files_full_path;
public string[] GetSourceFiles (bool return_full_paths) {
string[] res = return_full_paths ? source_files_full_path : source_files;
public string[] GetSourceFiles (bool returnFullPaths) {
string[] res = returnFullPaths ? source_files_full_path : source_files;
if (res == null) {
res = vm.conn.Type_GetSourceFiles (id, return_full_paths);
if (return_full_paths)
res = vm.conn.Type_GetSourceFiles (id, returnFullPaths);
if (returnFullPaths)
source_files_full_path = res;
else
source_files = res;
@ -684,29 +696,38 @@ namespace Mono.Debugger.Soft
* used by the reflection-only functionality on .net.
*/
public CustomAttributeDataMirror[] GetCustomAttributes (bool inherit) {
return GetCAttrs (null, inherit);
return GetCustomAttrs (null, inherit);
}
public CustomAttributeDataMirror[] GetCustomAttributes (TypeMirror attributeType, bool inherit) {
if (attributeType == null)
throw new ArgumentNullException ("attributeType");
return GetCAttrs (attributeType, inherit);
return GetCustomAttrs (attributeType, inherit);
}
CustomAttributeDataMirror[] GetCAttrs (TypeMirror type, bool inherit) {
void AppendCustomAttrs (IList<CustomAttributeDataMirror> attrs, TypeMirror type, bool inherit)
{
if (cattrs == null && Metadata != null && !Metadata.HasCustomAttributes)
cattrs = new CustomAttributeDataMirror [0];
// FIXME: Handle inherit
if (cattrs == null) {
CattrInfo[] info = vm.conn.Type_GetCustomAttributes (id, 0, false);
cattrs = CustomAttributeDataMirror.Create (vm, info);
}
var res = new List<CustomAttributeDataMirror> ();
foreach (var attr in cattrs)
foreach (var attr in cattrs) {
if (type == null || attr.Constructor.DeclaringType == type)
res.Add (attr);
return res.ToArray ();
attrs.Add (attr);
}
if (inherit && BaseType != null)
BaseType.AppendCustomAttrs (attrs, type, inherit);
}
CustomAttributeDataMirror[] GetCustomAttrs (TypeMirror type, bool inherit) {
var attrs = new List<CustomAttributeDataMirror> ();
AppendCustomAttrs (attrs, type, inherit);
return attrs.ToArray ();
}
public MethodMirror[] GetMethodsByNameFlags (string name, BindingFlags flags, bool ignoreCase) {
@ -785,14 +806,42 @@ namespace Mono.Debugger.Soft
return ObjectMirror.EndInvokeMethodInternal (asyncResult);
}
#if NET_4_5
public Task<Value> InvokeMethodAsync (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options = InvokeOptions.None) {
var tcs = new TaskCompletionSource<Value> ();
BeginInvokeMethod (thread, method, arguments, options, iar =>
{
try {
tcs.SetResult (EndInvokeMethod (iar));
} catch (OperationCanceledException) {
tcs.TrySetCanceled ();
} catch (Exception ex) {
tcs.TrySetException (ex);
}
}, null);
return tcs.Task;
}
#endif
public Value NewInstance (ThreadMirror thread, MethodMirror method, IList<Value> arguments) {
return ObjectMirror.InvokeMethod (vm, thread, method, null, arguments, InvokeOptions.None);
return NewInstance (thread, method, arguments, InvokeOptions.None);
}
public Value NewInstance (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options) {
if (method == null)
throw new ArgumentNullException ("method");
if (!method.IsConstructor)
throw new ArgumentException ("The method must be a constructor.", "method");
return ObjectMirror.InvokeMethod (vm, thread, method, null, arguments, options);
}
// Since protocol version 2.31
public Value NewInstance () {
return vm.GetObject (vm.conn.Type_CreateInstance (id));
}
// Since protocol version 2.11
public TypeMirror[] GetInterfaces () {
if (ifaces == null)

Просмотреть файл

@ -4,7 +4,18 @@ namespace Mono.Debugger.Soft
{
public class VMDeathEvent : Event
{
public VMDeathEvent (VirtualMachine vm, int req_id) : base (EventType.VMDeath, vm, req_id, -1) {
int exit_code;
public VMDeathEvent (VirtualMachine vm, int req_id, int exit_code) : base (EventType.VMDeath, vm, req_id, -1) {
this.exit_code = exit_code;
}
// Since protocol version 2.27
public int ExitCode {
get {
vm.CheckProtocolVersion (2, 27);
return exit_code;
}
}
}
}

Просмотреть файл

@ -121,12 +121,13 @@ namespace Mono.Debugger.Soft
public void Resume () {
try {
InvalidateThreadAndFrameCaches ();
conn.VM_Resume ();
} catch (CommandException ex) {
if (ex.ErrorCode == ErrorCode.NOT_SUSPENDED)
throw new VMNotSuspendedException ();
else
throw;
throw;
}
}
@ -137,7 +138,7 @@ namespace Mono.Debugger.Soft
public void Detach () {
conn.VM_Dispose ();
conn.Close ();
notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, 0, 0, null);
notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, 0, 0, null, 0);
}
[Obsolete ("This method was poorly named; use the Detach() method instead")]
@ -151,12 +152,44 @@ namespace Mono.Debugger.Soft
conn.ForceDisconnect ();
}
HashSet<ThreadMirror> threadsToInvalidate = new HashSet<ThreadMirror> ();
ThreadMirror[] threadCache;
object threadCacheLocker = new object ();
void InvalidateThreadAndFrameCaches () {
lock (threadsToInvalidate) {
foreach (var thread in threadsToInvalidate)
thread.InvalidateFrames ();
threadsToInvalidate.Clear ();
}
lock (threadCacheLocker) {
threadCache = null;
}
}
internal void InvalidateThreadCache () {
lock (threadCacheLocker) {
threadCache = null;
}
}
internal void AddThreadToInvalidateList (ThreadMirror threadMirror)
{
lock (threadsToInvalidate) {
threadsToInvalidate.Add (threadMirror);
}
}
public IList<ThreadMirror> GetThreads () {
long[] ids = vm.conn.VM_GetThreads ();
ThreadMirror[] res = new ThreadMirror [ids.Length];
for (int i = 0; i < ids.Length; ++i)
res [i] = GetThread (ids [i]);
return res;
lock (threadCacheLocker) {
if (threadCache == null) {
long[] ids = vm.conn.VM_GetThreads ();
threadCache = new ThreadMirror [ids.Length];
for (int i = 0; i < ids.Length; ++i)
threadCache [i] = GetThread (ids [i]);
}
return threadCache;
}
}
// Same as the mirrorOf methods in JDI
@ -227,10 +260,14 @@ namespace Mono.Debugger.Soft
}
public void EnableEvents (params EventType[] events) {
EnableEvents (events, SuspendPolicy.All);
}
public void EnableEvents (EventType[] events, SuspendPolicy suspendPolicy) {
foreach (EventType etype in events) {
if (etype == EventType.Breakpoint)
throw new ArgumentException ("Breakpoint events cannot be requested using EnableEvents", "events");
conn.EnableEvent (etype, SuspendPolicy.All, null);
conn.EnableEvent (etype, suspendPolicy, null);
}
}
@ -315,7 +352,7 @@ namespace Mono.Debugger.Soft
root_domain = GetDomain (root_domain_id);
}
internal void notify_vm_event (EventType evtype, SuspendPolicy spolicy, int req_id, long thread_id, string vm_uri) {
internal void notify_vm_event (EventType evtype, SuspendPolicy spolicy, int req_id, long thread_id, string vm_uri, int exit_code) {
//Console.WriteLine ("Event: " + evtype + "(" + vm_uri + ")");
switch (evtype) {
@ -327,7 +364,7 @@ namespace Mono.Debugger.Soft
queue_event_set (new EventSet (this, spolicy, new Event[] { new VMStartEvent (vm, req_id, thread_id) }));
break;
case EventType.VMDeath:
queue_event_set (new EventSet (this, spolicy, new Event[] { new VMDeathEvent (vm, req_id) }));
queue_event_set (new EventSet (this, spolicy, new Event[] { new VMDeathEvent (vm, req_id, exit_code) }));
break;
case EventType.VMDisconnect:
queue_event_set (new EventSet (this, spolicy, new Event[] { new VMDisconnectEvent (vm, req_id) }));
@ -438,6 +475,13 @@ namespace Mono.Debugger.Soft
}
}
internal void InvalidateAssemblyCaches () {
lock (domains_lock) {
foreach (var d in domains.Values)
d.InvalidateAssembliesCache ();
}
}
Dictionary <long, TypeMirror> types;
object types_lock = new object ();
@ -517,6 +561,24 @@ namespace Mono.Debugger.Soft
return GetObject <ThreadMirror> (id);
}
Dictionary <long, FieldInfoMirror> fields;
object fields_lock = new object ();
internal FieldInfoMirror GetField (long id) {
lock (fields_lock) {
if (fields == null)
fields = new Dictionary <long, FieldInfoMirror> ();
FieldInfoMirror obj;
if (id == 0)
return null;
if (!fields.TryGetValue (id, out obj)) {
obj = new FieldInfoMirror (this, id);
fields [id] = obj;
}
return obj;
}
}
object requests_lock = new object ();
internal void AddRequest (EventRequest req, int id) {
@ -538,6 +600,10 @@ namespace Mono.Debugger.Soft
}
internal Value DecodeValue (ValueImpl v) {
return DecodeValue (v, null);
}
internal Value DecodeValue (ValueImpl v, Dictionary<int, Value> parent_vtypes) {
if (v.Value != null)
return new PrimitiveValue (this, v.Value);
@ -553,12 +619,21 @@ namespace Mono.Debugger.Soft
case ElementType.Object:
return GetObject (v.Objid);
case ElementType.ValueType:
if (parent_vtypes == null)
parent_vtypes = new Dictionary<int, Value> ();
StructMirror vtype;
if (v.IsEnum)
return new EnumMirror (this, GetType (v.Klass), DecodeValues (v.Fields));
vtype = new EnumMirror (this, GetType (v.Klass), (Value[])null);
else
return new StructMirror (this, GetType (v.Klass), DecodeValues (v.Fields));
vtype = new StructMirror (this, GetType (v.Klass), (Value[])null);
parent_vtypes [parent_vtypes.Count] = vtype;
vtype.SetFields (DecodeValues (v.Fields, parent_vtypes));
parent_vtypes.Remove (parent_vtypes.Count - 1);
return vtype;
case (ElementType)ValueTypeId.VALUE_TYPE_ID_NULL:
return new PrimitiveValue (this, null);
case (ElementType)ValueTypeId.VALUE_TYPE_ID_PARENT_VTYPE:
return parent_vtypes [v.Index];
default:
throw new NotImplementedException ("" + v.Type);
}
@ -571,6 +646,13 @@ namespace Mono.Debugger.Soft
return res;
}
internal Value[] DecodeValues (ValueImpl[] values, Dictionary<int, Value> parent_vtypes) {
Value[] res = new Value [values.Length];
for (int i = 0; i < values.Length; ++i)
res [i] = DecodeValue (values [i], parent_vtypes);
return res;
}
internal ValueImpl EncodeValue (Value v) {
if (v is PrimitiveValue) {
object val = (v as PrimitiveValue).Value;
@ -620,21 +702,25 @@ namespace Mono.Debugger.Soft
switch (ei.EventType) {
case EventType.VMStart:
vm.notify_vm_event (EventType.VMStart, suspend_policy, req_id, thread_id, null);
vm.notify_vm_event (EventType.VMStart, suspend_policy, req_id, thread_id, null, 0);
break;
case EventType.VMDeath:
vm.notify_vm_event (EventType.VMDeath, suspend_policy, req_id, thread_id, null);
vm.notify_vm_event (EventType.VMDeath, suspend_policy, req_id, thread_id, null, ei.ExitCode);
break;
case EventType.ThreadStart:
vm.InvalidateThreadCache ();
l.Add (new ThreadStartEvent (vm, req_id, id));
break;
case EventType.ThreadDeath:
vm.InvalidateThreadCache ();
l.Add (new ThreadDeathEvent (vm, req_id, id));
break;
case EventType.AssemblyLoad:
vm.InvalidateAssemblyCaches ();
l.Add (new AssemblyLoadEvent (vm, req_id, thread_id, id));
break;
case EventType.AssemblyUnload:
vm.InvalidateAssemblyCaches ();
l.Add (new AssemblyUnloadEvent (vm, req_id, thread_id, id));
break;
case EventType.TypeLoad:
@ -667,8 +753,6 @@ namespace Mono.Debugger.Soft
case EventType.UserLog:
l.Add (new UserLogEvent (vm, req_id, thread_id, ei.Level, ei.Category, ei.Message));
break;
default:
break;
}
}
@ -677,7 +761,7 @@ namespace Mono.Debugger.Soft
}
public void VMDisconnect (int req_id, long thread_id, string vm_uri) {
vm.notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, req_id, thread_id, vm_uri);
vm.notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, req_id, thread_id, vm_uri, 0);
}
}

Просмотреть файл

@ -93,7 +93,8 @@ namespace Mono.Debugger.Soft
if (options != null && options.Valgrind)
info.FileName = "valgrind";
info.UseShellExecute = false;
ITargetProcess p;
if (options != null && options.CustomProcessLauncher != null)
p = new ProcessWrapper (options.CustomProcessLauncher (info));

Просмотреть файл

@ -1 +1 @@
f39dc2adcde0f67de0079c883d3ea691b2b29e82
eab18c98cb7c5826b886d7e260baa672489cfce1

13
external/debugger-libs/Mono.Debugger.Soft/sync.sh поставляемый Executable file
Просмотреть файл

@ -0,0 +1,13 @@
#!/bin/bash
if [ -d ../../../../../mono ]; then
MONO_DIR=../../../../../mono
else
MONO_DIR=../mono
fi
/bin/cp -f $MONO_DIR/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/*.cs Mono.Debugger.Soft/
cd $MONO_DIR
revision=`git log | head -1 | awk '{print $2}'`
cd - > /dev/null
echo $revision > mono-git-revision

Просмотреть файл

@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
using System.Linq;
using Mono.Debugging.Evaluation;
using Mono.Debugger.Soft;
@ -53,7 +54,13 @@ namespace Mono.Debugging.Soft
public object GetElement (int[] indices)
{
int i = GetIndex (indices);
return array.GetValues (i, 1) [0];
return array.GetValues (i, 1)[0];
}
public Array GetElements (int[] indices, int count)
{
int i = GetIndex (indices);
return array.GetValues (i, count).ToArray ();
}
public void SetElement (int[] indices, object val)

Просмотреть файл

@ -0,0 +1,66 @@
//
// FieldReferenceBatch.cs
//
// Authors: David Karlaš <david.karlas@xamarin.com>
//
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using Mono.Debugger.Soft;
using System.Collections.Generic;
namespace Mono.Debugging.Soft
{
public class FieldReferenceBatch
{
readonly object locker = new object ();
readonly object obj;
List<FieldInfoMirror> fields = new List<FieldInfoMirror> ();
object[] results;
public FieldReferenceBatch (object obj)
{
this.obj = obj;
}
public void Add (FieldInfoMirror fieldVal)
{
lock (locker) {
fields.Add (fieldVal);
}
}
public object GetValue (FieldInfoMirror field)
{
lock (locker) {
if (results == null || fields.Count != results.Length)
results = ((ObjectMirror)obj).GetValues (fields);
return results [fields.IndexOf (field)];
}
}
public void Invalidate ()
{
lock (locker) {
results = null;
}
}
}
}

Просмотреть файл

@ -33,30 +33,49 @@ using Mono.Debugging.Client;
namespace Mono.Debugging.Soft
{
public class FieldValueReference: ValueReference
public class FieldValueReference: SoftValueReference
{
FieldInfoMirror field;
object obj;
TypeMirror declaringType;
ObjectValueFlags flags;
string vname;
FieldReferenceBatch batch;
public FieldValueReference (EvaluationContext ctx, FieldInfoMirror field, object obj, TypeMirror declaringType)
: this (ctx, field, obj, declaringType, null, ObjectValueFlags.Field)
public FieldValueReference (EvaluationContext ctx, FieldInfoMirror field, object obj, TypeMirror declaringType, FieldReferenceBatch batch = null)
: this (ctx, field, obj, declaringType, null, ObjectValueFlags.Field, batch)
{
}
public FieldValueReference (EvaluationContext ctx, FieldInfoMirror field, object obj, TypeMirror declaringType, string vname, ObjectValueFlags vflags): base (ctx)
public FieldValueReference (EvaluationContext ctx, FieldInfoMirror field, object obj, TypeMirror declaringType, string vname, ObjectValueFlags vflags, FieldReferenceBatch batch = null): base (ctx)
{
this.field = field;
this.obj = obj;
this.declaringType = declaringType;
this.vname = vname;
this.batch = batch;
flags = vflags;
if (field.IsStatic) {
flags |= ObjectValueFlags.Global;
if (field.IsStatic)
this.obj = null;
}
var objectMirror = obj as ObjectMirror;
if (objectMirror != null)
EnsureContextHasDomain (objectMirror.Domain);
flags |= GetFlags (field);
if (obj is PrimitiveValue)
flags |= ObjectValueFlags.ReadOnly;
}
internal static ObjectValueFlags GetFlags (FieldInfoMirror field)
{
var flags = ObjectValueFlags.Field;
if (field.IsStatic)
flags |= ObjectValueFlags.Global;
if (field.IsPublic)
flags |= ObjectValueFlags.Public;
else if (field.IsPrivate)
@ -67,8 +86,8 @@ namespace Mono.Debugging.Soft
flags |= ObjectValueFlags.Internal;
else if (field.IsFamilyOrAssembly)
flags |= ObjectValueFlags.InternalProtected;
if (obj is PrimitiveValue)
flags |= ObjectValueFlags.ReadOnly;
return flags;
}
public override ObjectValueFlags Flags {
@ -103,6 +122,8 @@ namespace Mono.Debugging.Soft
return declaringType.GetValue (field);
} else if (obj is ObjectMirror) {
if (batch != null)
return batch.GetValue (field);
return ((ObjectMirror)obj).GetValue (field);
} else if (obj is StructMirror) {
StructMirror sm = (StructMirror)obj;
@ -131,8 +152,11 @@ namespace Mono.Debugging.Soft
set {
if (obj == null)
declaringType.SetValue (field, (Value)value);
else if (obj is ObjectMirror)
else if (obj is ObjectMirror) {
if (batch != null)
batch.Invalidate ();
((ObjectMirror)obj).SetValue (field, (Value)value);
}
else if (obj is StructMirror) {
StructMirror sm = (StructMirror)obj;
int idx = 0;

Просмотреть файл

@ -0,0 +1,60 @@
//
// LocalVariableValueBatch.cs
//
// Author: Jeffrey Stedfast <jeff@xamarin.com>
//
// Copyright (c) 2014 Xamarin Inc. (www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using Mono.Debugger.Soft;
namespace Mono.Debugging.Soft
{
public class LocalVariableBatch
{
readonly LocalVariable[] variables;
readonly StackFrame frame;
Value[] values;
public LocalVariableBatch (StackFrame frame, LocalVariable[] variables)
{
this.variables = variables;
this.frame = frame;
}
public Value GetValue (LocalVariable variable)
{
if (variable == null)
throw new ArgumentNullException ("variable");
if (values == null)
values = frame.GetValues (variables);
for (int i = 0; i < variables.Length; i++) {
if (variable == variables[i])
return values[i];
}
throw new ArgumentOutOfRangeException ("variable");
}
}
}

Просмотреть файл

@ -1,71 +0,0 @@
//
// LoggingService.cs
//
// Author:
// Michael Hutchinson <mhutchinson@novell.com>
//
// Copyright (c) 2010 Novell, Inc. (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
namespace Mono.Debugging.Soft
{
/// <summary>
/// This is a simple abstraction so that MD can plug in its own logging service to handle the Mono.Debugging.Soft
/// error logging, without Mono.Debugging.Soft depending on MonoDevelop.Core.
/// In the absence of a custom logger, it writes to Console.
/// </summary>
public static class LoggingService
{
public static ICustomLogger CustomLogger { get; set; }
internal static void LogError (string message, Exception ex)
{
if (CustomLogger != null)
CustomLogger.LogError (message, ex);
else
Console.WriteLine (message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
}
internal static void LogMessage (string messageFormat, params object[] args)
{
if (CustomLogger != null)
CustomLogger.LogMessage (messageFormat, args);
else
Console.WriteLine (messageFormat, args);
}
//this is meant to show a GUI if possible
internal static void LogAndShowException (string message, Exception ex)
{
if (CustomLogger != null)
CustomLogger.LogAndShowException (message, ex);
else
LogError (message, ex);
}
}
public interface ICustomLogger
{
void LogError (string message, System.Exception ex);
void LogAndShowException (string message, System.Exception ex);
void LogMessage (string messageFormat, params object[] args);
}
}

Просмотреть файл

@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DE40756E-57F6-4AF2-B155-55E3A88CCED8}</ProjectGuid>
<OutputType>Library</OutputType>
@ -20,13 +20,18 @@
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>bin\Debug\Mono.Debugging.Soft.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>False</Optimize>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>bin\Release\Mono.Debugging.Soft.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Mono.Debugging\Mono.Debugging.csproj">
@ -60,13 +65,17 @@
<Compile Include="SoftDebuggerAdaptor.cs" />
<Compile Include="SoftDebuggerBacktrace.cs" />
<Compile Include="SoftDebuggerStartInfo.cs" />
<Compile Include="LoggingService.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="StringAdaptor.cs" />
<Compile Include="SoftValueReference.cs" />
<Compile Include="LocalVariableBatch.cs" />
<Compile Include="ThisValueReference.cs" />
<Compile Include="FieldReferenceBatch.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Mono.Posix" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

Просмотреть файл

@ -24,34 +24,47 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using Mono.Debugging.Evaluation;
using Mono.Debugger.Soft;
using Mono.Debugging.Client;
namespace Mono.Debugging.Soft
{
public class PropertyValueReference: ValueReference
public class PropertyValueReference: SoftValueReference
{
PropertyInfoMirror property;
object obj;
TypeMirror declaringType;
Value[] indexerArgs;
ObjectValueFlags flags;
MethodMirror getter;
Value[] indexerArgs;
object obj, value;
bool haveValue;
public PropertyValueReference (EvaluationContext ctx, PropertyInfoMirror property, object obj, TypeMirror declaringType, MethodMirror getter, Value[] indexerArgs): base (ctx)
{
this.property = property;
this.obj = obj;
this.declaringType = declaringType;
this.indexerArgs = indexerArgs;
flags = ObjectValueFlags.Property;
this.property = property;
this.getter = getter;
this.obj = obj;
var objectMirror = obj as ObjectMirror;
if (objectMirror != null)
EnsureContextHasDomain (objectMirror.Domain);
flags = GetFlags (property, getter);
}
internal static ObjectValueFlags GetFlags (PropertyInfoMirror property, MethodMirror getter)
{
var flags = ObjectValueFlags.Property;
if (property.GetSetMethod (true) == null)
flags |= ObjectValueFlags.ReadOnly;
if (getter.IsStatic)
flags |= ObjectValueFlags.Global;
if (getter.IsPublic)
flags |= ObjectValueFlags.Public;
else if (getter.IsPrivate)
@ -62,9 +75,11 @@ namespace Mono.Debugging.Soft
flags |= ObjectValueFlags.Internal;
else if (getter.IsFamilyOrAssembly)
flags |= ObjectValueFlags.InternalProtected;
if (property.DeclaringType.IsValueType)
flags |= ObjectValueFlags.ReadOnly; // Setting property values on structs is not supported by sdb
return flags;
}
public override ObjectValueFlags Flags {
@ -93,27 +108,57 @@ namespace Mono.Debugging.Soft
public override object Value {
get {
Context.AssertTargetInvokeAllowed ();
SoftEvaluationContext ctx = (SoftEvaluationContext) Context;
return ctx.RuntimeInvoke (property.GetGetMethod (true), obj ?? declaringType, indexerArgs);
return GetValue (Context);
}
set {
Context.AssertTargetInvokeAllowed ();
SoftEvaluationContext ctx = (SoftEvaluationContext) Context;
Value[] args = new Value [indexerArgs != null ? indexerArgs.Length + 1 : 1];
if (indexerArgs != null)
indexerArgs.CopyTo (args, 0);
args [args.Length - 1] = (Value) value;
MethodMirror setter = property.GetSetMethod (true);
if (setter == null)
throw new EvaluatorException ("Property is read-only");
ctx.RuntimeInvoke (setter, obj ?? declaringType, args);
SetValue (Context, value);
}
}
public override object GetValue (EvaluationContext ctx)
{
if (!haveValue) {
value = ((SoftEvaluationContext) ctx).RuntimeInvoke (getter, obj ?? declaringType, indexerArgs);
haveValue = true;
}
return value;
}
public override void SetValue (EvaluationContext ctx, object value)
{
ctx.AssertTargetInvokeAllowed ();
var args = new Value [indexerArgs != null ? indexerArgs.Length + 1 : 1];
if (indexerArgs != null)
indexerArgs.CopyTo (args, 0);
args [args.Length - 1] = (Value) value;
var setter = property.GetSetMethod (true);
if (setter == null)
throw new EvaluatorException ("Property is read-only");
this.value = null;
haveValue = false;
((SoftEvaluationContext) ctx).RuntimeInvoke (setter, obj ?? declaringType, args);
this.value = value;
haveValue = true;
}
protected override bool CanEvaluate (EvaluationOptions options)
{
return options.AllowTargetInvoke;
if (options.AllowTargetInvoke)
return true;
try {
GetValue (Context.WithOptions (options));
return true;
} catch (ImplicitEvaluationDisabledException) {
return false;
}
}
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -51,10 +51,10 @@ namespace Mono.Debugging.Soft
public class SoftDebuggerBacktrace: BaseBacktrace
{
readonly SoftDebuggerSession session;
readonly MDB.ThreadMirror thread;
readonly int stackVersion;
MDB.StackFrame[] frames;
SoftDebuggerSession session;
MDB.ThreadMirror thread;
int stackVersion;
public SoftDebuggerBacktrace (SoftDebuggerSession session, MDB.ThreadMirror thread): base (session.Adaptor)
{

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -79,7 +79,7 @@ namespace Mono.Debugging.Soft
public abstract class SoftDebuggerStartArgs
{
public SoftDebuggerStartArgs ()
protected SoftDebuggerStartArgs ()
{
MaxConnectionAttempts = 1;
TimeBetweenConnectionAttempts = 500;
@ -100,7 +100,7 @@ namespace Mono.Debugging.Soft
public abstract class SoftDebuggerRemoteArgs : SoftDebuggerStartArgs
{
public SoftDebuggerRemoteArgs (string appName, IPAddress address, int debugPort, int outputPort)
protected SoftDebuggerRemoteArgs (string appName, IPAddress address, int debugPort, int outputPort)
{
if (address == null)
throw new ArgumentNullException ("address");

Просмотреть файл

@ -37,13 +37,15 @@ namespace Mono.Debugging.Soft
int stackVersion;
StackFrame frame;
bool sourceAvailable;
public ThreadMirror Thread { get; set; }
public AppDomainMirror Domain { get; set; }
public SoftEvaluationContext (SoftDebuggerSession session, StackFrame frame, DC.EvaluationOptions options): base (options)
{
Frame = frame;
Thread = frame.Thread;
Domain = Thread.Domain;
string method = frame.Method.Name;
if (frame.Method.DeclaringType != null)
@ -52,11 +54,7 @@ namespace Mono.Debugging.Soft
string language;
if (frame.Method != null) {
if (frame.IsNativeTransition) {
language = "Transition";
} else {
language = "Managed";
}
language = frame.IsNativeTransition ? "Transition" : "Managed";
} else {
language = "Native";
}
@ -64,7 +62,7 @@ namespace Mono.Debugging.Soft
Evaluator = session.GetEvaluator (new DC.StackFrame (frame.ILOffset, location, language, session.IsExternalCode (frame), true));
Adapter = session.Adaptor;
this.session = session;
this.stackVersion = session.StackVersion;
stackVersion = session.StackVersion;
sourceAvailable = !string.IsNullOrEmpty (frame.FileName) && System.IO.File.Exists (frame.FileName);
}
@ -104,11 +102,13 @@ namespace Mono.Debugging.Soft
public override void CopyFrom (EvaluationContext ctx)
{
base.CopyFrom (ctx);
SoftEvaluationContext other = (SoftEvaluationContext) ctx;
var other = (SoftEvaluationContext) ctx;
frame = other.frame;
stackVersion = other.stackVersion;
Thread = other.Thread;
session = other.session;
Domain = other.Domain;
}
static bool IsValueTypeOrPrimitive (TypeMirror type)
@ -125,23 +125,23 @@ namespace Mono.Debugging.Soft
{
if (values != null) {
// Some arguments may need to be boxed
ParameterInfoMirror[] mparams = method.GetParameters ();
var mparams = method.GetParameters ();
if (mparams.Length != values.Length)
throw new EvaluatorException ("Invalid number of arguments when calling: " + method.Name);
for (int n = 0; n < mparams.Length; n++) {
TypeMirror tm = mparams [n].ParameterType;
var tm = mparams[n].ParameterType;
if (tm.IsValueType || tm.IsPrimitive)
continue;
object type = Adapter.GetValueType (this, values [n]);
TypeMirror argTypeMirror = type as TypeMirror;
Type argType = type as Type;
var type = Adapter.GetValueType (this, values[n]);
var argTypeMirror = type as TypeMirror;
var argType = type as Type;
if (IsValueTypeOrPrimitive (argTypeMirror) || IsValueTypeOrPrimitive (argType)) {
// A value type being assigned to a parameter which is not a value type. The value has to be boxed.
try {
values [n] = Thread.Domain.CreateBoxedValue (values [n]);
values[n] = Thread.Domain.CreateBoxedValue (values [n]);
} catch (NotSupportedException) {
// This runtime doesn't support creating boxed values
throw new EvaluatorException ("This runtime does not support creating boxed values.");
@ -152,8 +152,8 @@ namespace Mono.Debugging.Soft
if (!method.IsStatic && method.DeclaringType.IsClass && !IsValueTypeOrPrimitive (method.DeclaringType)) {
object type = Adapter.GetValueType (this, target);
TypeMirror targetTypeMirror = type as TypeMirror;
Type targetType = type as Type;
var targetTypeMirror = type as TypeMirror;
var targetType = type as Type;
if ((target is StructMirror && ((StructMirror) target).Type != method.DeclaringType) ||
(IsValueTypeOrPrimitive (targetTypeMirror) || IsValueTypeOrPrimitive (targetType))) {
@ -166,10 +166,17 @@ namespace Mono.Debugging.Soft
}
}
}
MethodCall mc = new MethodCall (this, method, target, values);
Adapter.AsyncExecute (mc, Options.EvaluationTimeout);
return mc.ReturnValue;
try {
return method.Evaluate (target is TypeMirror ? null : (Value) target, values);
} catch (NotSupportedException) {
AssertTargetInvokeAllowed ();
var mc = new MethodCall (this, method, target, values);
Adapter.AsyncExecute (mc, Options.EvaluationTimeout);
return mc.ReturnValue;
}
}
void UpdateFrame ()

Просмотреть файл

@ -0,0 +1,25 @@
using System;
using Mono.Debugging.Evaluation;
using Mono.Debugger.Soft;
namespace Mono.Debugging.Soft
{
public abstract class SoftValueReference: ValueReference
{
public SoftValueReference (EvaluationContext ctx) : base(ctx)
{
}
protected void EnsureContextHasDomain (AppDomainMirror domain)
{
var softEvaluationContext = (SoftEvaluationContext)Context;
if (softEvaluationContext.Domain == domain)
return;
var clone = (SoftEvaluationContext)softEvaluationContext.Clone ();
clone.Domain = domain;
Context = clone;
}
}
}

Просмотреть файл

@ -23,7 +23,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using Mono.Debugging.Evaluation;
using Mono.Debugger.Soft;
@ -31,8 +30,8 @@ namespace Mono.Debugging.Soft
{
public class StringAdaptor: IStringAdaptor
{
bool atleast_2_10;
StringMirror str;
readonly bool atleast_2_10;
readonly StringMirror str;
string val;
public StringAdaptor (StringMirror str)

Просмотреть файл

@ -0,0 +1,76 @@
//
// ThisValueReference.cs
//
// Author: Jeffrey Stedfast <jeff@xamarin.com>
//
// Copyright (c) 2014 Xamarin Inc. (www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using Mono.Debugging.Evaluation;
using Mono.Debugging.Client;
using Mono.Debugger.Soft;
using StackFrame = Mono.Debugger.Soft.StackFrame;
namespace Mono.Debugging.Soft
{
public class ThisValueReference : ValueReference
{
readonly StackFrame frame;
object type;
Value value;
public ThisValueReference (EvaluationContext ctx, StackFrame frame) : base (ctx)
{
this.frame = frame;
}
public override ObjectValueFlags Flags {
get { return ObjectValueFlags.Field | ObjectValueFlags.ReadOnly; }
}
public override string Name {
get { return "this"; }
}
public override object Value {
get {
if (value == null)
value = frame.GetThis ();
return value;
}
set {
throw new NotSupportedException ();
}
}
public override object Type {
get {
if (type == null)
type = Context.Adapter.GetValueType (Context, Value);
return type;
}
}
}
}

Просмотреть файл

@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using Mono.Debugging.Evaluation;
using Mono.Debugging.Client;
using Mono.Debugger.Soft;
@ -34,13 +34,29 @@ namespace Mono.Debugging.Soft
{
public class VariableValueReference : ValueReference
{
readonly LocalVariable variable;
LocalVariableBatch batch;
Value value;
string name;
LocalVariable variable;
public VariableValueReference (EvaluationContext ctx, string name, LocalVariable variable): base (ctx)
public VariableValueReference (EvaluationContext ctx, string name, LocalVariable variable, LocalVariableBatch batch) : base (ctx)
{
this.name = name;
this.variable = variable;
this.batch = batch;
this.name = name;
}
public VariableValueReference (EvaluationContext ctx, string name, LocalVariable variable, Value value) : base (ctx)
{
this.variable = variable;
this.value = value;
this.name = name;
}
public VariableValueReference (EvaluationContext ctx, string name, LocalVariable variable) : base (ctx)
{
this.variable = variable;
this.name = name;
}
public override ObjectValueFlags Flags {
@ -61,18 +77,26 @@ namespace Mono.Debugging.Soft
}
}
Value NormalizeValue (EvaluationContext ctx, Value value)
{
if (variable.Type.IsPointer) {
long addr = (long) ((PrimitiveValue) value).Value;
return new PointerValue (value.VirtualMachine, variable.Type, addr);
}
return ctx.Adapter.IsNull (ctx, value) ? null : value;
}
public override object Value {
get {
SoftEvaluationContext ctx = (SoftEvaluationContext) Context;
var ctx = (SoftEvaluationContext) Context;
try {
var value = ctx.Frame.GetValue (variable);
if (value == null)
value = batch != null ? batch.GetValue (variable) : ctx.Frame.GetValue (variable);
if (variable.Type.IsPointer) {
long addr = (long) ((PrimitiveValue) value).Value;
value = new PointerValue (value.VirtualMachine, variable.Type, addr);
}
return value;
return NormalizeValue (ctx, value);
} catch (AbsentInformationException) {
throw new EvaluatorException ("Value not available");
} catch (ArgumentException ex) {
@ -80,8 +104,8 @@ namespace Mono.Debugging.Soft
}
}
set {
SoftEvaluationContext ctx = (SoftEvaluationContext) Context;
ctx.Frame.SetValue (variable, (Value) value);
((SoftEvaluationContext) Context).Frame.SetValue (variable, (Value) value);
this.value = (Value) value;
}
}
}

Просмотреть файл

@ -32,9 +32,9 @@ namespace Mono.Debugging.Backend
public interface IRawValueArray: IDebuggerBackendObject
{
object GetValue (int[] index);
Array GetValues (int[] index, int count);
void SetValue (int[] index, object value);
int[] Dimensions { get; }
Array ToArray ();
}
}

Просмотреть файл

@ -24,9 +24,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using Mono.Debugging.Client;
namespace Mono.Debugging.Backend
{
public interface IRawValueString: IDebuggerBackendObject
@ -35,5 +32,4 @@ namespace Mono.Debugging.Backend
string Value { get; }
int Length { get; }
}
}

Просмотреть файл

@ -33,6 +33,10 @@ namespace Mono.Debugging.Client
[Serializable]
public class BreakEvent
{
bool breakIfConditionChanges;
string conditionExpression;
string lastConditionValue;
[NonSerialized] BreakpointStore store;
[NonSerialized] bool enabled = true;
@ -71,6 +75,14 @@ namespace Mono.Debugging.Client
// this is to facilitate backward compatibility
if (hitCount > 0 && HitCountMode == HitCountMode.None)
HitCountMode = HitCountMode.GreaterThan;
s = elem.GetAttribute ("conditionExpression");
if (!string.IsNullOrEmpty (s))
conditionExpression = s;
s = elem.GetAttribute ("breakIfConditionChanges");
if (!string.IsNullOrEmpty (s) && !bool.TryParse (s, out breakIfConditionChanges))
breakIfConditionChanges = false;
}
internal virtual XmlElement ToXml (XmlDocument doc)
@ -78,7 +90,7 @@ namespace Mono.Debugging.Client
XmlElement elem = doc.CreateElement (GetType().Name);
if (!enabled)
elem.SetAttribute ("enabled", "false");
if (hitAction != HitAction.Break)
if ((hitAction & HitAction.Break) == HitAction.None)
elem.SetAttribute ("hitAction", hitAction.ToString ());
if (!string.IsNullOrEmpty (customActionId))
elem.SetAttribute ("customActionId", customActionId);
@ -88,6 +100,11 @@ namespace Mono.Debugging.Client
elem.SetAttribute ("hitCountMode", HitCountMode.ToString ());
if (hitCount > 0)
elem.SetAttribute ("hitCount", hitCount.ToString ());
if (!string.IsNullOrEmpty (conditionExpression)) {
elem.SetAttribute ("conditionExpression", conditionExpression);
if (breakIfConditionChanges)
elem.SetAttribute ("breakIfConditionChanges", "True");
}
return elem;
}
@ -285,6 +302,33 @@ namespace Mono.Debugging.Client
store = value;
}
}
public string ConditionExpression {
get {
return conditionExpression;
}
set {
conditionExpression = value;
}
}
public string LastConditionValue {
get {
return lastConditionValue;
}
set {
lastConditionValue = value;
}
}
public bool BreakIfConditionChanges {
get {
return breakIfConditionChanges;
}
set {
breakIfConditionChanges = value;
}
}
/// <summary>
/// Commits changes done in the break event properties
@ -309,6 +353,7 @@ namespace Mono.Debugging.Client
bool changed = CurrentHitCount != 0;
CurrentHitCount = 0;
lastConditionValue = null;
return changed;
}
@ -333,6 +378,8 @@ namespace Mono.Debugging.Client
customActionId = ev.customActionId;
traceExpression = ev.traceExpression;
hitCount = ev.hitCount;
breakIfConditionChanges = ev.breakIfConditionChanges;
conditionExpression = ev.conditionExpression;
}
}
}

Просмотреть файл

@ -125,13 +125,6 @@ namespace Mono.Debugging.Client
BreakEvent.NotifyUpdate ();
}
}
[Obsolete ("Use IncrementHitCount() instead")]
public void UpdateHitCount (int count)
{
BreakEvent.CurrentHitCount = count;
BreakEvent.NotifyUpdate ();
}
public void SetStatus (BreakEventStatus s, string statusMessage)
{
@ -157,7 +150,7 @@ namespace Mono.Debugging.Client
if (session.BreakpointTraceHandler != null)
session.BreakpointTraceHandler (BreakEvent, value);
else
session.OnDebuggerOutput (false, value + "\n");
session.OnTargetDebug (0, "", value + Environment.NewLine);
}
}
}

Просмотреть файл

@ -33,9 +33,6 @@ namespace Mono.Debugging.Client
[Serializable]
public class Breakpoint: BreakEvent
{
bool breakIfConditionChanges;
string conditionExpression;
string lastConditionValue;
int adjustedColumn = -1;
int adjustedLine = -1;
string fileName;
@ -66,14 +63,6 @@ namespace Mono.Debugging.Client
s = elem.GetAttribute ("column");
if (string.IsNullOrEmpty (s) || !int.TryParse (s, out column))
column = 1;
s = elem.GetAttribute ("conditionExpression");
if (!string.IsNullOrEmpty (s))
conditionExpression = s;
s = elem.GetAttribute ("breakIfConditionChanges");
if (!string.IsNullOrEmpty (s) && !bool.TryParse (s, out breakIfConditionChanges))
breakIfConditionChanges = false;
}
internal override XmlElement ToXml (XmlDocument doc)
@ -86,12 +75,6 @@ namespace Mono.Debugging.Client
elem.SetAttribute ("line", line.ToString ());
elem.SetAttribute ("column", column.ToString ());
if (!string.IsNullOrEmpty (conditionExpression)) {
elem.SetAttribute ("conditionExpression", conditionExpression);
if (breakIfConditionChanges)
elem.SetAttribute ("breakIfConditionChanges", "True");
}
return elem;
}
@ -156,7 +139,6 @@ namespace Mono.Debugging.Client
{
bool changed = base.Reset () || HasAdjustedLine || HasAdjustedColumn;
lastConditionValue = null;
adjustedColumn = -1;
adjustedLine = -1;
@ -172,42 +154,13 @@ namespace Mono.Debugging.Client
internal bool HasAdjustedLine {
get { return adjustedLine != -1; }
}
public string ConditionExpression {
get {
return conditionExpression;
}
set {
conditionExpression = value;
}
}
public string LastConditionValue {
get {
return lastConditionValue;
}
set {
lastConditionValue = value;
}
}
public bool BreakIfConditionChanges {
get {
return breakIfConditionChanges;
}
set {
breakIfConditionChanges = value;
}
}
public override void CopyFrom (BreakEvent ev)
{
base.CopyFrom (ev);
Breakpoint bp = (Breakpoint) ev;
breakIfConditionChanges = bp.breakIfConditionChanges;
conditionExpression = bp.conditionExpression;
fileName = bp.fileName;
column = bp.column;
line = bp.line;
@ -224,11 +177,13 @@ namespace Mono.Debugging.Client
MultipleOf
}
[Flags]
public enum HitAction
{
Break,
PrintExpression,
CustomAction
None = 0x0,
Break = 0x1,
PrintExpression = 0x2,
CustomAction = 0x4
}
public delegate bool BreakEventHitHandler (string actionId, BreakEvent be);

Просмотреть файл

@ -73,7 +73,7 @@ namespace Mono.Debugging.Client
return false;
}
List<BreakEvent> breakpoints = new List<BreakEvent> ();
readonly List<BreakEvent> breakpoints = new List<BreakEvent> ();
public int Count {
get {
@ -83,8 +83,8 @@ namespace Mono.Debugging.Client
public bool IsReadOnly {
get {
ReadOnlyCheckEventArgs args = new ReadOnlyCheckEventArgs ();
EventHandler<ReadOnlyCheckEventArgs> checkingReadOnly = CheckingReadOnly;
var args = new ReadOnlyCheckEventArgs ();
var checkingReadOnly = CheckingReadOnly;
if (checkingReadOnly != null)
checkingReadOnly (this, args);
return args.IsReadOnly;
@ -103,10 +103,19 @@ namespace Mono.Debugging.Client
public Breakpoint Add (string filename, int line, int column, bool activate)
{
if (filename == null)
throw new ArgumentNullException ("filename");
if (line < 1)
throw new ArgumentOutOfRangeException ("line");
if (column < 1)
throw new ArgumentOutOfRangeException ("column");
if (IsReadOnly)
return null;
Breakpoint bp = new Breakpoint (filename, line, column);
var bp = new Breakpoint (filename, line, column);
Add (bp);
return bp;
@ -119,6 +128,9 @@ namespace Mono.Debugging.Client
public bool Add (BreakEvent bp)
{
if (bp == null)
throw new ArgumentNullException ("bp");
if (IsReadOnly)
return false;
@ -131,10 +143,13 @@ namespace Mono.Debugging.Client
public Catchpoint AddCatchpoint (string exceptionName)
{
if (exceptionName == null)
throw new ArgumentNullException ("exceptionName");
if (IsReadOnly)
return null;
Catchpoint cp = new Catchpoint (exceptionName);
var cp = new Catchpoint (exceptionName);
Add (cp);
return cp;
@ -142,13 +157,17 @@ namespace Mono.Debugging.Client
public bool Remove (string filename, int line, int column)
{
if (filename == null)
throw new ArgumentNullException ("filename");
if (IsReadOnly)
return false;
filename = Path.GetFullPath (filename);
for (int n=0; n<breakpoints.Count; n++) {
Breakpoint bp = breakpoints [n] as Breakpoint;
for (int n = 0; n < breakpoints.Count; n++) {
var bp = breakpoints[n] as Breakpoint;
if (bp != null && FileNameEquals (bp.FileName, filename) &&
(bp.OriginalLine == line || bp.Line == line) &&
(bp.OriginalColumn == column || bp.Column == column)) {
@ -162,11 +181,15 @@ namespace Mono.Debugging.Client
public bool RemoveCatchpoint (string exceptionName)
{
if (exceptionName == null)
throw new ArgumentNullException ("exceptionName");
if (IsReadOnly)
return false;
for (int n=0; n<breakpoints.Count; n++) {
Catchpoint cp = breakpoints [n] as Catchpoint;
for (int n = 0; n < breakpoints.Count; n++) {
var cp = breakpoints[n] as Catchpoint;
if (cp != null && cp.ExceptionName == exceptionName) {
breakpoints.RemoveAt (n);
OnBreakEventRemoved (cp);
@ -175,9 +198,28 @@ namespace Mono.Debugging.Client
}
return true;
}
public void RemoveRunToCursorBreakpoints ()
{
if (IsReadOnly)
return;
for (int n = 0; n < breakpoints.Count; n++) {
var bp = breakpoints[n] as RunToCursorBreakpoint;
if (bp != null) {
breakpoints.RemoveAt (n);
OnBreakEventRemoved (bp);
n--;
}
}
}
public bool Remove (BreakEvent bp)
{
if (bp == null)
throw new ArgumentNullException ("bp");
if (!IsReadOnly && breakpoints.Remove (bp)) {
OnBreakEventRemoved (bp);
return true;
@ -188,10 +230,19 @@ namespace Mono.Debugging.Client
public Breakpoint Toggle (string filename, int line, int column)
{
if (filename == null)
throw new ArgumentNullException ("filename");
if (line < 1)
throw new ArgumentOutOfRangeException ("line");
if (column < 1)
throw new ArgumentOutOfRangeException ("column");
if (IsReadOnly)
return null;
ReadOnlyCollection<Breakpoint> col = GetBreakpointsAtFileLine (filename, line);
var col = GetBreakpointsAtFileLine (filename, line);
if (col.Count > 0) {
// Remove only the most-recently-added breakpoint on the specified line
Remove (col[col.Count - 1]);
@ -200,30 +251,35 @@ namespace Mono.Debugging.Client
return Add (filename, line, column);
}
public ReadOnlyCollection<BreakEvent> GetBreakevents ()
{
return breakpoints.AsReadOnly ();
}
public ReadOnlyCollection<Breakpoint> GetBreakpoints ()
{
List<Breakpoint> list = new List<Breakpoint> ();
foreach (BreakEvent be in breakpoints) {
if (be is Breakpoint)
list.Add ((Breakpoint)be);
var list = new List<Breakpoint> ();
foreach (var bp in breakpoints.OfType<Breakpoint> ()) {
if (!(bp is RunToCursorBreakpoint))
list.Add (bp);
}
return list.AsReadOnly ();
}
public ReadOnlyCollection<Catchpoint> GetCatchpoints ()
{
List<Catchpoint> list = new List<Catchpoint> ();
foreach (BreakEvent be in breakpoints) {
if (be is Catchpoint)
list.Add ((Catchpoint) be);
}
return list.AsReadOnly ();
return breakpoints.OfType<Catchpoint> ().ToList ().AsReadOnly ();
}
public ReadOnlyCollection<Breakpoint> GetBreakpointsAtFile (string filename)
{
List<Breakpoint> list = new List<Breakpoint> ();
if (filename == null)
throw new ArgumentNullException ("filename");
var list = new List<Breakpoint> ();
try {
filename = Path.GetFullPath (filename);
@ -231,9 +287,8 @@ namespace Mono.Debugging.Client
return list.AsReadOnly ();
}
foreach (BreakEvent be in breakpoints) {
Breakpoint bp = be as Breakpoint;
if (bp != null && FileNameEquals (bp.FileName, filename))
foreach (var bp in breakpoints.OfType<Breakpoint> ()) {
if (!(bp is RunToCursorBreakpoint) && FileNameEquals (bp.FileName, filename))
list.Add (bp);
}
@ -242,7 +297,10 @@ namespace Mono.Debugging.Client
public ReadOnlyCollection<Breakpoint> GetBreakpointsAtFileLine (string filename, int line)
{
List<Breakpoint> list = new List<Breakpoint> ();
if (filename == null)
throw new ArgumentNullException ("filename");
var list = new List<Breakpoint> ();
try {
filename = Path.GetFullPath (filename);
@ -250,9 +308,8 @@ namespace Mono.Debugging.Client
return list.AsReadOnly ();
}
foreach (BreakEvent be in breakpoints) {
Breakpoint bp = be as Breakpoint;
if (bp != null && FileNameEquals (bp.FileName, filename) && (bp.OriginalLine == line || bp.Line == line))
foreach (var bp in breakpoints.OfType<Breakpoint> ()) {
if (!(bp is RunToCursorBreakpoint) && FileNameEquals (bp.FileName, filename) && (bp.OriginalLine == line || bp.Line == line))
list.Add (bp);
}
@ -271,20 +328,21 @@ namespace Mono.Debugging.Client
public void Clear ()
{
List<BreakEvent> oldList = new List<BreakEvent> (breakpoints);
var oldList = new List<BreakEvent> (breakpoints);
foreach (BreakEvent bp in oldList)
Remove (bp);
}
public void ClearBreakpoints ()
{
foreach (Breakpoint bp in GetBreakpoints ())
foreach (var bp in GetBreakpoints ())
Remove (bp);
}
public void ClearCatchpoints ()
{
foreach (Catchpoint bp in GetCatchpoints ())
foreach (var bp in GetCatchpoints ())
Remove (bp);
}
@ -317,12 +375,12 @@ namespace Mono.Debugging.Client
NotifyBreakEventChanged (bp);
}
internal void ResetAdjustedBreakpoints ()
internal void ResetBreakpoints ()
{
if (IsReadOnly)
return;
foreach (Breakpoint bp in breakpoints.OfType<Breakpoint> ().ToArray ()) {
foreach (var bp in breakpoints.ToArray ()) {
if (bp.Reset ())
NotifyBreakEventChanged (bp);
}
@ -375,6 +433,12 @@ namespace Mono.Debugging.Client
public static bool FileNameEquals (string file1, string file2)
{
if (file1 == null)
return file2 == null;
if (file2 == null)
return false;
if (PathComparer.Compare (file1, file2) == 0)
return true;
@ -403,7 +467,7 @@ namespace Mono.Debugging.Client
OnChanged ();
EventHandler<BreakEventArgs> breakEventAdded = BreakEventAdded;
if (breakEventAdded != null)
breakEventAdded (this, new BreakEventArgs ((BreakEvent)be));
breakEventAdded (this, new BreakEventArgs (be));
if (be is Breakpoint) {
EventHandler<BreakpointEventArgs> breakpointAdded = BreakpointAdded;
if (breakpointAdded != null)
@ -420,7 +484,7 @@ namespace Mono.Debugging.Client
OnChanged ();
EventHandler<BreakEventArgs> breakEventRemoved = BreakEventRemoved;
if (breakEventRemoved != null)
breakEventRemoved (this, new BreakEventArgs ((BreakEvent)be));
breakEventRemoved (this, new BreakEventArgs (be));
if (be is Breakpoint) {
EventHandler<BreakpointEventArgs> breakpointRemoved = BreakpointRemoved;
if (breakpointRemoved != null)
@ -444,7 +508,7 @@ namespace Mono.Debugging.Client
try {
EventHandler<BreakEventArgs> breakEventStatusChanged = BreakEventStatusChanged;
if (breakEventStatusChanged != null)
breakEventStatusChanged (this, new BreakEventArgs ((BreakEvent)be));
breakEventStatusChanged (this, new BreakEventArgs (be));
if (be is Breakpoint) {
EventHandler<BreakpointEventArgs> breakpointStatusChanged = BreakpointStatusChanged;
if (breakpointStatusChanged != null)
@ -464,7 +528,7 @@ namespace Mono.Debugging.Client
try {
EventHandler<BreakEventArgs> breakEventModified = BreakEventModified;
if (breakEventModified != null)
breakEventModified (this, new BreakEventArgs ((BreakEvent)be));
breakEventModified (this, new BreakEventArgs (be));
if (be is Breakpoint) {
EventHandler<BreakpointEventArgs > breakpointModified = BreakpointModified;
if (breakpointModified != null)
@ -482,10 +546,11 @@ namespace Mono.Debugging.Client
internal void NotifyBreakEventUpdated (BreakEvent be)
{
try {
EventHandler<BreakEventArgs> breakEventUpdated = BreakEventUpdated;
if (breakEventUpdated != null)
breakEventUpdated (this, new BreakEventArgs ((BreakEvent)be));
breakEventUpdated (this, new BreakEventArgs (be));
if (be is Breakpoint) {
EventHandler<BreakpointEventArgs> breakpointUpdated = BreakpointUpdated;
if (breakpointUpdated != null)

Просмотреть файл

@ -34,29 +34,44 @@ namespace Mono.Debugging.Client
public class Catchpoint: BreakEvent
{
string exceptionName;
bool includeSubclasses;
public Catchpoint (string exceptionName)
public Catchpoint (string exceptionName) : this (exceptionName, true)
{
}
public Catchpoint (string exceptionName, bool includeSubclasses)
{
this.exceptionName = exceptionName;
this.includeSubclasses = includeSubclasses;
}
internal Catchpoint (XmlElement elem): base (elem)
{
exceptionName = elem.GetAttribute ("exceptionName");
var str = elem.GetAttribute ("includeSubclasses");
if (string.IsNullOrEmpty (str) || !bool.TryParse (str, out includeSubclasses)) {
// fall back to the old default behavior
includeSubclasses = true;
}
}
internal override XmlElement ToXml (XmlDocument doc)
{
XmlElement elem = base.ToXml (doc);
elem.SetAttribute ("exceptionName", exceptionName);
elem.SetAttribute ("includeSubclasses", includeSubclasses.ToString ());
return elem;
}
public string ExceptionName {
get {
return exceptionName;
}
get { return exceptionName; }
}
public bool IncludeSubclasses {
get { return includeSubclasses; }
}
public override void CopyFrom (BreakEvent ev)
@ -64,6 +79,7 @@ namespace Mono.Debugging.Client
base.CopyFrom (ev);
Catchpoint cp = (Catchpoint) ev;
exceptionName = cp.exceptionName;
includeSubclasses = cp.includeSubclasses;
}
}

Просмотреть файл

@ -0,0 +1,71 @@
//
// DebuggerLoggingService.cs
//
// Author:
// Michael Hutchinson <mhutchinson@novell.com>
//
// Copyright (c) 2010 Novell, Inc. (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
namespace Mono.Debugging.Client
{
/// <summary>
/// This is a simple abstraction so that MD can plug in its own logging service to handle the Mono.Debugging.Soft
/// error logging, without Mono.Debugging.Soft depending on MonoDevelop.Core.
/// In the absence of a custom logger, it writes to Console.
/// </summary>
public static class DebuggerLoggingService
{
public static ICustomLogger CustomLogger { get; set; }
public static void LogError (string message, Exception ex)
{
if (CustomLogger != null)
CustomLogger.LogError (message, ex);
else
Console.WriteLine (message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
}
public static void LogMessage (string messageFormat, params object[] args)
{
if (CustomLogger != null)
CustomLogger.LogMessage (messageFormat, args);
else
Console.WriteLine (messageFormat, args);
}
//this is meant to show a GUI if possible
public static void LogAndShowException (string message, Exception ex)
{
if (CustomLogger != null)
CustomLogger.LogAndShowException (message, ex);
else
LogError (message, ex);
}
}
public interface ICustomLogger
{
void LogError (string message, System.Exception ex);
void LogAndShowException (string message, System.Exception ex);
void LogMessage (string messageFormat, params object[] args);
}
}

Просмотреть файл

@ -28,16 +28,16 @@
using System;
using System.Collections.Generic;
using Mono.Debugging.Backend;
using System.Diagnostics;
using System.Threading;
using System.Collections.Generic;
using Mono.Debugging.Backend;
namespace Mono.Debugging.Client
{
public delegate void TargetEventHandler (object sender, TargetEventArgs args);
public delegate void ProcessEventHandler(int process_id);
public delegate void ThreadEventHandler(int thread_id);
public delegate void ProcessEventHandler (int processId);
public delegate void ThreadEventHandler (int threadId);
public delegate bool ExceptionHandler (Exception ex);
public delegate string TypeResolverHandler (string identifier, SourceLocation location);
public delegate void BreakpointTraceHandler (BreakEvent be, string trace);
@ -46,24 +46,18 @@ namespace Mono.Debugging.Client
public abstract class DebuggerSession: IDisposable
{
InternalDebuggerSession frontend;
Dictionary<BreakEvent,BreakEventInfo> breakpoints = new Dictionary<BreakEvent,BreakEventInfo> ();
readonly Dictionary<BreakEvent, BreakEventInfo> breakpoints = new Dictionary<BreakEvent, BreakEventInfo> ();
readonly Dictionary<string, string> resolvedExpressionCache = new Dictionary<string, string> ();
readonly InternalDebuggerSession frontend;
readonly object slock = new object ();
BreakpointStore breakpointStore;
OutputWriterDelegate outputWriter;
OutputWriterDelegate logWriter;
DebuggerSessionOptions options;
ProcessInfo[] currentProcesses;
ThreadInfo activeThread;
bool ownedBreakpointStore;
bool adjustingBreakpoints;
bool disposed;
bool attached;
bool ownedBreakpointStore;
object slock = new object ();
object olock = new object ();
ThreadInfo activeThread;
BreakEventHitHandler customBreakpointHitHandler;
ExceptionHandler exceptionHandler;
DebuggerSessionOptions options;
Dictionary<string,string> resolvedExpressionCache = new Dictionary<string, string> ();
bool adjustingBreakpoints;
ProcessInfo[] currentProcesses;
/// <summary>
/// Reports a debugger event
@ -132,7 +126,7 @@ namespace Mono.Debugging.Client
/// </summary>
public event EventHandler<BusyStateEventArgs> BusyStateChanged;
public DebuggerSession ()
protected DebuggerSession ()
{
UseOperationThread = true;
frontend = new InternalDebuggerSession (this);
@ -167,8 +161,7 @@ namespace Mono.Debugging.Client
/// in the debugged process.
/// </remarks>
public ExceptionHandler ExceptionHandler {
get { return exceptionHandler; }
set { exceptionHandler = value; }
get; set;
}
/// <summary>
@ -208,12 +201,7 @@ namespace Mono.Debugging.Client
/// continue or stop.
/// </remarks>
public BreakEventHitHandler CustomBreakEventHitHandler {
get {
return customBreakpointHitHandler;
}
set {
customBreakpointHitHandler = value;
}
get; set;
}
/// <summary>
@ -243,7 +231,7 @@ namespace Mono.Debugging.Client
breakpointStore.BreakEventModified -= OnBreakpointModified;
breakpointStore.BreakEventEnableStatusChanged -= OnBreakpointStatusChanged;
breakpointStore.CheckingReadOnly -= BreakpointStoreCheckingReadOnly;
breakpointStore.ResetAdjustedBreakpoints ();
breakpointStore.ResetBreakpoints ();
}
breakpointStore = value;
@ -252,12 +240,10 @@ namespace Mono.Debugging.Client
if (breakpointStore != null) {
if (IsConnected) {
Dispatch (delegate {
lock (slock) {
if (IsConnected) {
lock (breakpointStore) {
foreach (BreakEvent bp in breakpointStore)
AddBreakEvent (bp);
}
if (IsConnected) {
lock (breakpointStore) {
foreach (BreakEvent bp in breakpointStore)
AddBreakEvent (bp);
}
}
});
@ -271,15 +257,38 @@ namespace Mono.Debugging.Client
}
}
}
readonly Queue<Action> actionsQueue = new Queue<Action>();
void Dispatch (Action action)
{
if (UseOperationThread) {
ThreadPool.QueueUserWorkItem (delegate {
lock (slock) {
action ();
lock (actionsQueue) {
actionsQueue.Enqueue (action);
if (actionsQueue.Count == 1) {
ThreadPool.QueueUserWorkItem (delegate {
while (true) {
Action actionToExecute = null;
lock (actionsQueue) {
if (actionsQueue.Count > 0) {
actionToExecute = actionsQueue.Peek ();
} else {
return;
}
}
try {
lock (slock) {
actionToExecute ();
}
} finally {
lock (actionsQueue) {
actionsQueue.Dequeue ();
}
}
}
});
}
});
}
} else {
lock (slock) {
action ();
@ -378,11 +387,7 @@ namespace Mono.Debugging.Client
/// <c>true</c> if attached to process; otherwise, <c>false</c>.
/// </value>
public bool AttachedToProcess {
get {
lock (slock) {
return attached;
}
}
get { return attached; }
}
/// <summary>
@ -505,6 +510,47 @@ namespace Mono.Debugging.Client
});
}
}
/// <summary>
/// Sets the next statement on the active thread.
/// </summary>
/// <param name="fileName">File name.</param>
/// <param name="line">Line.</param>
/// <param name="column">Column.</param>
public void SetNextStatement (string fileName, int line, int column)
{
if (fileName == null)
throw new ArgumentNullException ("fileName");
if (fileName.Length == 0)
throw new ArgumentException ("Path cannot be empty.", "fileName");
if (line < 1)
throw new ArgumentOutOfRangeException ("line");
if (column < 1)
throw new ArgumentOutOfRangeException ("column");
if (!IsConnected || IsRunning || !CanSetNextStatement)
throw new NotSupportedException ();
OnSetNextStatement (ActiveThread.Id, fileName, line, column);
}
/// <summary>
/// Sets the next statement on the active thread.
/// </summary>
/// <param name="ilOffset">The IL offset.</param>
public void SetNextStatement (int ilOffset)
{
if (ilOffset < 0)
throw new ArgumentOutOfRangeException ("ilOffset");
if (!IsConnected || IsRunning || !CanSetNextStatement)
throw new NotSupportedException ();
OnSetNextStatement (ActiveThread.Id, ilOffset);
}
/// <summary>
/// Returns the status of a breakpoint for this debugger session.
@ -618,67 +664,47 @@ namespace Mono.Debugging.Client
void OnBreakpointAdded (object s, BreakEventArgs args)
{
lock (breakpoints) {
if (adjustingBreakpoints)
return;
}
if (adjustingBreakpoints)
return;
lock (slock) {
if (IsConnected) {
Dispatch (delegate {
lock (slock) {
if (IsConnected)
AddBreakEvent (args.BreakEvent);
}
});
}
if (IsConnected) {
Dispatch (delegate {
if (IsConnected)
AddBreakEvent (args.BreakEvent);
});
}
}
void OnBreakpointRemoved (object s, BreakEventArgs args)
{
lock (breakpoints) {
if (adjustingBreakpoints)
return;
}
if (adjustingBreakpoints)
return;
lock (slock) {
if (IsConnected) {
Dispatch (delegate {
lock (slock) {
if (IsConnected)
RemoveBreakEvent (args.BreakEvent);
}
});
}
if (IsConnected) {
Dispatch (delegate {
if (IsConnected)
RemoveBreakEvent (args.BreakEvent);
});
}
}
void OnBreakpointModified (object s, BreakEventArgs args)
{
lock (slock) {
if (IsConnected) {
Dispatch (delegate {
lock (slock) {
if (IsConnected)
UpdateBreakEvent (args.BreakEvent);
}
});
}
if (IsConnected) {
Dispatch (delegate {
if (IsConnected)
UpdateBreakEvent (args.BreakEvent);
});
}
}
void OnBreakpointStatusChanged (object s, BreakEventArgs args)
{
lock (slock) {
if (IsConnected) {
Dispatch (delegate {
lock (slock) {
if (IsConnected)
UpdateBreakEventStatus (args.BreakEvent);
}
});
}
if (IsConnected) {
Dispatch (delegate {
if (IsConnected)
UpdateBreakEventStatus (args.BreakEvent);
});
}
}
@ -797,12 +823,7 @@ namespace Mono.Debugging.Client
/// This callback is invoked to print debuggee output
/// </remarks>
public OutputWriterDelegate OutputWriter {
get { return outputWriter; }
set {
lock (olock) {
outputWriter = value;
}
}
get; set;
}
/// <summary>
@ -812,12 +833,18 @@ namespace Mono.Debugging.Client
/// This callback is invoked to print debugger log messages
/// </remarks>
public OutputWriterDelegate LogWriter {
get { return logWriter; }
set {
lock (olock) {
logWriter = value;
}
}
get; set;
}
/// <summary>
/// Gets or sets the debug writer.
/// </summary>
/// <remarks>
/// This callback is invoked to print debugge messages
/// called via System.Diagnostics.Debugger.Log
/// </remarks>
public DebugWriterDelegate DebugWriter {
get; set;
}
/// <summary>
@ -846,9 +873,6 @@ namespace Mono.Debugging.Client
public virtual string ResolveExpression (string expression, SourceLocation location)
{
if (TypeResolverHandler == null)
return expression;
string key = expression + " " + location;
string resolved;
if (!resolvedExpressionCache.TryGetValue (key, out resolved)) {
@ -896,8 +920,8 @@ namespace Mono.Debugging.Client
{
}
Mono.Debugging.Evaluation.ExpressionEvaluator defaultResolver = new Mono.Debugging.Evaluation.NRefactoryExpressionEvaluator ();
Dictionary <string, IExpressionEvaluator> evaluators = new Dictionary <string, IExpressionEvaluator> ();
readonly Mono.Debugging.Evaluation.ExpressionEvaluator defaultResolver = new Mono.Debugging.Evaluation.NRefactoryExpressionEvaluator ();
readonly Dictionary <string, IExpressionEvaluator> evaluators = new Dictionary <string, IExpressionEvaluator> ();
internal IExpressionEvaluator FindExpressionEvaluator (StackFrame frame)
{
@ -1094,9 +1118,11 @@ namespace Mono.Debugging.Client
lock (slock) {
if (!HasExited) {
IsConnected = true;
lock (breakpointStore) {
foreach (BreakEvent bp in breakpointStore)
AddBreakEvent (bp);
if (breakpointStore != null) {
lock (breakpointStore) {
foreach (BreakEvent bp in breakpointStore)
AddBreakEvent (bp);
}
}
}
}
@ -1104,17 +1130,28 @@ namespace Mono.Debugging.Client
internal protected void OnTargetOutput (bool isStderr, string text)
{
lock (olock) {
if (outputWriter != null)
outputWriter (isStderr, text);
}
var writer = OutputWriter;
if (writer != null)
writer (isStderr, text);
}
internal protected void OnDebuggerOutput (bool isStderr, string text)
{
lock (olock) {
if (logWriter != null)
logWriter (isStderr, text);
var writer = LogWriter;
if (writer != null)
writer (isStderr, text);
}
internal protected void OnTargetDebug (int level, string category, string message)
{
var writer = DebugWriter;
if (writer != null) {
writer (level, category, message);
} else {
OnDebuggerOutput (false, string.Format ("[{0}:{1}] {2}", level, category, message));
}
}
@ -1141,11 +1178,19 @@ namespace Mono.Debugging.Client
{
lock (breakpoints) {
// Make a copy of the breakpoints table since it can be modified while iterating
Dictionary<BreakEvent, BreakEventInfo> breakpointsCopy = new Dictionary<BreakEvent, BreakEventInfo> (breakpoints);
var breakpointsCopy = new Dictionary<BreakEvent, BreakEventInfo> (breakpoints);
foreach (KeyValuePair<BreakEvent, BreakEventInfo> bps in breakpointsCopy) {
Breakpoint bp = bps.Key as Breakpoint;
if (bp != null && bps.Value.Status == BreakEventStatus.NotBound) {
if (string.Compare (System.IO.Path.GetFullPath (bp.FileName), fullFilePath, System.IO.Path.DirectorySeparatorChar == '\\') == 0)
StringComparer comparer;
if (System.IO.Path.DirectorySeparatorChar == '\\')
comparer = StringComparer.InvariantCultureIgnoreCase;
else
comparer = StringComparer.InvariantCulture;
if (comparer.Compare (System.IO.Path.GetFullPath (bp.FileName), fullFilePath) == 0)
RetryEventBind (bps.Value);
}
}
@ -1189,17 +1234,20 @@ namespace Mono.Debugging.Client
/// </remarks>
internal protected void UnbindSourceFileBreakpoints (string fullFilePath)
{
List<BreakEventInfo> toUpdate = new List<BreakEventInfo> ();
var toUpdate = new List<BreakEventInfo> ();
lock (breakpoints) {
// Make a copy of the breakpoints table since it can be modified while iterating
Dictionary<BreakEvent, BreakEventInfo> breakpointsCopy = new Dictionary<BreakEvent, BreakEventInfo> (breakpoints);
var breakpointsCopy = new Dictionary<BreakEvent, BreakEventInfo> (breakpoints);
foreach (KeyValuePair<BreakEvent, BreakEventInfo> bps in breakpointsCopy) {
Breakpoint bp = bps.Key as Breakpoint;
var bp = bps.Key as Breakpoint;
if (bp != null && bps.Value.Status == BreakEventStatus.Bound) {
if (System.IO.Path.GetFullPath (bp.FileName) == fullFilePath)
toUpdate.Add (bps.Value);
}
}
foreach (BreakEventInfo be in toUpdate) {
breakpoints.Remove (be.BreakEvent);
NotifyBreakEventStatusChanged (be.BreakEvent);
@ -1215,9 +1263,9 @@ namespace Mono.Debugging.Client
Breakpoints.NotifyStatusChanged (be);
}
string GetBreakEventErrorMessage (BreakEvent be)
static string GetBreakEventErrorMessage (BreakEvent be)
{
Breakpoint bp = be as Breakpoint;
var bp = be as Breakpoint;
if (bp != null)
return string.Format ("Could not insert breakpoint at '{0}:{1}'", bp.FileName, bp.Line);
Catchpoint cp = (Catchpoint) be;
@ -1239,20 +1287,22 @@ namespace Mono.Debugging.Client
/// </remarks>
protected virtual bool HandleException (Exception ex)
{
if (exceptionHandler != null)
return exceptionHandler (ex);
if (ExceptionHandler != null)
return ExceptionHandler (ex);
return false;
}
internal void AdjustBreakpointLocation (Breakpoint b, int newLine, int newColumn)
{
lock (breakpoints) {
try {
adjustingBreakpoints = true;
Breakpoints.AdjustBreakpointLine (b, newLine, newColumn);
} finally {
adjustingBreakpoints = false;
lock (slock) {
lock (breakpoints) {
try {
adjustingBreakpoints = true;
Breakpoints.AdjustBreakpointLine (b, newLine, newColumn);
} finally {
adjustingBreakpoints = false;
}
}
}
}
@ -1334,7 +1384,7 @@ namespace Mono.Debugging.Client
protected abstract void OnStepInstruction ();
/// <summary>
// Called to step one instruction, but step over method calls
/// Called to step one instruction, but step over method calls
/// </summary>
/// <remarks>
/// This method can only be called when the debuggee is stopped by the debugger
@ -1356,6 +1406,39 @@ namespace Mono.Debugging.Client
/// This method can only be called when the debuggee is stopped by the debugger
/// </remarks>
protected abstract void OnContinue ();
/// <summary>
/// Checks whether or not the debugger supports setting the next statement to use when the debugger is resumed.
/// </summary>
/// <remarks>
/// This method is generally used to determine whether or not UI menu items should be shown.
/// </remarks>
/// <value><c>true</c> if the debugger supports setting the next statement to use when the debugger is resumed; otherwise, <c>false</c>.</value>
public virtual bool CanSetNextStatement {
get { return false; }
}
/// <summary>
/// Sets the next statement to be executed when the debugger is resumed.
/// </summary>
/// <remarks>
/// This method can only be called when the debuggee is stopped by the debugger.
/// </remarks>
protected virtual void OnSetNextStatement (long threadId, string fileName, int line, int column)
{
throw new NotSupportedException ();
}
/// <summary>
/// Sets the next statement to be executed when the debugger is resumed.
/// </summary>
/// <remarks>
/// This method can only be called when the debuggee is stopped by the debugger.
/// </remarks>
protected virtual void OnSetNextStatement (long threadId, int ilOffset)
{
throw new NotSupportedException ();
}
//breakpoints etc
@ -1494,11 +1577,25 @@ namespace Mono.Debugging.Client
return frontend;
}
}
protected virtual void OnFetchFrames (ThreadInfo[] threads)
{
}
/// <summary>
/// Calling this method is optional.
/// It's usefull to call this method so underlying debugger can optimize speed of fetching multiple frames on <paramref name="threads"/>.
/// </summary>
/// <param name="threads">Array of threads to fetch frames.</param>
public void FetchFrames (ThreadInfo[] threads)
{
OnFetchFrames (threads);
}
}
class InternalDebuggerSession: IDebuggerSessionFrontend
{
DebuggerSession session;
readonly DebuggerSession session;
public InternalDebuggerSession (DebuggerSession session)
{
@ -1542,6 +1639,7 @@ namespace Mono.Debugging.Client
}
public delegate void OutputWriterDelegate (bool isStderr, string text);
public delegate void DebugWriterDelegate (int level, string category, string message);
public class BusyStateEventArgs: EventArgs
{

Просмотреть файл

@ -47,7 +47,6 @@ namespace Mono.Debugging.Client
ops.FlattenHierarchy = true;
ops.GroupPrivateMembers = true;
ops.GroupStaticMembers = true;
ops.GroupUserPrivateMembers = false;
ops.UseExternalTypeResolver = true;
ops.IntegerDisplayFormat = IntegerDisplayFormat.Decimal;
ops.CurrentExceptionTag = "$exception";
@ -93,16 +92,10 @@ namespace Mono.Debugging.Client
public bool FlattenHierarchy { get; set; }
public bool GroupPrivateMembers { get; set; }
[Obsolete ("I don't see a point in even having this property")]
public bool GroupUserPrivateMembers { get; set; }
public bool GroupStaticMembers { get; set; }
public bool UseExternalTypeResolver { get; set; }
[Obsolete ("Use the type's BeforeFieldInit attribute instead")]
public bool AllowImplicitTypeLoading { get { return true; } set { } }
public IntegerDisplayFormat IntegerDisplayFormat { get; set; }

Просмотреть файл

@ -41,6 +41,9 @@ namespace Mono.Debugging.Client
[NonSerialized]
ExceptionInfo innerException;
[NonSerialized]
ObjectValue instance;
/// <summary>
/// The provided value can have the following members:
@ -51,7 +54,7 @@ namespace Mono.Debugging.Client
/// Value of the object: display text of the frame
/// File: name of the file
/// Line: line
/// Col: column
/// Column: column
/// InnerException: inner exception, following the same format described above.
/// </summary>
public ExceptionInfo (ObjectValue exception)
@ -107,7 +110,10 @@ namespace Mono.Debugging.Client
public ObjectValue Instance {
get {
return exception.GetChild ("Instance");
if (instance == null)
instance = exception.GetChild ("Instance");
return instance;
}
}
@ -120,8 +126,8 @@ namespace Mono.Debugging.Client
ObjectValue stackTrace = exception.GetChild ("StackTrace");
if (stackTrace != null)
return stackTrace.IsEvaluating;
else
return false;
return false;
}
}
@ -130,7 +136,7 @@ namespace Mono.Debugging.Client
if (frames != null)
return frames;
ObjectValue stackTrace = exception.GetChild ("StackTrace");
var stackTrace = exception.GetChild ("StackTrace");
if (stackTrace == null)
return frames = new ExceptionStackFrame [0];
@ -139,10 +145,13 @@ namespace Mono.Debugging.Client
stackTrace.ValueChanged += HandleExceptionValueChanged;
return frames;
}
List<ExceptionStackFrame> list = new List<ExceptionStackFrame> ();
foreach (ObjectValue val in stackTrace.GetAllChildren ())
var list = new List<ExceptionStackFrame> ();
foreach (var val in stackTrace.GetAllChildren ())
list.Add (new ExceptionStackFrame (val));
frames = list.ToArray ();
return frames;
}
}
@ -178,6 +187,7 @@ namespace Mono.Debugging.Client
StringBuilder sb = new StringBuilder ();
var chain = new List<ExceptionInfo> ();
ExceptionInfo e = this;
while (e != null) {
chain.Insert (0, e);
if (sb.Length > 0)
@ -185,31 +195,40 @@ namespace Mono.Debugging.Client
sb.Append (e.Type).Append (": ").Append (e.Message);
e = e.InnerException;
}
sb.AppendLine ();
foreach (var ex in chain) {
if (ex != chain[0])
sb.AppendLine (" --- End of inner exception stack trace ---");
foreach (var f in ex.StackTrace) {
sb.Append (" at ").Append (f.DisplayText);
if (!string.IsNullOrEmpty (f.File))
sb.Append (" in ").Append (f.File).Append (":").Append (f.Line);
foreach (var frame in ex.StackTrace) {
sb.Append (" at ").Append (frame.DisplayText);
if (!string.IsNullOrEmpty (frame.File)) {
sb.Append (" in ").Append (frame.File).Append (':').Append (frame.Line);
if (frame.Column != 0)
sb.Append (',').Append (frame.Column);
}
sb.AppendLine ();
}
}
return sb.ToString ();
}
}
public class ExceptionStackFrame
{
ObjectValue frame;
readonly ObjectValue frame;
/// <summary>
/// The provided value must have a specific structure.
/// The Value property is the display text.
/// A child "File" member must be the name of the file.
/// A child "Line" member must be the line.
/// A child "Col" member must be the column.
/// A child "Column" member must be the column.
/// </summary>
public ExceptionStackFrame (ObjectValue value)
{

Просмотреть файл

@ -27,10 +27,10 @@
//
using System;
using System.Text;
using Mono.Debugging.Backend;
using System.Collections.Generic;
using System.Threading;
using System.Collections.Generic;
using Mono.Debugging.Backend;
namespace Mono.Debugging.Client
{
@ -51,6 +51,9 @@ namespace Mono.Debugging.Client
List<ObjectValue> children;
ManualResetEvent evaluatedEvent;
[NonSerialized]
readonly object mutex = new object ();
[NonSerialized]
UpdateCallback updateCallback;
@ -62,11 +65,11 @@ namespace Mono.Debugging.Client
static ObjectValue Create (IObjectValueSource source, ObjectPath path, string typeName)
{
ObjectValue ob = new ObjectValue ();
ob.source = source;
ob.path = path;
ob.typeName = typeName;
return ob;
var val = new ObjectValue ();
val.typeName = typeName;
val.source = source;
val.path = path;
return val;
}
public static ObjectValue CreateObject (IObjectValueSource source, ObjectPath path, string typeName, string value, ObjectValueFlags flags, ObjectValue[] children)
@ -76,16 +79,18 @@ namespace Mono.Debugging.Client
public static ObjectValue CreateObject (IObjectValueSource source, ObjectPath path, string typeName, EvaluationResult value, ObjectValueFlags flags, ObjectValue[] children)
{
ObjectValue ob = Create (source, path, typeName);
ob.path = path;
ob.flags = flags | ObjectValueFlags.Object;
ob.value = value.Value;
ob.displayValue = value.DisplayValue;
var val = Create (source, path, typeName);
val.flags = flags | ObjectValueFlags.Object;
val.displayValue = value.DisplayValue;
val.value = value.Value;
val.path = path;
if (children != null) {
ob.children = new List<ObjectValue> ();
ob.children.AddRange (children);
val.children = new List<ObjectValue> ();
val.children.AddRange (children);
}
return ob;
return val;
}
public static ObjectValue CreateNullObject (IObjectValueSource source, string name, string typeName, ObjectValueFlags flags)
@ -95,40 +100,42 @@ namespace Mono.Debugging.Client
public static ObjectValue CreateNullObject (IObjectValueSource source, ObjectPath path, string typeName, ObjectValueFlags flags)
{
ObjectValue ob = Create (source, path, typeName);
ob.flags = flags | ObjectValueFlags.Object;
ob.value = "(null)";
ob.isNull = true;
return ob;
var val = Create (source, path, typeName);
val.flags = flags | ObjectValueFlags.Object;
val.value = "(null)";
val.isNull = true;
return val;
}
public static ObjectValue CreatePrimitive (IObjectValueSource source, ObjectPath path, string typeName, EvaluationResult value, ObjectValueFlags flags)
{
ObjectValue ob = Create (source, path, typeName);
ob.flags = flags | ObjectValueFlags.Primitive;
ob.value = value.Value;
ob.displayValue = value.DisplayValue;
return ob;
var val = Create (source, path, typeName);
val.flags = flags | ObjectValueFlags.Primitive;
val.displayValue = value.DisplayValue;
val.value = value.Value;
return val;
}
public static ObjectValue CreateArray (IObjectValueSource source, ObjectPath path, string typeName, int arrayCount, ObjectValueFlags flags, ObjectValue[] children)
{
ObjectValue ob = Create (source, path, typeName);
ob.arrayCount = arrayCount;
ob.flags = flags | ObjectValueFlags.Array;
ob.value = "[" + arrayCount + "]";
var val = Create (source, path, typeName);
val.flags = flags | ObjectValueFlags.Array;
val.value = "[" + arrayCount + "]";
val.arrayCount = arrayCount;
if (children != null && children.Length > 0) {
ob.children = new List<ObjectValue> ();
ob.children.AddRange (children);
val.children = new List<ObjectValue> ();
val.children.AddRange (children);
}
return ob;
return val;
}
public static ObjectValue CreateUnknown (IObjectValueSource source, ObjectPath path, string typeName)
{
ObjectValue ob = Create (source, path, typeName);
ob.flags = ObjectValueFlags.Unknown | ObjectValueFlags.ReadOnly;
return ob;
var val = Create (source, path, typeName);
val.flags = ObjectValueFlags.Unknown | ObjectValueFlags.ReadOnly;
return val;
}
public static ObjectValue CreateUnknown (string name)
@ -138,10 +145,10 @@ namespace Mono.Debugging.Client
public static ObjectValue CreateError (IObjectValueSource source, ObjectPath path, string typeName, string value, ObjectValueFlags flags)
{
ObjectValue ob = Create (source, path, typeName);
ob.flags = flags | ObjectValueFlags.Error;
ob.value = value;
return ob;
var val = Create (source, path, typeName);
val.flags = flags | ObjectValueFlags.Error;
val.value = value;
return val;
}
public static ObjectValue CreateImplicitNotSupported (IObjectValueSource source, ObjectPath path, string typeName, ObjectValueFlags flags)
@ -151,28 +158,28 @@ namespace Mono.Debugging.Client
public static ObjectValue CreateNotSupported (IObjectValueSource source, ObjectPath path, string typeName, string message, ObjectValueFlags flags)
{
ObjectValue ob = Create (source, path, typeName);
ob.flags = flags | ObjectValueFlags.NotSupported;
ob.value = message;
return ob;
var val = Create (source, path, typeName);
val.flags = flags | ObjectValueFlags.NotSupported;
val.value = message;
return val;
}
public static ObjectValue CreateFatalError (string name, string message, ObjectValueFlags flags)
{
ObjectValue ob = new ObjectValue ();
ob.flags = flags | ObjectValueFlags.Error;
ob.value = message;
ob.name = name;
return ob;
var val = new ObjectValue ();
val.flags = flags | ObjectValueFlags.Error;
val.value = message;
val.name = name;
return val;
}
public static ObjectValue CreateEvaluating (IObjectValueUpdater updater, ObjectPath path, ObjectValueFlags flags)
{
ObjectValue ob = Create (null, path, null);
ob.updater = updater;
ob.path = path;
ob.flags = flags | ObjectValueFlags.Evaluating;
return ob;
var val = Create (null, path, null);
val.flags = flags | ObjectValueFlags.Evaluating;
val.updater = updater;
val.path = path;
return val;
}
/// <summary>
@ -186,15 +193,8 @@ namespace Mono.Debugging.Client
/// Name of the value (for example, the property name)
/// </summary>
public string Name {
get {
if (name == null)
return path [path.Length - 1];
return name;
}
set {
name = value;
}
get { return name ?? path[path.Length - 1]; }
set { name = value; }
}
/// <summary>
@ -222,6 +222,7 @@ namespace Mono.Debugging.Client
set {
if (IsReadOnly || source == null)
throw new InvalidOperationException ("Value is not editable");
EvaluationResult res = source.SetValue (path, value, null);
if (res != null) {
this.value = res.Value;
@ -375,10 +376,11 @@ namespace Mono.Debugging.Client
get {
if (childSelector != null)
return childSelector;
if ((flags & ObjectValueFlags.ArrayElement) != 0)
return Name;
else
return "." + Name;
return "." + Name;
}
set { childSelector = value; }
}
@ -397,14 +399,13 @@ namespace Mono.Debugging.Client
return false;
if (children != null)
return children.Count > 0;
else if (source == null)
if (source == null)
return false;
else if (IsArray)
if (IsArray)
return arrayCount > 0;
else if (IsObject)
if (IsObject)
return true;
else
return false;
return false;
}
}
@ -553,23 +554,30 @@ namespace Mono.Debugging.Client
{
if (!IsArray)
throw new InvalidOperationException ("Object is not an array.");
if (index >= arrayCount || index < 0 || IsEvaluating)
throw new IndexOutOfRangeException ();
if (children == null)
children = new List<ObjectValue> ();
if (index >= children.Count) {
int nc = (index + 50);
if (nc > arrayCount) nc = arrayCount;
if (nc > arrayCount)
nc = arrayCount;
nc = nc - children.Count;
try {
ObjectValue[] items = source.GetChildren (path, children.Count, nc, options);
var items = source.GetChildren (path, children.Count, nc, options);
ConnectCallbacks (parentFrame, items);
children.AddRange (items);
} catch (Exception ex) {
return CreateFatalError ("", ex.Message, ObjectValueFlags.ArrayElement | ObjectValueFlags.ReadOnly);
}
}
return children [index];
}
@ -583,12 +591,18 @@ namespace Mono.Debugging.Client
get {
if (!IsArray)
throw new InvalidOperationException ("Object is not an array.");
if (IsEvaluating)
return 0;
return arrayCount;
}
}
public bool IsNull {
get { return isNull; }
}
public bool IsReadOnly {
get { return HasFlag (ObjectValueFlags.ReadOnly); }
}
@ -636,7 +650,7 @@ namespace Mono.Debugging.Client
public event EventHandler ValueChanged {
add {
lock (this) {
lock (mutex) {
if (IsEvaluating)
valueChanged += value;
else
@ -644,7 +658,7 @@ namespace Mono.Debugging.Client
}
}
remove {
lock (this) {
lock (mutex) {
valueChanged -= value;
}
}
@ -671,7 +685,8 @@ namespace Mono.Debugging.Client
{
if (!CanRefresh)
return;
ObjectValue val = source.GetValue (path, options);
var val = source.GetValue (path, options);
UpdateFrom (val, false);
}
@ -683,7 +698,7 @@ namespace Mono.Debugging.Client
/// </value>
public WaitHandle WaitHandle {
get {
lock (this) {
lock (mutex) {
if (evaluatedEvent == null)
evaluatedEvent = new ManualResetEvent (!IsEvaluating);
return evaluatedEvent;
@ -697,7 +712,7 @@ namespace Mono.Debugging.Client
internal void UpdateFrom (ObjectValue val, bool notify)
{
lock (this) {
lock (mutex) {
arrayCount = val.arrayCount;
if (val.name != null)
name = val.name;
@ -737,29 +752,35 @@ namespace Mono.Debugging.Client
internal static void ConnectCallbacks (StackFrame parentFrame, params ObjectValue[] values)
{
Dictionary<IObjectValueUpdater, List<UpdateCallback>> callbacks = null;
List<ObjectValue> valueList = new List<ObjectValue> (values);
for (int n=0; n<valueList.Count; n++) {
ObjectValue val = valueList [n];
var valueList = new List<ObjectValue> (values);
for (int n = 0; n < valueList.Count; n++) {
var val = valueList [n];
val.source = parentFrame.DebuggerSession.WrapDebuggerObject (val.source);
val.updater = parentFrame.DebuggerSession.WrapDebuggerObject (val.updater);
val.parentFrame = parentFrame;
UpdateCallback cb = val.GetUpdateCallback ();
if (cb != null) {
if (callbacks == null)
callbacks = new Dictionary<IObjectValueUpdater, List<UpdateCallback>> ();
List<UpdateCallback> list;
if (!callbacks.TryGetValue (val.Updater, out list)) {
list = new List<UpdateCallback> ();
callbacks [val.Updater] = list;
}
list.Add (cb);
}
if (val.children != null)
valueList.AddRange (val.children);
}
if (callbacks != null) {
// Do the callback connection in a background thread
System.Threading.ThreadPool.QueueUserWorkItem (delegate {
ThreadPool.QueueUserWorkItem (delegate {
foreach (KeyValuePair<IObjectValueUpdater, List<UpdateCallback>> cbs in callbacks) {
cbs.Key.RegisterUpdateCallbacks (cbs.Value.ToArray ());
}
@ -770,11 +791,12 @@ namespace Mono.Debugging.Client
class UpdateCallbackProxy: MarshalByRefObject, IObjectValueUpdateCallback
{
WeakReference valRef;
readonly WeakReference valRef;
public void UpdateValue (ObjectValue newValue)
{
ObjectValue val = valRef.Target as ObjectValue;
var val = valRef.Target as ObjectValue;
if (val != null)
val.UpdateFrom (newValue, true);
}

Просмотреть файл

@ -169,6 +169,21 @@ namespace Mono.Debugging.Client
source.SetValue (new int[] { index }, value);
}
}
/// <summary>
/// Gets the values.
/// </summary>
/// <returns>The items.</returns>
/// <param name="index">The index.</param>
/// <param name="count">The number of items to get.</param>
/// <remarks>
/// This method is useful for incrementally fetching an array in order to avoid
/// long waiting periods when the array is too large for ToArray().
/// </remarks>
public Array GetValues (int index, int count)
{
return source.GetValues (new int[] { index }, count);
}
/// <summary>
/// Returns an array with all items of the RawValueArray
@ -222,7 +237,7 @@ namespace Mono.Debugging.Client
}
internal IRawValueString Source {
get { return this.source; }
get { return source; }
}
/// <summary>
@ -257,7 +272,7 @@ namespace Mono.Debugging.Client
}
}
internal interface IRawObject
interface IRawObject
{
void Connect (DebuggerSession session, EvaluationOptions options);
}

Просмотреть файл

@ -0,0 +1,34 @@
//
// RunToCursorBreakpoint.cs
//
// Author: Jeffrey Stedfast <jeff@xamarin.com>
//
// Copyright (c) 2014 Xamarin Inc. (www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
namespace Mono.Debugging.Client
{
public sealed class RunToCursorBreakpoint : Breakpoint
{
public RunToCursorBreakpoint (string fileName, int line, int column) : base (fileName, line, column)
{
}
}
}

Просмотреть файл

@ -1,6 +1,5 @@
using System;
using Mono.Debugging.Backend;
using System.Collections.Generic;
namespace Mono.Debugging.Client
{
@ -39,19 +38,21 @@ namespace Mono.Debugging.Client
: this (address, addressSpace, location, language, isExternalCode, hasDebugInfo, false, fullModuleName, fullTypeName)
{
}
[Obsolete]
public StackFrame (long address, string addressSpace, SourceLocation location, string language)
: this (address, addressSpace, location, language, string.IsNullOrEmpty (location.FileName), true, "", "")
{
}
[Obsolete]
public StackFrame (long address, string addressSpace, string module, string method, string filename, int line, string language)
: this (address, addressSpace, new SourceLocation (method, filename, line), language)
{
}
public StackFrame (long address, SourceLocation location, string language, bool isExternalCode, bool hasDebugInfo)
: this (address, "", location, language, string.IsNullOrEmpty (location.FileName), true, "", "")
: this (address, "", location, language, string.IsNullOrEmpty (location.FileName) || isExternalCode, hasDebugInfo, "", "")
{
}
@ -60,22 +61,20 @@ namespace Mono.Debugging.Client
{
}
internal void Attach (DebuggerSession session)
internal void Attach (DebuggerSession debugSession)
{
this.session = session;
session = debugSession;
}
public DebuggerSession DebuggerSession {
get { return session; }
}
public SourceLocation SourceLocation
{
public SourceLocation SourceLocation {
get { return location; }
}
public long Address
{
public long Address {
get { return address; }
}
@ -88,15 +87,13 @@ namespace Mono.Debugging.Client
set { sourceBacktrace = value; }
}
internal int Index {
public int Index {
get { return index; }
set { index = value; }
internal set { index = value; }
}
public string Language {
get {
return language;
}
get { return language; }
}
public bool IsExternalCode {
@ -108,15 +105,15 @@ namespace Mono.Debugging.Client
}
public bool HasDebugInfo {
get { return this.hasDebugInfo; }
get { return hasDebugInfo; }
}
public string FullModuleName {
get { return this.fullModuleName; }
get { return fullModuleName; }
}
public string FullTypeName {
get { return this.fullTypeName; }
get { return fullTypeName; }
}
public ObjectValue[] GetLocalVariables ()
@ -128,7 +125,8 @@ namespace Mono.Debugging.Client
{
if (!hasDebugInfo)
return new ObjectValue [0];
ObjectValue[] values = sourceBacktrace.GetLocalVariables (index, options);
var values = sourceBacktrace.GetLocalVariables (index, options);
ObjectValue.ConnectCallbacks (this, values);
return values;
}
@ -142,7 +140,8 @@ namespace Mono.Debugging.Client
{
if (!hasDebugInfo)
return new ObjectValue [0];
ObjectValue[] values = sourceBacktrace.GetParameters (index, options);
var values = sourceBacktrace.GetParameters (index, options);
ObjectValue.ConnectCallbacks (this, values);
return values;
}
@ -151,17 +150,18 @@ namespace Mono.Debugging.Client
{
if (!hasDebugInfo)
return new ObjectValue [0];
IExpressionEvaluator evaluator = session.FindExpressionEvaluator (this);
if (evaluator != null)
return evaluator.GetLocals (this);
return GetAllLocals (session.EvaluationOptions);
var evaluator = session.FindExpressionEvaluator (this);
return evaluator != null ? evaluator.GetLocals (this) : GetAllLocals (session.EvaluationOptions);
}
public ObjectValue[] GetAllLocals (EvaluationOptions options)
{
if (!hasDebugInfo)
return new ObjectValue [0];
ObjectValue[] values = sourceBacktrace.GetAllLocals (index, options);
var values = sourceBacktrace.GetAllLocals (index, options);
ObjectValue.ConnectCallbacks (this, values);
return values;
}
@ -175,9 +175,11 @@ namespace Mono.Debugging.Client
{
if (!hasDebugInfo)
return null;
ObjectValue value = sourceBacktrace.GetThisReference (index, options);
var value = sourceBacktrace.GetThisReference (index, options);
if (value != null)
ObjectValue.ConnectCallbacks (this, value);
return value;
}
@ -190,9 +192,11 @@ namespace Mono.Debugging.Client
{
if (!hasDebugInfo)
return null;
ExceptionInfo value = sourceBacktrace.GetException (index, options);
var value = sourceBacktrace.GetException (index, options);
if (value != null)
value.ConnectCallback (this);
return value;
}
@ -203,7 +207,7 @@ namespace Mono.Debugging.Client
public ObjectValue[] GetExpressionValues (string[] expressions, bool evaluateMethods)
{
EvaluationOptions options = session.EvaluationOptions.Clone ();
var options = session.EvaluationOptions.Clone ();
options.AllowMethodEvaluation = evaluateMethods;
return GetExpressionValues (expressions, options);
}
@ -211,25 +215,29 @@ namespace Mono.Debugging.Client
public ObjectValue[] GetExpressionValues (string[] expressions, EvaluationOptions options)
{
if (!hasDebugInfo) {
ObjectValue[] vals = new ObjectValue [expressions.Length];
for (int n=0; n<expressions.Length; n++)
vals [n] = ObjectValue.CreateUnknown (expressions [n]);
var vals = new ObjectValue [expressions.Length];
for (int n = 0; n < expressions.Length; n++)
vals[n] = ObjectValue.CreateUnknown (expressions[n]);
return vals;
}
if (options.UseExternalTypeResolver) {
string[] resolved = new string [expressions.Length];
for (int n=0; n<expressions.Length; n++)
resolved [n] = ResolveExpression (expressions [n]);
var resolved = new string [expressions.Length];
for (int n = 0; n < expressions.Length; n++)
resolved[n] = ResolveExpression (expressions[n]);
expressions = resolved;
}
ObjectValue[] values = sourceBacktrace.GetExpressionValues (index, expressions, options);
var values = sourceBacktrace.GetExpressionValues (index, expressions, options);
ObjectValue.ConnectCallbacks (this, values);
return values;
}
public ObjectValue GetExpressionValue (string expression, bool evaluateMethods)
{
EvaluationOptions options = session.EvaluationOptions.Clone ();
var options = session.EvaluationOptions.Clone ();
options.AllowMethodEvaluation = evaluateMethods;
return GetExpressionValue (expression, options);
}
@ -238,9 +246,11 @@ namespace Mono.Debugging.Client
{
if (!hasDebugInfo)
return ObjectValue.CreateUnknown (expression);
if (options.UseExternalTypeResolver)
expression = ResolveExpression (expression);
ObjectValue[] values = sourceBacktrace.GetExpressionValues (index, new string[] { expression }, options);
var values = sourceBacktrace.GetExpressionValues (index, new [] { expression }, options);
ObjectValue.ConnectCallbacks (this, values);
return values [0];
}
@ -260,14 +270,13 @@ namespace Mono.Debugging.Client
{
if (options.UseExternalTypeResolver)
expression = ResolveExpression (expression);
return sourceBacktrace.ValidateExpression (index, expression, options);
}
public CompletionData GetExpressionCompletionData (string exp)
{
if (!hasDebugInfo)
return null;
return sourceBacktrace.GetExpressionCompletionData (index, exp);
return hasDebugInfo ? sourceBacktrace.GetExpressionCompletionData (index, exp) : null;
}
// Returns disassembled code for this stack frame.
@ -280,21 +289,26 @@ namespace Mono.Debugging.Client
public override string ToString()
{
string loc;
if (location.Line != -1 && !string.IsNullOrEmpty (location.FileName))
if (location.Line != -1 && !string.IsNullOrEmpty (location.FileName)) {
loc = " at " + location.FileName + ":" + location.Line;
else if (!string.IsNullOrEmpty (location.FileName))
if (location.Column != 0)
loc += "," + location.Column;
} else if (!string.IsNullOrEmpty (location.FileName)) {
loc = " at " + location.FileName;
else
loc = "";
return String.Format("0x{0:X} in {1}{2}", address, location.MethodName, loc);
} else {
loc = string.Empty;
}
return string.Format ("0x{0:X} in {1}{2}", address, location.MethodName, loc);
}
}
[Serializable]
public struct ValidationResult
{
bool isValid;
string message;
readonly string message;
readonly bool isValid;
public ValidationResult (bool isValid, string message)
{

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше