···11-# DebugSymbols.framework
22-33-`DebugSymbols.framework` helps locate dSYM files when given a UUID.
44-
+49
src/DebugSymbols/functions.c
···11+/*
22+This file is part of Darling.
33+44+Copyright (C) 2017 Lubos Dolezel
55+66+Darling is free software: you can redistribute it and/or modify
77+it under the terms of the GNU General Public License as published by
88+the Free Software Foundation, either version 3 of the License, or
99+(at your option) any later version.
1010+1111+Darling is distributed in the hope that it will be useful,
1212+but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+GNU General Public License for more details.
1515+1616+You should have received a copy of the GNU General Public License
1717+along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+void DBGAddDSYMURL(void) { }
2121+void DBGBlockPath(void) { }
2222+void DBGCopyDSYMPropertyLists(void) { }
2323+void DBGCopyDSYMURLForUUID(void) { }
2424+void DBGCopyDSYMURLForUUIDWithOptions(void) { }
2525+void DBGCopyFullDSYMURLForUUID(void) { }
2626+void DBGCopyFullDSYMURLForUUIDWithOptions(void) { }
2727+void DBGCopyMatchingUUIDsForURL(void) { }
2828+void DBGDwarfClose(void) { }
2929+void DBGDwarfGetAttributeKey(void) { }
3030+void DBGDwarfGetCompileUnitFunctions(void) { }
3131+void DBGDwarfGetCompileUnitLineTable(void) { }
3232+void DBGDwarfGetCompileUnits(void) { }
3333+void DBGDwarfGetDIEObjectsForAddress(void) { }
3434+void DBGDwarfGetFirstChild(void) { }
3535+void DBGDwarfGetLinkMap(void) { }
3636+void DBGDwarfGetParent(void) { }
3737+void DBGDwarfGetSibling(void) { }
3838+void DBGDwarfGetTagKey(void) { }
3939+void DBGDwarfOpen(void) { }
4040+void DBGExplicitSearchPathAdd(void) { }
4141+void DBGExplicitSearchPathRemove(void) { }
4242+void DBGExplicitSearchPathRemoveAll(void) { }
4343+void DBGPauseWatchingPaths(void) { }
4444+void DBGRegisterObserver(void) { }
4545+void DBGResumeWatchingPaths(void) { }
4646+void DBGSpotlightStart(void) { }
4747+void DBGSpotlightStop(void) { }
4848+void DBGTerminate(void) { }
4949+void DBGUnregisterObserver(void) { }
+49
src/DebugSymbols/functions.h
···11+/*
22+This file is part of Darling.
33+44+Copyright (C) 2017 Lubos Dolezel
55+66+Darling is free software: you can redistribute it and/or modify
77+it under the terms of the GNU General Public License as published by
88+the Free Software Foundation, either version 3 of the License, or
99+(at your option) any later version.
1010+1111+Darling is distributed in the hope that it will be useful,
1212+but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+GNU General Public License for more details.
1515+1616+You should have received a copy of the GNU General Public License
1717+along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+void DBGAddDSYMURL(void);
2121+void DBGBlockPath(void);
2222+void DBGCopyDSYMPropertyLists(void);
2323+void DBGCopyDSYMURLForUUID(void);
2424+void DBGCopyDSYMURLForUUIDWithOptions(void);
2525+void DBGCopyFullDSYMURLForUUID(void);
2626+void DBGCopyFullDSYMURLForUUIDWithOptions(void);
2727+void DBGCopyMatchingUUIDsForURL(void);
2828+void DBGDwarfClose(void);
2929+void DBGDwarfGetAttributeKey(void);
3030+void DBGDwarfGetCompileUnitFunctions(void);
3131+void DBGDwarfGetCompileUnitLineTable(void);
3232+void DBGDwarfGetCompileUnits(void);
3333+void DBGDwarfGetDIEObjectsForAddress(void);
3434+void DBGDwarfGetFirstChild(void);
3535+void DBGDwarfGetLinkMap(void);
3636+void DBGDwarfGetParent(void);
3737+void DBGDwarfGetSibling(void);
3838+void DBGDwarfGetTagKey(void);
3939+void DBGDwarfOpen(void);
4040+void DBGExplicitSearchPathAdd(void);
4141+void DBGExplicitSearchPathRemove(void);
4242+void DBGExplicitSearchPathRemoveAll(void);
4343+void DBGPauseWatchingPaths(void);
4444+void DBGRegisterObserver(void);
4545+void DBGResumeWatchingPaths(void);
4646+void DBGSpotlightStart(void);
4747+void DBGSpotlightStop(void);
4848+void DBGTerminate(void);
4949+void DBGUnregisterObserver(void);
···88long sys_getgroups(unsigned int size, int* gidset)
99{
1010 int ret;
1111-1212- if (getenv("__FAKE_SETUID_ROOT"))
1111+1212+ if (getenv("__FAKE_SETGID_ROOT"))
1313 {
1414 if (size >= 1)
1515 {
···11+# This file is part of Darling.
22+#
33+# Copyright (C) 2017 Lubos Dolezel
44+#
55+# Darling is free software: you can redistribute it and/or modify
66+# it under the terms of the GNU General Public License as published by
77+# the Free Software Foundation, either version 3 of the License, or
88+# (at your option) any later version.
99+#
1010+# Darling is distributed in the hope that it will be useful,
1111+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1212+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313+# GNU General Public License for more details.
1414+#
1515+# You should have received a copy of the GNU General Public License
1616+# along with Darling. If not, see <http://www.gnu.org/licenses/>.
1717+1818+import sys
1919+import subprocess
2020+2121+def usage():
2222+ print("Usage: %s <Mach-O> <output directory>" % sys.argv[0])
2323+2424+if len(sys.argv) != 3:
2525+ usage()
2626+2727+macho = sys.argv[1]
2828+dest = sys.argv[2]
2929+3030+out = subprocess.check_output(["nm", "-Ug", macho])
3131+3232+functions = []
3333+for line in out.splitlines():
3434+ if line == "":
3535+ continue
3636+ address, id, name = line.split(" ")
3737+ # Remove the underscore
3838+ name = name[1 : ]
3939+4040+ if id == "T":
4141+ functions.append(name)
4242+4343+header = open(dest + "/functions.h", "w")
4444+source = open(dest + "/functions.c", "w")
4545+4646+copyright ="""/*
4747+This file is part of Darling.
4848+4949+Copyright (C) 2017 Lubos Dolezel
5050+5151+Darling is free software: you can redistribute it and/or modify
5252+it under the terms of the GNU General Public License as published by
5353+the Free Software Foundation, either version 3 of the License, or
5454+(at your option) any later version.
5555+5656+Darling is distributed in the hope that it will be useful,
5757+but WITHOUT ANY WARRANTY; without even the implied warranty of
5858+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5959+GNU General Public License for more details.
6060+6161+You should have received a copy of the GNU General Public License
6262+along with Darling. If not, see <http://www.gnu.org/licenses/>.
6363+*/
6464+6565+"""
6666+6767+header.write(copyright)
6868+source.write(copyright)
6969+7070+for funcname in functions:
7171+ header.write("void %s(void);\n" % funcname)
7272+ source.write("void %s(void) { }\n" % funcname)